add bash-it
This commit is contained in:
25
dot_bash_it/plugins/available/hg.plugin.bash
Normal file
25
dot_bash_it/plugins/available/hg.plugin.bash
Normal file
@@ -0,0 +1,25 @@
|
||||
cite about-plugin
|
||||
about-plugin 'hg helper functions'
|
||||
|
||||
hg_dirty() {
|
||||
about 'displays dirty status of hg repository'
|
||||
group 'hg'
|
||||
|
||||
hg status --no-color 2> /dev/null \
|
||||
| awk '$1 == "?" { print "?" } $1 != "?" { print "!" }' \
|
||||
| sort | uniq | head -c1
|
||||
}
|
||||
|
||||
hg_in_repo() {
|
||||
about 'determine if pwd is an hg repo'
|
||||
group 'hg'
|
||||
|
||||
[[ `hg branch 2> /dev/null` ]] && echo 'on '
|
||||
}
|
||||
|
||||
hg_branch() {
|
||||
about 'display current hg branch'
|
||||
group 'hg'
|
||||
|
||||
hg branch 2> /dev/null
|
||||
}
|
||||
Reference in New Issue
Block a user