about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrank Terbeck <bewater@users.sourceforge.net>2010-05-27 10:06:16 +0000
committerFrank Terbeck <bewater@users.sourceforge.net>2010-05-27 10:06:16 +0000
commit17b7471fbc4a129b285ab664cf40fa2e6e806f3b (patch)
tree709eee1a71ffb0c9f7bf98f724b884ed20d43435
parent35d3418aebfb5cc32cada19668fcbafc1b7ad162 (diff)
downloadzsh-17b7471fbc4a129b285ab664cf40fa2e6e806f3b.tar.gz
zsh-17b7471fbc4a129b285ab664cf40fa2e6e806f3b.tar.xz
zsh-17b7471fbc4a129b285ab664cf40fa2e6e806f3b.zip
Seth House: 27971: vcs_info: Fix a bug that caused the mercurial backend to always return `default' as the branch name.
-rw-r--r--ChangeLog8
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_hg5
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c08063ab1..81d896e76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-27  Frank Terbeck  <ft@bewatermyfriend.org>
+
+	* Seth House: 27971: Functions/VCS_Info/Backends/VCS_INFO_get_data_hg:
+	vcs_info: Fix a bug that caused the mercurial backend to always return
+	`default' as the branch name.
+
 2010-05-23  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* users/15078: Completion/Zsh/Function/.distfiles,
@@ -13153,5 +13159,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4981 $
+* $Revision: 1.4982 $
 *****************************************************
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
index 2324bc809..8e91d2651 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
@@ -58,10 +58,11 @@ fi
 # If the user doesn't opt to invoke hg we can still get the current branch
 if [[ -z ${r_branch} && -r ${branchfile} ]] ; then
     r_branch=$(< ${branchfile})
-else
-    r_branch="default"
 fi
 
+# If we still don't know the branch it's safe to assume default
+[[ -n ${r_branch} ]] || r_branch="default"
+
 # The working dir has uncommitted-changes if the revision ends with a +
 if [[ $r_lrev[-1] == + ]] ; then
     hgchanges=1