RFC new template keywords (wcmodified,wcmodifieddate) + sample impl.

Matt Mackall mpm at selenic.com
Tue May 31 10:00:26 CDT 2011


On Tue, 2011-05-31 at 16:24 +1000, Peter Bray wrote:
> >>     The following shell shows my first attempt (g prefix =>  GNU version):
> >>     hg status -0 -n -q -am \
> >>      | ( cd `hg root`; gxargs -0 --no-run-if-empty gstat --format '%y' ) \
> >>      | sort -n \
> >>      | tail -1 \
> >>      | perl -p -e 's/:\d\d\.\d+//' # Remove excess precision (cf isodate)
> >
> > I guess that's slightly more meaningful than +, but I don't see why it's
> > better than simply using 'time of build'?
> 
> I suppose I have always developed build systems where the re-running of
> make does not rebuild anything if nothing has changed (the "make;
> make" comment above). So the inclusion of a raw timestamp would force
> a rebuild, so no build is reproducible.

[breaking this novel into short stories]

Not necessarily. I've worked with plenty of build systems which include
a time of build but don't rebuild themselves with back-to-back makes.
If you're building C, for instance, it's as simple as inserting a -D in
compile flags that includes the date. Or you can simply write the date
into a file that's an intentionally undeclared dependency.

Anyway, my point is that one date is as good as another here. And your
most recently modified file approach, while appealing, is significantly
more complicated while not being significantly more meaningful.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list