Skip to content

Instantly share code, notes, and snippets.

@f440
Created April 4, 2012 06:01
Show Gist options
  • Save f440/2298292 to your computer and use it in GitHub Desktop.
Save f440/2298292 to your computer and use it in GitHub Desktop.
# ref: https://raw.github.com/gist/1849889/zaw-git-branch.zsh
function zaw-src-hg-bookmark() {
hg stat >/dev/null 2>&1
if [[ $? == 0 ]]; then
candidates=(`hg bookmarks | sed -e 's/\*//' | awk '{print $1}'`)
fi
actions=("zaw-src-hg-checkout" "zaw-callback-append-to-buffer")
act_descriptions=("hg update" "append to edit buffer")
}
function zaw-src-hg-checkout () {
BUFFER="hg update -C $1"
zle accept-line
}
zaw-register-src -n hg-bookmark zaw-src-hg-bookmark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment