You need to sign in or sign up before continuing.
提交 38b3439d 编写于 作者: M Mike Crowe 提交者: Michal Marek

setlocalversion: update mercurial tag parsing

The tag output of hg doesn't quite match what setlocalversion currently
expects, so update it to handle the latest format.
Signed-off-by: NMike Crowe <mcrowe@zipitwireless.com>
Signed-off-by: NMike Frysinger <vapier@gentoo.org>
Signed-off-by: NMichal Marek <mmarek@suse.cz>
上级 0719e1d2
......@@ -86,12 +86,16 @@ scm_version()
# Check for mercurial and a mercurial repo.
if test -d .hg && hgid=`hg id 2>/dev/null`; then
tag=`printf '%s' "$hgid" | cut -s -d' ' -f2`
# Do we have an untagged version?
if [ -z "$tag" -o "$tag" = tip ]; then
id=`printf '%s' "$hgid" | sed 's/[+ ].*//'`
# Do we have an tagged version? If so, latesttagdistance == 1
if [ "`hg log -r . --template '{latesttagdistance}'`" == "1" ]; then
id=`hg log -r . --template '{latesttag}'`
printf '%s%s' -hg "$id"
else
tag=`printf '%s' "$hgid" | cut -d' ' -f2`
if [ -z "$tag" -o "$tag" = tip ]; then
id=`printf '%s' "$hgid" | sed 's/[+ ].*//'`
printf '%s%s' -hg "$id"
fi
fi
# Are there uncommitted changes?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册