Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 36719:390d16ea7c76
py3: use pycompat.bytestr instead of str
Differential Revision: https://phab.mercurial-scm.org/D2648
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 04 Mar 2018 22:33:59 +0530 |
parents | 2dce0049176c |
children | 45bfcd16f27e |
comparison
equal
deleted
inserted
replaced
36718:59802fa590db | 36719:390d16ea7c76 |
---|---|
360 try: | 360 try: |
361 ui.debug('applying patch\n') | 361 ui.debug('applying patch\n') |
362 ui.debug(fp.getvalue()) | 362 ui.debug(fp.getvalue()) |
363 patch.internalpatch(ui, repo, fp, 1, eolmode=None) | 363 patch.internalpatch(ui, repo, fp, 1, eolmode=None) |
364 except error.PatchError as err: | 364 except error.PatchError as err: |
365 raise error.Abort(str(err)) | 365 raise error.Abort(pycompat.bytestr(err)) |
366 del fp | 366 del fp |
367 | 367 |
368 # 4. We prepared working directory according to filtered | 368 # 4. We prepared working directory according to filtered |
369 # patch. Now is the time to delegate the job to | 369 # patch. Now is the time to delegate the job to |
370 # commit/qrefresh or the like! | 370 # commit/qrefresh or the like! |
1430 try: | 1430 try: |
1431 patch.patch(ui, repo, tmpname, strip=strip, prefix=prefix, | 1431 patch.patch(ui, repo, tmpname, strip=strip, prefix=prefix, |
1432 files=files, eolmode=None, similarity=sim / 100.0) | 1432 files=files, eolmode=None, similarity=sim / 100.0) |
1433 except error.PatchError as e: | 1433 except error.PatchError as e: |
1434 if not partial: | 1434 if not partial: |
1435 raise error.Abort(str(e)) | 1435 raise error.Abort(pycompat.bytestr(e)) |
1436 if partial: | 1436 if partial: |
1437 rejects = True | 1437 rejects = True |
1438 | 1438 |
1439 files = list(files) | 1439 files = list(files) |
1440 if nocommit: | 1440 if nocommit: |
3041 fp.seek(0) | 3041 fp.seek(0) |
3042 if dopatch: | 3042 if dopatch: |
3043 try: | 3043 try: |
3044 patch.internalpatch(repo.ui, repo, fp, 1, eolmode=None) | 3044 patch.internalpatch(repo.ui, repo, fp, 1, eolmode=None) |
3045 except error.PatchError as err: | 3045 except error.PatchError as err: |
3046 raise error.Abort(str(err)) | 3046 raise error.Abort(pycompat.bytestr(err)) |
3047 del fp | 3047 del fp |
3048 else: | 3048 else: |
3049 for f in actions['revert'][0]: | 3049 for f in actions['revert'][0]: |
3050 checkout(f) | 3050 checkout(f) |
3051 if normal: | 3051 if normal: |