Re: [REPOST] kbuild: support mercurial in setlocalversion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 28, 2007 at 04:55:44PM -0500, Aron Griffis wrote:
> No responses the first time, reposting.
> 
> This patch for setlocalversion enables support for mercurial
> repositories.  This is for people that work from
> http://kernel.org/hg/linux-2.6 as well as for projects that use
> mercurial as their primary SCM, such as Xen.
> 

First one still queued.
Just lacking some time to spend on kbuild lately.

Will get back to it in a week or two.

	Sam

> Aron
> 
> # HG changeset patch
> # User Aron Griffis <aron@xxxxxx>
> # Date 1195059048 28800
> # Node ID 2f316350070c10340bfcdef14bf7dfdd1d458729
> # Parent  c60016ba6237ec6b45591d3baf41066971ea339e
> 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 <aron@xxxxxx>
> 
> diff -r c60016ba6237 -r 2f316350070c scripts/setlocalversion
> --- a/scripts/setlocalversion	Tue Nov 13 09:09:36 2007 -0800
> +++ b/scripts/setlocalversion	Wed Nov 14 08:50:48 2007 -0800
> @@ -19,4 +19,27 @@ if head=`git rev-parse --verify HEAD 2>/
>  	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 linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux