> >> $ hg tag -r [revision] [name]
> >>
> >> e.g. the Vim 7.3.000 candidate(s?) named above
> >> $ hg tag -r ee53a39d5896 v7-3-000
> >> $ hg tag -r 2a2ad267db08 v7-3-000
> >
> > I'm not going to type these commands, they need to be part of a
> > script. So how do we get that revision number for a patch version, or
> > the other way around: how do we get the version number from each
> > revision number? We actually need both, one for tagging existing
> > versions and one to tag each version when I commit a patch.
> >
> > I already have a script that does "hg commit" with the description
> > taken from the patch. I would need to add something to that script to
> > tag the version. I suppose that can only be done after the commit?
> > Or can "hg commit" add a tag at the same time? The help doesn't
> > mention it.
>
> I don't think you can do it in a single command, but tagging the
> just-committed patch is easy. The [-r revision] argument is optional,
> defaulting to tip (or you can specify [-r tip] explicitly). So:
>
> $ [whatever commands to commit the patch]
> $ tagname=v${major}-${minor}-${patch}
> $ hg tag $tagname
>
> That autocommits the tag. If that's undesirable for some reason
> (aesthetics), the .hgtags file is of the format:
> [commit sha-1] <space> [tag name] <nl>
>
> So:
> $ hg log -r tip --template "{node} $tagname\n" >> .hgtags
>
>
> For the scripted portion of going back and adding all of the missing
> tags (formatted for less unreadability -- ran it as a one-liner):
>
> $ hg log --template '{node} {desc|firstline}\n' | \
> : perl -lnwe 'next unless my ($rev, $major, $minor, $patch) = /^(\S+) updated for version (7)\.([23])\.(\d\d\d)$/;
> : my $tag = "v${major}-${minor}-${patch}";
> : next if $seen{$tag};
> : $seen{$tag}++;
> : next if $minor == 2 and $patch <= 325;
> : print "$rev $tag"' >> .hgtags
> $ hg ci -m 'added missing tags'
>
> I'll send it as an hg email in response to this message.
Thanks. I'll try it out when I'm back home.
--
ARTHUR: Listen, old crone! Unless you tell us where we can buy a shrubbery,
my friend and I will ... we will say "Ni!"
CRONE: Do your worst!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment