Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: vcs_info Mercurial backend branch name display



This patch fixes a VCS_Info bug (introduced by me) that broke the branch display 
by always displaying as "default".

Sorry for the patch noise.
- Seth

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg 
b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
@@ -58,10 +58,11 @@
 # 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
+if [[ -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



Messages sorted by: Reverse Date, Date, Thread, Author