81a6cc5050136399ea0c664bacb8f83a999fe866

Author
Mirko Lelansky <mlelansky@mail.de>
Committer
GitHub <noreply@github.com>
Date

Message

feat(plugins): Add helper function to get current mercurial bookmark (#4970)

Add a new function to get the current mercurial bookmark which can be
used in the theme prompts for example.

Diff

 1diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
 2index f13430476af55fd7cd8605e3e19c0c2a5b87d6af..a50dcb523f814e74eacabeb392e744e676cb2893 100644
 3--- a/plugins/mercurial/mercurial.plugin.zsh
 4+++ b/plugins/mercurial/mercurial.plugin.zsh
 5@@ -63,3 +63,9 @@ function hgic() {
 6 function hgoc() {
 7     hg outgoing "$@" | grep "changeset" | wc -l
 8 }
 9+
10+function hg_get_bookmark_name() {
11+  if [ $(in_hg) ]; then
12+    echo $(hg id -B)
13+  fi
14+}