convert/subversion: rehandle the no-tags case
authorBryan O'Sullivan <bos@serpentine.com>
Thu, 19 Jul 2007 15:33:21 -0700
changeset 4949 2f0f9528e77b
parent 4948 c8d1aa1822d5
child 4954 90be978c9d3d
convert/subversion: rehandle the no-tags case
hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	Thu Jul 19 15:29:33 2007 -0700
+++ b/hgext/convert/subversion.py	Thu Jul 19 15:33:21 2007 -0700
@@ -206,6 +206,7 @@
                                strict_node_history,
                                receiver)
             except SubversionException, (_, num):
+                self.ui.print_exc()
                 pickle.dump(num, fp, protocol)
             else:
                 pickle.dump(None, fp, protocol)
@@ -238,16 +239,20 @@
 
     def gettags(self):
         tags = {}
-        for entry in self.get_log(['/tags'], 0, self.revnum(self.head)):
-            orig_paths, revnum, author, date, message = entry
-            for path in orig_paths:
-                if not path.startswith('/tags/'):
-                    continue
-                ent = orig_paths[path]
-                source = ent.copyfrom_path
-                rev = ent.copyfrom_rev
-                tag = path.split('/', 2)[2]
-                tags[tag] = self.revid(rev, module=source)
+        start = self.revnum(self.head)
+        try:
+            for entry in self.get_log(['/tags'], 0, start):
+                orig_paths, revnum, author, date, message = entry
+                for path in orig_paths:
+                    if not path.startswith('/tags/'):
+                        continue
+                    ent = orig_paths[path]
+                    source = ent.copyfrom_path
+                    rev = ent.copyfrom_rev
+                    tag = path.split('/', 2)[2]
+                    tags[tag] = self.revid(rev, module=source)
+        except SubversionException, (_, num):
+            self.ui.note('no tags found at revision %d\n' % start)
         return tags
 
     # -- helper functions --