fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
5e25cdaa6
master
1function fish_print_hg_root 2# If hg isn't installed, there's nothing we can do 3if not command -sq hg 4return 1 5end 6 7# Find an hg directory above $PWD 8# without calling `hg root` because that's too slow 9set -l root 10set -l dir"$ ( pwd -P 2> /dev/null ) " 11or return 1 12 13while not contains --" $dir " "" / . 14if test -f $dir '/.hg/dirstate' 15echo $dir /.hg 16return 0 17end 18# Go up one directory 19set dir( path dirname --$dir ) 20end 21 22return 1 23end