[PATCH] Make convert-repo put tags on the branches where they apply

Brendan Cully brendan at kublai.com
Mon Feb 26 21:44:07 UTC 2007


On Monday, 26 February 2007 at 15:27, Matt Mackall wrote:
> On Mon, Feb 26, 2007 at 01:08:16PM -0800, Brendan Cully wrote:
> > # HG changeset patch
> > # User Brendan Cully <brendan at kublai.com>
> > # Date 1172523968 28800
> > # Node ID ad1458bedd2f2866121af09d3c0c2be69d8113a0
> > # Parent  eb0967c6e77b66a1096584c882725cb779caf90f
> > Make convert-repo put tags on the branches where they apply
> > 
> > diff -r eb0967c6e77b -r ad1458bedd2f contrib/convert-repo
> > +++ b/contrib/convert-repo	Mon Feb 26 13:06:08 2007 -0800
> > @@ -25,6 +25,7 @@
> >  
> >  import sys, os, zlib, sha, time, re, locale, socket
> >  os.environ["HGENCODING"] = "utf-8"
> > +sys.path.insert(0, '/home/brendan/dev/hg/crew')
> 
> This hunk needs a comment.

whoops.

> > @@ -432,10 +432,11 @@ class convert_mercurial:
> >  
> >          return p2
> >  
> > -    def puttags(self, tags):
> > -        try:
> > -            old = self.repo.wfile(".hgtags").read()
> > -            oldlines = old.splitlines(1)
> > +    def puttags(self, tags, rev, branch):
> > +        rev = hg.bin(rev)
> > +        try:
> > +            old = self.repo.filectx(".hgtags", rev)
> > +            oldlines = old.data().splitlines(1)
> >              oldlines.sort()
> 
> I think we should instead use repo.tags().

Won't that drag in all the tags from all the branches? I'd rather only
have the ones that belong on the branch. Otherwise, among other
things, if I clone -r <head> . ../foo; hg -R ../foo tags will probably
complain about a bunch of missing nodes.



More information about the Mercurial-devel mailing list