public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [RFC ECLASS PATCH] Include exact Hg revision data for repeatability from logs.
@ 2010-08-23 21:23 Robin H. Johnson
  2010-08-24  5:39 ` Krzysztof Pawlik
  2010-08-24  7:18 ` Dirkjan Ochtman
  0 siblings, 2 replies; 4+ messages in thread
From: Robin H. Johnson @ 2010-08-23 21:23 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1734 bytes --]

The existing EHG_REVISION is the target revision, usually 'tip', so it
doesn't help us reproduce a bug if the upstream tree has moved since log
creation.

Example output:
* Work directory: /var/tmp/portage/.... global id: 44cff02c8042 branch: default

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>

Index: mercurial.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v
retrieving revision 1.12
diff -p -w -b -B -u -r1.12 mercurial.eclass
--- mercurial.eclass	2 Apr 2010 18:29:39 -0000	1.12
+++ mercurial.eclass	23 Aug 2010 21:20:41 -0000
@@ -116,12 +116,20 @@ function mercurial_fetch {
 	fi
 
 	# Checkout working copy:
-	einfo "Creating working directory in ${WORKDIR}/${module} (revision: ${EHG_REVISION})"
+	einfo "Creating working directory in ${WORKDIR}/${module} (target revision: ${EHG_REVISION})"
 	hg clone \
 		${EHG_QUIET_CMD_OPT} \
 		--rev="${EHG_REVISION}" \
 		"${EHG_STORE_DIR}/${EHG_PROJECT}/${module}" \
 		"${WORKDIR}/${module}" || die "hg clone failed"
+	# An exact revision helps a lot for testing purposes, so have some output...
+	# id           num  branch
+	# fd6e32d61721 6276 default
+	local HG_REVDATA=($(hg identify -n -b -i "${WORKDIR}/${module}"))
+	local HG_REV_ID=${HG_REVDATA[0]}
+	local HG_REV_NUM=${HG_REVDATA[1]}
+	local HG_REV_BRANCH=${HG_REVDATA[2]}
+	einfo "Work directory: ${WORKDIR}/${module} global id: ${HG_REV_ID} branch: ${HG_REV_BRANCH}"
 }
 
 # @FUNCTION: mercurial_src_unpack

-- 
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

