Gentoo Archives: gentoo-dev

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [RFC ECLASS PATCH] Include exact Hg revision data for repeatability from logs.
Date: Mon, 23 Aug 2010 21:23:58
Message-Id: robbat2-20100823T212204-147972867Z@orbis-terrarum.net
1 The existing EHG_REVISION is the target revision, usually 'tip', so it
2 doesn't help us reproduce a bug if the upstream tree has moved since log
3 creation.
4
5 Example output:
6 * Work directory: /var/tmp/portage/.... global id: 44cff02c8042 branch: default
7
8 Signed-off-by: Robin H. Johnson <robbat2@g.o>
9
10 Index: mercurial.eclass
11 ===================================================================
12 RCS file: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v
13 retrieving revision 1.12
14 diff -p -w -b -B -u -r1.12 mercurial.eclass
15 --- mercurial.eclass 2 Apr 2010 18:29:39 -0000 1.12
16 +++ mercurial.eclass 23 Aug 2010 21:20:41 -0000
17 @@ -116,12 +116,20 @@ function mercurial_fetch {
18 fi
19
20 # Checkout working copy:
21 - einfo "Creating working directory in ${WORKDIR}/${module} (revision: ${EHG_REVISION})"
22 + einfo "Creating working directory in ${WORKDIR}/${module} (target revision: ${EHG_REVISION})"
23 hg clone \
24 ${EHG_QUIET_CMD_OPT} \
25 --rev="${EHG_REVISION}" \
26 "${EHG_STORE_DIR}/${EHG_PROJECT}/${module}" \
27 "${WORKDIR}/${module}" || die "hg clone failed"
28 + # An exact revision helps a lot for testing purposes, so have some output...
29 + # id num branch
30 + # fd6e32d61721 6276 default
31 + local HG_REVDATA=($(hg identify -n -b -i "${WORKDIR}/${module}"))
32 + local HG_REV_ID=${HG_REVDATA[0]}
33 + local HG_REV_NUM=${HG_REVDATA[1]}
34 + local HG_REV_BRANCH=${HG_REVDATA[2]}
35 + einfo "Work directory: ${WORKDIR}/${module} global id: ${HG_REV_ID} branch: ${HG_REV_BRANCH}"
36 }
37
38 # @FUNCTION: mercurial_src_unpack
39
40 --
41 Robin Hugh Johnson
42 Gentoo Linux: Developer, Trustee & Infrastructure Lead
43 E-Mail : robbat2@g.o
44 GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85

Replies