[PATCH] [convert] With -d svn, recover gracefully from empty cset

Jesse Glick typrase at gmail.com
Sun Dec 6 13:09:33 CST 2009


# HG changeset patch
# User Jesse Glick <jesse.glick at sun.com>
# Date 1260126321 18000
# Node ID be5d0e3f7aea30183505a3f97e15c3f7e948b647
# Parent  e600ad9bc257a9e92ce3b914757e8a6034f0f765
[convert] With -d svn, recover gracefully from empty cset.
Otherwise when processing a changeset that in fact changes no files
(perhaps due to bug in import from CVS) can get something like:
> unexpected svn output:
> abort: unable to cope with svn output

diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -1138,6 +1138,8 @@
             try:
                 rev = self.commit_re.search(output).group(1)
             except AttributeError:
+                if not files:
+                    return "nothing at 0";
                 self.ui.warn(_('unexpected svn output:\n'))
                 self.ui.warn(output)
                 raise util.Abort(_('unable to cope with svn output'))


More information about the Mercurial-devel mailing list