changeset 69:78b4a74a5452

Fix mercurial status spacing, make it show like Git
author IBBoard <dev@ibboard.co.uk>
date Tue, 25 Apr 2017 13:20:36 +0100
parents 38843a80f378
children 3b6eae8d3801
files bashrc
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/bashrc	Tue Apr 25 13:13:36 2017 +0100
+++ b/bashrc	Tue Apr 25 13:20:36 2017 +0100
@@ -45,8 +45,11 @@
 	VCS_EXTRA=$(__git_ps1 "%s")
 
 	if [[ "x$VCS_EXTRA" == "x" ]]; then
-		#FIXME: Currently shows "-" even when no incoming changes
-		VCS_EXTRA=$(hg prompt "{branch} {-{incoming|count}}{+{outgoing|count}}" 2>/dev/null)
+		VCS_EXTRA=$(hg branch 2>/dev/null)
+		HG_EXTRA=$(hg prompt "{-{incoming|count}}{+{outgoing|count}}" 2>/dev/null)
+		if [[ "x$HG_EXTRA" != "x" ]]; then
+			VCS_EXTRA="${VCS_EXTRA} u${HG_EXTRA}"
+		fi
 	fi
 	if [[ "x$VCS_EXTRA" != "x" ]]; then
 		echo -n " ($VCS_EXTRA)"