[PATCH] convert: Compute svn tags from the last revision in all branches, not only trunk

Remi Gacogne rgacogne-hg at valombre.net
Sat Mar 29 06:36:26 CDT 2008


# HG changeset patch
# User Remi Gacogne <rgacogne-hg at valombre.net>
# Date 1206789358 -3600
# Node ID da66b08083f952b4e24ea477b14a35b2da82201f
# Parent  1e4ddc9ac9f7abbaeaefc79995fc6abc8e43236f
convert: compute svn tags from the last revision in all branches, not only 
trunk

diff -r 1e4ddc9ac9f7 -r da66b08083f9 hgext/convert/convcmd.py
--- a/hgext/convert/convcmd.py  Mon Mar 24 18:05:30 2008 -0500
+++ b/hgext/convert/convcmd.py  Sat Mar 29 12:15:58 2008 +0100
@@ -15,6 +15,7 @@
 from gnuarch import gnuarch_source
 import filemap
 
+import copy
 import os, shutil
 from mercurial import hg, util
 from mercurial.i18n import _
@@ -91,7 +92,7 @@
     def walktree(self, heads):
         '''Return a mapping that identifies the uncommitted parents of every
         uncommitted changeset.'''
-        visit = heads
+        visit = copy.deepcopy(heads)
         known = {}
         parents = {}
         while visit:
diff -r 1e4ddc9ac9f7 -r da66b08083f9 hgext/convert/subversion.py
--- a/hgext/convert/subversion.py       Mon Mar 24 18:05:30 2008 -0500
+++ b/hgext/convert/subversion.py       Sat Mar 29 12:15:58 2008 +0100
@@ -365,9 +365,12 @@
         if self.tags is None:
             return tags
 
-        start = self.revnum(self.head)
+        stop = self.revnum(self.head)
+        for branch in self.heads:
+            stop = max(stop, self.revnum(branch))
+
         try:
-            for entry in get_log(self.url, [self.tags], self.startrev, 
start):
+            for entry in get_log(self.url, [self.tags], self.startrev, stop):
                 orig_paths, revnum, author, date, message = entry
                 for path in orig_paths:
                     if not path.startswith(self.tags+'/'):



More information about the Mercurial-devel mailing list