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

Jesse Glick typrase at gmail.com
Mon Dec 7 11:44:58 CST 2009


# HG changeset patch
# User Jesse Glick <jesse.glick at sun.com>
# Date 1260207855 18000
# Branch stable
# Node ID a589087ef528cd4bb25e6371257e46d25f9fae30
# Parent  4ddfad7ebd98525e577074e1ee456adf39192336
[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