]> git.donarmstrong.com Git - zsh.git/commitdiff
Add mercurial support
authormartin f. krafft <madduck@madduck.net>
Tue, 6 May 2008 22:48:47 +0000 (23:48 +0100)
committermartin f. krafft <madduck@madduck.net>
Tue, 6 May 2008 22:48:47 +0000 (23:48 +0100)
.zsh/zshrc/85_vcs_prompt

index e96b7728f41eda77213ac5b7794cc2317f56621c..b608a6c7f806497bea37f9de897bbbde3f019bdf 100644 (file)
@@ -31,6 +31,16 @@ __git_get_branch()
   echo "${ref#refs/heads/}"
 }
 
+__hg_get_reporoot()
+{
+  hg root
+}
+
+__hg_get_branch()
+{
+  echo "hg:$(hg branch)"
+}
+
 __vcs_get_repo_type()
 {
   # return the type of the closest repository in the path hierarchy
@@ -115,6 +125,12 @@ __vcs_set_prompt_variables()
       branch="$(__git_get_branch)" ||
         { error "could not determine git branch"; return 1 }
       ;;
+    hg)
+      reporoot="$(__hg_get_reporoot)" ||
+        { error "could not determine hg repository root"; return 1 }
+      branch="$(__hg_get_branch)" ||
+        { error "could not determine hg branch"; return 1 }
+      ;;
     *)
       case "$repotype" in
         NONE) :;;