Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 34258:61714510220d
error: move patch.PatchError so it can easily implement __bytes__ (API)
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 03 Sep 2017 16:45:33 +0900 |
parents | e9898ad31115 |
children | 1d6558f5ea74 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Fri Sep 15 00:01:57 2017 -0700 +++ b/mercurial/cmdutil.py Sun Sep 03 16:45:33 2017 +0900 @@ -278,7 +278,7 @@ # 1. filter patch, since we are intending to apply subset of it try: chunks, newopts = filterfn(ui, originalchunks) - except patch.PatchError as err: + except error.PatchError as err: raise error.Abort(_('error parsing patch: %s') % err) opts.update(newopts) @@ -360,7 +360,7 @@ ui.debug('applying patch\n') ui.debug(fp.getvalue()) patch.internalpatch(ui, repo, fp, 1, eolmode=None) - except patch.PatchError as err: + except error.PatchError as err: raise error.Abort(str(err)) del fp @@ -1334,7 +1334,7 @@ try: patch.patch(ui, repo, tmpname, strip=strip, prefix=prefix, files=files, eolmode=None, similarity=sim / 100.0) - except patch.PatchError as e: + except error.PatchError as e: if not partial: raise error.Abort(str(e)) if partial: @@ -1380,7 +1380,7 @@ try: patch.patchrepo(ui, repo, p1, store, tmpname, strip, prefix, files, eolmode=None) - except patch.PatchError as e: + except error.PatchError as e: raise error.Abort(str(e)) if opts.get('exact'): editor = None @@ -3729,7 +3729,7 @@ if reversehunks: chunks = patch.reversehunks(chunks) - except patch.PatchError as err: + except error.PatchError as err: raise error.Abort(_('error parsing patch: %s') % err) newlyaddedandmodifiedfiles = newandmodified(chunks, originalchunks) @@ -3751,7 +3751,7 @@ if dopatch: try: patch.internalpatch(repo.ui, repo, fp, 1, eolmode=None) - except patch.PatchError as err: + except error.PatchError as err: raise error.Abort(str(err)) del fp else: