Gentoo Archives: gentoo-dev

From: Dirkjan Ochtman <djc@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC ECLASS PATCH] Include exact Hg revision data for repeatability from logs.
Date: Tue, 24 Aug 2010 07:18:54
Message-Id: AANLkTi=85Q4m0hKh4odUfgGFWFEHw9A=DgYTBA5cUn8j@mail.gmail.com
In Reply to: [gentoo-dev] [RFC ECLASS PATCH] Include exact Hg revision data for repeatability from logs. by "Robin H. Johnson"
1 On Mon, Aug 23, 2010 at 23:23, Robin H. Johnson <robbat2@g.o> wrote:
2 > Index: mercurial.eclass
3 > ===================================================================
4 > RCS file: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v
5 > retrieving revision 1.12
6 > diff -p -w -b -B -u -r1.12 mercurial.eclass
7 > --- mercurial.eclass    2 Apr 2010 18:29:39 -0000       1.12
8 > +++ mercurial.eclass    23 Aug 2010 21:20:41 -0000
9 > @@ -116,12 +116,20 @@ function mercurial_fetch {
10 >        fi
11 >
12 >        # Checkout working copy:
13 > -       einfo "Creating working directory in ${WORKDIR}/${module} (revision: ${EHG_REVISION})"
14 > +       einfo "Creating working directory in ${WORKDIR}/${module} (target revision: ${EHG_REVISION})"
15 >        hg clone \
16 >                ${EHG_QUIET_CMD_OPT} \
17 >                --rev="${EHG_REVISION}" \
18 >                "${EHG_STORE_DIR}/${EHG_PROJECT}/${module}" \
19 >                "${WORKDIR}/${module}" || die "hg clone failed"
20 > +       # An exact revision helps a lot for testing purposes, so have some output...
21 > +       # id           num  branch
22 > +       # fd6e32d61721 6276 default
23 > +       local HG_REVDATA=($(hg identify -n -b -i "${WORKDIR}/${module}"))
24 > +       local HG_REV_ID=${HG_REVDATA[0]}
25 > +       local HG_REV_NUM=${HG_REVDATA[1]}
26 > +       local HG_REV_BRANCH=${HG_REVDATA[2]}
27 > +       einfo "Work directory: ${WORKDIR}/${module} global id: ${HG_REV_ID} branch: ${HG_REV_BRANCH}"
28 >  }
29
30 I'd leave out the HG_REV_NUM, it doesn't mean much anyway (since it is
31 local to a repository, it can easily change).
32
33 Cheers,
34
35 Dirkjan

Replies