[PATCH 3 of 3] crecord: exit edition of hunk with non-zero status does not interrupt session

Augie Fackler raf at durin42.com
Wed Jun 10 09:37:53 CDT 2015


On Mon, Jun 08, 2015 at 10:50:58AM -0400, Augie Fackler wrote:
> On Fri, Jun 05, 2015 at 02:03:33PM -0700, Laurent Charignon wrote:
> > # HG changeset patch
> > # User Laurent Charignon <lcharignon at fb.com>
> > # Date 1433536874 25200
> > #      Fri Jun 05 13:41:14 2015 -0700
> > # Node ID 55d45b5b1cb25d431f4771cd42e456b76c904b36
> > # Parent  82711472302682face294f925835780ab9f710a8
> > crecord: exit edition of hunk with non-zero status does not interrupt session
> >
> > Before this patch, when editing a hunk, if the editor was exiting with a non-
> > zero status the crecord session would be aborted. This patch makes crecord
> > handle the failure and goes back to the state before the failed edition.
> > We use the new error reporting mechanism introduced in the previous patch to
> > notify the user of the issue.
> >
> > diff --git a/mercurial/crecord.py b/mercurial/crecord.py
> > --- a/mercurial/crecord.py
> > +++ b/mercurial/crecord.py
> > @@ -1468,9 +1468,11 @@
> >                  f.close()
> >                  # start the editor and wait for it to complete
> >                  editor = self.ui.geteditor()
> > -                self.ui.system("%s \"%s\"" % (editor, patchfn),
> > -                          environ={'hguser': self.ui.username()},
> > -                          onerr=util.Abort, errprefix=_("edit failed"))
> > +                ret = self.ui.system("%s \"%s\"" % (editor, patchfn),
> > +                          environ={'hguser': self.ui.username()})
> > +                if ret != 0:
> > +                    self.errorstr = "Editor exited with status %d" % ret
>
> This looks suspiciously like something that should get localized?

Friendly ping on this series - I liked where it was going, and once we
work out my confusion on patches 2 and 3 it'll be ready to
land. Thanks!


More information about the Mercurial-devel mailing list