aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_hg_prompt.fish
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2015-10-01 02:06:18 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2015-12-31 14:21:37 +0100
commitc3971957acf63ed2ff2b4e319c8405a8fce4a14d (patch)
treee428b556e51dac3e330aee98c58c200a5bd1e560 /share/functions/__fish_hg_prompt.fish
parent9a7b2b190b816e6b3ca5a4583cbba1f76ae113ef (diff)
hg prompt: Fix indentation
Diffstat (limited to 'share/functions/__fish_hg_prompt.fish')
-rw-r--r--share/functions/__fish_hg_prompt.fish48
1 files changed, 24 insertions, 24 deletions
diff --git a/share/functions/__fish_hg_prompt.fish b/share/functions/__fish_hg_prompt.fish
index 458924e6..6a9f00a9 100644
--- a/share/functions/__fish_hg_prompt.fish
+++ b/share/functions/__fish_hg_prompt.fish
@@ -21,34 +21,34 @@ set -g fish_prompt_hg_status_unmerged '!'
set -g fish_prompt_hg_status_order added modified copied deleted untracked unmerged
function __fish_hg_prompt --description 'Write out the hg prompt'
- # If hg isn't installed, there's nothing we can do
- # Return 1 so the calling prompt can deal with it
- if not command -s hg >/dev/null
- 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
+ # If hg isn't installed, there's nothing we can do
+ # Return 1 so the calling prompt can deal with it
+ if not command -s hg > /dev/null
+ 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
while test $dir != "/"
- if test -f $dir'/.hg/dirstate'
- set root $dir"/.hg"
- break
- end
- # Go up one directory
- set -l dir (string replace -r '[^/]*/?$' '' $dir)
+ if test -f $dir'/.hg/dirstate'
+ set root $dir"/.hg"
+ break
+ end
+ # Go up one directory
+ set -l dir (string replace -r '[^/]*/?$' '' $dir)
end
- if test -z "$root"
- return 0
- end
+ if test -z "$root"
+ return 0
+ end
- # Read branch and bookmark
+ # Read branch and bookmark
set -l branch (cat $root/branch ^/dev/null; or echo default)
- if set -l bookmark (cat $root/bookmarks.current ^/dev/null)
- set branch "$branch|$bookmark"
- end
+ if set -l bookmark (cat $root/bookmarks.current ^/dev/null)
+ set branch "$branch|$bookmark"
+ end
echo -n '|'
@@ -60,7 +60,7 @@ function __fish_hg_prompt --description 'Write out the hg prompt'
echo -n "($branch)"'✓'
set_color normal
- # Handle modified or dirty (unknown state)
+ # Handle modified or dirty (unknown state)
else
set -l hg_statuses