aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/setlocalversion
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/setlocalversion')
-rwxr-xr-xscripts/setlocalversion14
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index ef8729f48586..4d403844e137 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -86,12 +86,16 @@ scm_version()
86 86
87 # Check for mercurial and a mercurial repo. 87 # Check for mercurial and a mercurial repo.
88 if test -d .hg && hgid=`hg id 2>/dev/null`; then 88 if test -d .hg && hgid=`hg id 2>/dev/null`; then
89 tag=`printf '%s' "$hgid" | cut -s -d' ' -f2` 89 # Do we have an tagged version? If so, latesttagdistance == 1
90 90 if [ "`hg log -r . --template '{latesttagdistance}'`" == "1" ]; then
91 # Do we have an untagged version? 91 id=`hg log -r . --template '{latesttag}'`
92 if [ -z "$tag" -o "$tag" = tip ]; then
93 id=`printf '%s' "$hgid" | sed 's/[+ ].*//'`
94 printf '%s%s' -hg "$id" 92 printf '%s%s' -hg "$id"
93 else
94 tag=`printf '%s' "$hgid" | cut -d' ' -f2`
95 if [ -z "$tag" -o "$tag" = tip ]; then
96 id=`printf '%s' "$hgid" | sed 's/[+ ].*//'`
97 printf '%s%s' -hg "$id"
98 fi
95 fi 99 fi
96 100
97 # Are there uncommitted changes? 101 # Are there uncommitted changes?