浏览代码

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.
Mirko Lelansky 3 年之前
父节点
当前提交
81a6cc5050
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      plugins/mercurial/mercurial.plugin.zsh

+ 6 - 0
plugins/mercurial/mercurial.plugin.zsh

@@ -63,3 +63,9 @@ function hgic() {
 function hgoc() {
     hg outgoing "$@" | grep "changeset" | wc -l
 }
+
+function hg_get_bookmark_name() {
+  if [ $(in_hg) ]; then
+    echo $(hg id -B)
+  fi
+}