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

Matt Mackall mpm at selenic.com
Mon Feb 26 21:27:44 UTC 2007


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
> --- a/contrib/convert-repo	Mon Feb 26 21:57:33 2007 +0100
> +++ 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.

> @@ -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().

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list