summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-01-22 14:22:25 +0000
committerMichal Marek <mmarek@suse.cz>2011-01-22 14:22:25 +0000
commit0cfd7f94cbf8e779753671013a7f4440f2ad9a2b (patch)
treeb057cbd49db5d9d7a71ec1e82618e088eb3d64ca /scripts
parent056b7f0109c886456ed603ef5804136acbb71989 (diff)
parentf4ed1009fcea8502d1191ef3e435e9d83c286b80 (diff)
Merge branch 'misc' into for-next
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/setlocalversion14
-rwxr-xr-xscripts/tags.sh9
2 files changed, 18 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()
# 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?
diff --git a/scripts/tags.sh b/scripts/tags.sh
index e091db312ddb..5d17c71a8161 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -114,6 +114,11 @@ docscope()
cscope -b -f cscope.out
}
+dogtags()
+{
+ all_sources | gtags -f -
+}
+
exuberant()
{
all_sources | xargs $1 -a \
@@ -185,6 +190,10 @@ case "$1" in
docscope
;;
+ "gtags")
+ dogtags
+ ;;
+
"tags")
rm -f tags
xtags ctags