1038
|
1 function fish_right_prompt
|
|
2 if not command -sq hg
|
|
3 return 1
|
|
4 end
|
|
5
|
|
6 set -l root (fish_print_hg_root)
|
|
7 or return 1
|
|
8
|
|
9 # In stead of running this command, cat the branch and topic name from the .hg folder
|
|
10 # echo (set_color yellow)(HGPLAIN= HGRCPATH= hg --config extensions.topic= log -r 'wdir()' --template='{fqbn}' 2>/dev/null) (set_color normal)
|
|
11 set -l branch (cat $root/branch 2>/dev/null; or echo default)
|
|
12 if set -l topic (cat $root/topic 2>/dev/null)
|
|
13 set branch "$branch//$topic"
|
|
14 end
|
|
15 # TODO: add topic namespace when available
|
|
16
|
|
17 echo (set_color green)"$branch "(set_color normal)
|
|
18 end
|