[PATCH 1 of 2] convert: don't ignore errors from git diff-tree

Julien Cristau jcristau at debian.org
Wed Apr 6 17:14:59 EDT 2016


On Wed, Apr  6, 2016 at 16:37:34 -0400, timeless wrote:

> can you provide a test for this?
> 
I noticed this by inspection (most other calls to git in
https://selenic.com/hg/rev/cdda7b96afff are error checked).  I'm not
sure I can easily figure out what kind of broken repo would cause this
error.

Cheers,
Julien

> On Wed, Apr 6, 2016 at 4:25 PM, Julien Cristau <jcristau at debian.org> wrote:
> > # HG changeset patch
> > # User Julien Cristau <julien.cristau at logilab.fr>
> > # Date 1459777128 -7200
> > #      Mon Apr 04 15:38:48 2016 +0200
> > # Node ID 14688347f01754b9d1c5bd31e59b4966e3335986
> > # Parent  ea86cdcd9b50bf38c6b9dd7bbaa04b9c8cc0aefb
> > convert: don't ignore errors from git diff-tree
> >
> > diff --git a/hgext/convert/git.py b/hgext/convert/git.py
> > --- a/hgext/convert/git.py
> > +++ b/hgext/convert/git.py
> > @@ -357,6 +357,8 @@ class convert_git(common.converter_sourc
> >              output, status = self.gitrunlines('diff-tree', '--name-only',
> >                                                '--root', '-r', version,
> >                                                '%s^%s' % (version, i + 1), '--')
> > +            if status:
> > +                raise error.Abort(_('cannot read changes in %s') % version)
> >              changes = [f.rstrip('\n') for f in output]
> >
> >          return changes


More information about the Mercurial-devel mailing list