Mercurial > hg
diff mercurial/wireproto.py @ 26587:56b2bcea2529
error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.
For great justice.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 08 Oct 2015 12:55:45 -0700 |
parents | fb743268510e |
children | 3e7f675628ad |
line wrap: on
line diff
--- a/mercurial/wireproto.py Mon Oct 05 22:49:24 2015 -0700 +++ b/mercurial/wireproto.py Thu Oct 08 12:55:45 2015 -0700 @@ -690,7 +690,7 @@ try: r = repo.pushkey(encoding.tolocal(namespace), encoding.tolocal(key), encoding.tolocal(old), new) or False - except util.Abort: + except error.Abort: r = False output = proto.restore() @@ -752,12 +752,12 @@ fp.close() os.unlink(tempname) - except (error.BundleValueError, util.Abort, error.PushRaced) as exc: + except (error.BundleValueError, error.Abort, error.PushRaced) as exc: # handle non-bundle2 case first if not getattr(exc, 'duringunbundle2', False): try: raise - except util.Abort: + except error.Abort: # The old code we moved used sys.stderr directly. # We did not change it to minimise code change. # This need to be moved to something proper. @@ -798,7 +798,7 @@ errpart.addparam('parttype', exc.parttype) if exc.params: errpart.addparam('params', '\0'.join(exc.params)) - except util.Abort as exc: + except error.Abort as exc: manargs = [('message', str(exc))] advargs = [] if exc.hint is not None: