mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
30 lines
No EOL
716 B
Bash
30 lines
No EOL
716 B
Bash
|
|
# Mercurial
|
|
alias hgc='hg commit'
|
|
alias hgb='hg branch'
|
|
alias hgba='hg branches'
|
|
alias hgco='hg checkout'
|
|
alias hgd='hg diff'
|
|
alias hged='hg diffmerge'
|
|
# pull and update
|
|
alias hgl='hg pull -u'
|
|
alias hgp='hg push'
|
|
alias hgs='hg status'
|
|
# this is the 'git commit --amend' equivalent
|
|
alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
|
|
|
|
function hg_current_branch() {
|
|
if [ -d .hg ]; then
|
|
echo $(hg branch)
|
|
fi
|
|
}
|
|
|
|
parse_hg_dirty() {
|
|
hg status 2> /dev/null \
|
|
| awk '$1 == "?" { unknown = 1 }
|
|
$1 != "?" { changed = 1 }
|
|
END {
|
|
if (changed) printf "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
|
else if (unknown) printf "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
|
}'
|
|
} |