bash-it/plugins/available/hg.plugin.bash

53 lines
1.5 KiB
Bash

cite about-plugin
about-plugin 'hg helper functions'
function hg_dirty()
{
############ STACK_TRACE_BUILDER #####################
Function_Name="${FUNCNAME[0]}"
Function_PATH="${Function_PATH}/${Function_Name}"
######################################################
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
############### Stack_TRACE_BUILDER ################
Function_PATH="$( dirname ${Function_PATH} )"
####################################################
}
function hg_in_repo()
{
############ STACK_TRACE_BUILDER #####################
Function_Name="${FUNCNAME[0]}"
Function_PATH="${Function_PATH}/${Function_Name}"
######################################################
about 'determine if pwd is an hg repo'
group 'hg'
[[ `hg branch 2> /dev/null` ]] && echo 'on '
############### Stack_TRACE_BUILDER ################
Function_PATH="$( dirname ${Function_PATH} )"
####################################################
}
function hg_branch()
{
############ STACK_TRACE_BUILDER #####################
Function_Name="${FUNCNAME[0]}"
Function_PATH="${Function_PATH}/${Function_Name}"
######################################################
about 'display current hg branch'
group 'hg'
hg branch 2> /dev/null
############### Stack_TRACE_BUILDER ################
Function_PATH="$( dirname ${Function_PATH} )"
####################################################
}