Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3dce174cfcba11026b028d33bed0438b80e37124
Commit:     3dce174cfcba11026b028d33bed0438b80e37124
Parent:     2f4b489b77c68b9cba1bd9dec5a1bbf0ab3c47f8
Author:     Aron Griffis <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 28 16:55:44 2007 -0500
Committer:  Sam Ravnborg <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 23:14:36 2008 +0100

    kbuild: support mercurial in setlocalversion
    
    This represents mercurial changesets similarly to git.  For untagged
    revisions, append the changeset id.  If there are uncommitted changes,
    append -dirty.  For example, -hgc60016ba6237-dirty
    
    Signed-off-by: Aron Griffis <[EMAIL PROTECTED]>
    Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]>
---
 scripts/setlocalversion |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 82e4993..a80d6ea 100644
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -19,4 +19,27 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then
        if git diff-index HEAD | read dummy; then
                printf '%s' -dirty
        fi
+
+       # All done with git
+       exit
+fi
+
+# Check for mercurial and a mercurial repo.
+if hgid=`hg id 2>/dev/null`; then
+       tag=`printf '%s' "$hgid" | cut -d' ' -f2`
+
+       # Do we have an untagged version?
+       if [ -z "$tag" -o "$tag" = tip ]; then
+               id=`printf '%s' "$hgid" | sed 's/[+ ].*//'`
+               printf '%s%s' -hg "$id"
+       fi
+
+       # Are there uncommitted changes?
+       # These are represented by + after the changeset id.
+       case "$hgid" in
+               *+|*+\ *) printf '%s' -dirty ;;
+       esac
+
+       # All done with mercurial
+       exit
 fi
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to