[-- Attachment #2: Type: application/pgp-signature, Size: 330 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [RFC ECLASS PATCH] Include exact Hg revision data for repeatability from logs.
  2010-08-23 21:23 [gentoo-dev] [RFC ECLASS PATCH] Include exact Hg revision data for repeatability from logs Robin H. Johnson
@ 2010-08-24  5:39 ` Krzysztof Pawlik
  2010-08-24  7:18 ` Dirkjan Ochtman
  1 sibling, 0 replies; 4+ messages in thread
From: Krzysztof Pawlik @ 2010-08-24  5:39 UTC (permalink / raw
  Cc: Gentoo Dev

[-- Attachment #1: Type: text/plain, Size: 1831 bytes --]

On 08/23/10 23:23, Robin H. Johnson wrote:
> The existing EHG_REVISION is the target revision, usually 'tip', so it
> doesn't help us reproduce a bug if the upstream tree has moved since log
> creation.
> 
> Example output:
> * Work directory: /var/tmp/portage/.... global id: 44cff02c8042 branch: default
> 
> Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
> 
> Index: mercurial.eclass
> ===================================================================
> RCS file: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v
> retrieving revision 1.12
> diff -p -w -b -B -u -r1.12 mercurial.eclass
> --- mercurial.eclass	2 Apr 2010 18:29:39 -0000	1.12
> +++ mercurial.eclass	23 Aug 2010 21:20:41 -0000
> @@ -116,12 +116,20 @@ function mercurial_fetch {
>  	fi
>  
>  	# Checkout working copy:
> -	einfo "Creating working directory in ${WORKDIR}/${module} (revision: ${EHG_REVISION})"
> +	einfo "Creating working directory in ${WORKDIR}/${module} (target revision: ${EHG_REVISION})"
>  	hg clone \
>  		${EHG_QUIET_CMD_OPT} \
>  		--rev="${EHG_REVISION}" \
>  		"${EHG_STORE_DIR}/${EHG_PROJECT}/${module}" \
>  		"${WORKDIR}/${module}" || die "hg clone failed"
> +	# An exact revision helps a lot for testing purposes, so have some output...
> +	# id           num  branch
> +	# fd6e32d61721 6276 default
> +	local HG_REVDATA=($(hg identify -n -b -i "${WORKDIR}/${module}"))
> +	local HG_REV_ID=${HG_REVDATA[0]}
> +	local HG_REV_NUM=${HG_REVDATA[1]}
> +	local HG_REV_BRANCH=${HG_REVDATA[2]}
> +	einfo "Work directory: ${WORKDIR}/${module} global id: ${HG_REV_ID} branch: ${HG_REV_BRANCH}"
>  }
>  
>  # @FUNCTION: mercurial_src_unpack
> 

+1 Robin :) Ship it!

-- 
Krzysztof Pawlik  <nelchael at gentoo.org>  key id: 0xF6A80E46
desktop-misc, java, apache, ppc, vim, kernel, python...


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 554 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [RFC ECLASS PATCH] Include exact Hg revision data for repeatability from logs.
  2010-08-23 21:23 [gentoo-dev] [RFC ECLASS PATCH] Include exact Hg revision data for repeatability from logs Robin H. Johnson
  2010-08-24  5:39 ` Krzysztof Pawlik
@ 2010-08-24  7:18 ` Dirkjan Ochtman
  2010-08-24 16:53   ` Robin H. Johnson
  1 sibling, 1 reply; 4+ messages in thread
From: Dirkjan Ochtman @ 2010-08-24  7:18 UTC (permalink / raw
  To: gentoo-dev

On Mon, Aug 23, 2010 at 23:23, Robin H. Johnson <robbat2@gentoo.org> wrote:
> Index: mercurial.eclass
> ===================================================================
> RCS file: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v
> retrieving revision 1.12
> diff -p -w -b -B -u -r1.12 mercurial.eclass
> --- mercurial.eclass    2 Apr 2010 18:29:39 -0000       1.12
> +++ mercurial.eclass    23 Aug 2010 21:20:41 -0000
> @@ -116,12 +116,20 @@ function mercurial_fetch {
>        fi
>
>        # Checkout working copy:
> -       einfo "Creating working directory in ${WORKDIR}/${module} (revision: ${EHG_REVISION})"
> +       einfo "Creating working directory in ${WORKDIR}/${module} (target revision: ${EHG_REVISION})"
>        hg clone \
>                ${EHG_QUIET_CMD_OPT} \
>                --rev="${EHG_REVISION}" \
>                "${EHG_STORE_DIR}/${EHG_PROJECT}/${module}" \
>                "${WORKDIR}/${module}" || die "hg clone failed"
> +       # An exact revision helps a lot for testing purposes, so have some output...
> +       # id           num  branch
> +       # fd6e32d61721 6276 default
> +       local HG_REVDATA=($(hg identify -n -b -i "${WORKDIR}/${module}"))
> +       local HG_REV_ID=${HG_REVDATA[0]}
> +       local HG_REV_NUM=${HG_REVDATA[1]}
> +       local HG_REV_BRANCH=${HG_REVDATA[2]}
> +       einfo "Work directory: ${WORKDIR}/${module} global id: ${HG_REV_ID} branch: ${HG_REV_BRANCH}"
>  }

I'd leave out the HG_REV_NUM, it doesn't mean much anyway (since it is
local to a repository, it can easily change).

Cheers,

Dirkjan



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] [RFC ECLASS PATCH] Include exact Hg revision data for repeatability from logs.
  2010-08-24  7:18 ` Dirkjan Ochtman
@ 2010-08-24 16:53   ` Robin H. Johnson
  0 siblings, 0 replies; 4+ messages in thread
From: Robin H. Johnson @ 2010-08-24 16:53 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 412 bytes --]

On Tue, Aug 24, 2010 at 09:18:02AM +0200, Dirkjan Ochtman wrote:
> I'd leave out the HG_REV_NUM, it doesn't mean much anyway (since it is
> local to a repository, it can easily change).
Ok, dropped that and committed the rest.

-- 
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

[-- Attachment #2: Type: application/pgp-signature, Size: 330 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-24 16:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-23 21:23 [gentoo-dev] [RFC ECLASS PATCH] Include exact Hg revision data for repeatability from logs Robin H. Johnson
2010-08-24  5:39 ` Krzysztof Pawlik
2010-08-24  7:18 ` Dirkjan Ochtman
2010-08-24 16:53   ` Robin H. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox