Merge with crew-stable
authorPatrick Mezard <pmezard@gmail.com>
Sat, 15 Nov 2008 15:57:12 +0100
changeset 7382 f5f6b7dcd217
parent 7380 59f8f6f30630 (current diff)
parent 7381 b965605dfb2e (diff)
child 7383 b501c7f3c2ad
Merge with crew-stable
hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	Sat Nov 15 15:09:11 2008 +0100
+++ b/hgext/convert/subversion.py	Sat Nov 15 15:57:12 2008 +0100
@@ -46,6 +46,9 @@
 except ImportError:
     pass
 
+class SvnPathNotFound(Exception):
+    pass
+
 def geturl(path):
     try:
         return svn.client.url_from_path(svn.core.svn_path_canonicalize(path))
@@ -414,9 +417,15 @@
                         remainings.append([source, sourcerev, tagname])
                         continue
                     # From revision may be fake, get one with changes
-                    tagid = self.latest(source, sourcerev)
-                    if tagid:
-                        tags[tagname] = tagid
+                    try:
+                        tagid = self.latest(source, sourcerev)
+                        if tagid:
+                            tags[tagname] = tagid
+                    except SvnPathNotFound:
+                        # It happens when we are following directories we assumed
+                        # were copied with their parents but were really created
+                        # in the tag directory.
+                        pass
                 pendings = remainings
                 tagspath = srctagspath
 
@@ -474,7 +483,7 @@
         except SubversionException:
             dirent = None
         if not dirent:
-            raise util.Abort(_('%s not found up to revision %d') % (path, stop))
+            raise SvnPathNotFound(_('%s not found up to revision %d') % (path, stop))
 
         # stat() gives us the previous revision on this line of development, but
         # it might be in *another module*. Fetch the log and detect renames down
@@ -834,7 +843,7 @@
                         latest = self.latest(self.module, firstrevnum - 1)
                         if latest:
                             firstcset.parents.append(latest)
-                except util.Abort:
+                except SvnPathNotFound:
                     pass
         except SubversionException, (inst, num):
             if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION: