mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-30 14:53:11 +00:00
c2970f9618
This runs build_tools/style.fish, which runs clang-format on C++, fish_indent on fish and (new) black on python. If anything is wrong with the formatting, we should fix the tools, but automated formatting is worth it.
22 lines
506 B
Fish
22 lines
506 B
Fish
function fish_print_hg_root
|
|
# If hg isn't installed, there's nothing we can do
|
|
if not command -sq hg
|
|
return 1
|
|
end
|
|
|
|
# Find an hg directory above $PWD
|
|
# without calling `hg root` because that's too slow
|
|
set -l root
|
|
set -l dir (pwd -P)
|
|
while test $dir != "/"
|
|
if test -f $dir'/.hg/dirstate'
|
|
echo $dir/.hg
|
|
return 0
|
|
end
|
|
# Go up one directory
|
|
set dir (string replace -r '[^/]*/?$' '' $dir)
|
|
end
|
|
|
|
return 1
|
|
end
|
|
|