Fwd: Enriching a file log by branches, tags and bookmarks

Matt Mackall mpm at selenic.com
Thu Apr 2 19:08:26 UTC 2015


On Thu, 2015-04-02 at 10:33 -0700, Dave S wrote:
> (Dang it, I was expecting usenet to make sure it got to the list for me)
> 
> ---------- Forwarded message ----------
> From: Dave S <snidely.too at gmail.com>
> Date: Thu, Apr 2, 2015 at 10:32 AM
> Subject: Re: Enriching a file log by branches, tags and bookmarks
> To: Marc Strapetz <marc.strapetz at syntevo.com>
> 
> 
> On Thu, Apr 2, 2015 at 7:54 AM, Marc Strapetz <marc.strapetz at syntevo.com>
> wrote:
> 
> > Dave, sorry, I completely missed your reply.
> >
> >  Are you trying to track the history of individual files, rather than the
> >> default of repository history?
> >>
> >
> > Yes, I do.
> >
> > > hg log -f --template "{rev} {tags} {branch} {files}\n"
> > > controllers/default.py
> >
> > Unfortunately this does not give me the desired information. I've tried
> > with setup.py from Mercurial's own repository. Here are the first lines of
> > output, which do not show up any tags at all:
> >
> > 17926  default setup.py
> > 17732  default .hgignore mercurial/exewrapper.c setup.py
> > 17709  default setup.py
> > 17606  default mercurial/parsers.c mercurial/pathencode.c setup.py
> > 17246  stable setup.py
> > 17121  default setup.py
> >
> > And here is what I'm looking for:
> >
> > http://i.imgur.com/AYt885I.png
> >
> > Any more ideas?
> 
> 
> Sorry, no, because it works for me.
> 
> 57  default controllers/default.py
> 55  default controllers/default.py views/default/logzap.html
> 40 SVN4097 default controllers/default.py
> 39  default controllers/default.py
> 
> 
> Note rev 40.
> 
> If you're using bookmarks instead of tags, there's another keyword you use
> in the template, but I dosn't have any examples for you.

You got lucky. Original poster is apparently looking for "tags on this
revision OR any descendants of this revision that aren't otherwise
listed".

So if the file log shows revisions 1 and 10, but there's a 1.0 tag at 5,
we want to show the tag on 1 to say "this was in 1.0". Right now {tags}
will only tell you about tags on the current changeset and doesn't know
which set of changesets are going to be displayed.

So we don't in fact have a good way to do what's wanted here in a
template at present.

However, I do find this useful:

[alias]
tagged = log -r 'first($1:: and tagged())'

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list