convert: handle invalid subversion source paths
authorMads Kiilerich <mads@kiilerich.com>
Sun, 01 May 2011 17:35:05 +0200
changeset 14152 00121103546a
parent 14151 1fe82c93b8e2
child 14153 f8047a059ca0
convert: handle invalid subversion source paths
hgext/convert/subversion.py
tests/test-convert-svn-source.t
--- a/hgext/convert/subversion.py	Sun May 01 17:34:16 2011 +0200
+++ b/hgext/convert/subversion.py	Sun May 01 17:35:05 2011 +0200
@@ -278,7 +278,10 @@
             raise util.Abort(_('svn: start revision %s is not an integer')
                              % self.startrev)
 
-        self.head = self.latest(self.module, latest)
+        try:
+            self.head = self.latest(self.module, latest)
+        except SvnPathNotFound:
+            self.head = None
         if not self.head:
             raise util.Abort(_('no revision found in module %s')
                              % self.module)
--- a/tests/test-convert-svn-source.t	Sun May 01 17:34:16 2011 +0200
+++ b/tests/test-convert-svn-source.t	Sun May 01 17:35:05 2011 +0200
@@ -107,6 +107,11 @@
   Committed revision 8.
   $ cd ..
 
+  $ hg convert -s svn "$svnurl/non-existent-path" dest
+  initializing destination dest repository
+  abort: no revision found in module /proj B/non-existent-path
+  [255]
+
 ########################################
 
 Test incremental conversion