changeset 7382:f5f6b7dcd217

Merge with crew-stable
author Patrick Mezard <pmezard@gmail.com>
date Sat, 15 Nov 2008 15:57:12 +0100
parents 59f8f6f30630 (current diff) b965605dfb2e (diff)
children b501c7f3c2ad
files hgext/convert/subversion.py
diffstat 1 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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: