Details
Details
- Reviewers
durin42 yuja - Group Reviewers
hg-reviewers - Commits
- rHG2f7a3c90c0d7: py3: use pycompat.bytestr() to convert error messages to bytes
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
| durin42 | |
| yuja |
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| Path | Packages | |||
|---|---|---|---|---|
| M | hgext/gpg.py (2 lines) | |||
| M | hgext/journal.py (2 lines) | |||
| M | hgext/largefiles/overrides.py (4 lines) |
| % hgnode.short(n) | % hgnode.short(n) | ||||
| for n in nodes]) | for n in nodes]) | ||||
| try: | try: | ||||
| editor = cmdutil.getcommiteditor(editform='gpg.sign', | editor = cmdutil.getcommiteditor(editform='gpg.sign', | ||||
| **pycompat.strkwargs(opts)) | **pycompat.strkwargs(opts)) | ||||
| repo.commit(message, opts['user'], opts['date'], match=msigs, | repo.commit(message, opts['user'], opts['date'], match=msigs, | ||||
| editor=editor) | editor=editor) | ||||
| except ValueError as inst: | except ValueError as inst: | ||||
| raise error.Abort(str(inst)) | raise error.Abort(pycompat.bytestr(inst)) | ||||
| def node2txt(repo, node, ver): | def node2txt(repo, node, ver): | ||||
| """map a manifest into some text""" | """map a manifest into some text""" | ||||
| if ver == "0": | if ver == "0": | ||||
| return "%s\n" % hgnode.hex(node) | return "%s\n" % hgnode.hex(node) | ||||
| else: | else: | ||||
| raise error.Abort(_("unknown signature version")) | raise error.Abort(_("unknown signature version")) | ||||
| if opts.get("commits"): | if opts.get("commits"): | ||||
| displayer = logcmdutil.changesetdisplayer(ui, repo, opts) | displayer = logcmdutil.changesetdisplayer(ui, repo, opts) | ||||
| for hash in entry.newhashes: | for hash in entry.newhashes: | ||||
| try: | try: | ||||
| ctx = repo[hash] | ctx = repo[hash] | ||||
| displayer.show(ctx) | displayer.show(ctx) | ||||
| except error.RepoLookupError as e: | except error.RepoLookupError as e: | ||||
| fm.write('repolookuperror', "%s\n\n", str(e)) | fm.write('repolookuperror', "%s\n\n", pycompat.bytestr(e)) | ||||
| displayer.close() | displayer.close() | ||||
| fm.end() | fm.end() | ||||
| if entry is None: | if entry is None: | ||||
| ui.status(_("no recorded locations\n")) | ui.status(_("no recorded locations\n")) | ||||
| # only match normal files and run it, then replace it to just | # only match normal files and run it, then replace it to just | ||||
| # match largefiles and run it again. | # match largefiles and run it again. | ||||
| nonormalfiles = False | nonormalfiles = False | ||||
| nolfiles = False | nolfiles = False | ||||
| installnormalfilesmatchfn(repo[None].manifest()) | installnormalfilesmatchfn(repo[None].manifest()) | ||||
| try: | try: | ||||
| result = orig(ui, repo, pats, opts, rename) | result = orig(ui, repo, pats, opts, rename) | ||||
| except error.Abort as e: | except error.Abort as e: | ||||
| if str(e) != _('no files to copy'): | if pycompat.bytestr(e) != _('no files to copy'): | ||||
| raise e | raise e | ||||
| else: | else: | ||||
| nonormalfiles = True | nonormalfiles = True | ||||
| result = 0 | result = 0 | ||||
| finally: | finally: | ||||
| restorematchfn() | restorematchfn() | ||||
| # The first rename can cause our current working directory to be removed. | # The first rename can cause our current working directory to be removed. | ||||
| lfdirstate.remove(srclfile) | lfdirstate.remove(srclfile) | ||||
| else: | else: | ||||
| util.copyfile(repo.wjoin(srclfile), | util.copyfile(repo.wjoin(srclfile), | ||||
| repo.wjoin(destlfile)) | repo.wjoin(destlfile)) | ||||
| lfdirstate.add(destlfile) | lfdirstate.add(destlfile) | ||||
| lfdirstate.write() | lfdirstate.write() | ||||
| except error.Abort as e: | except error.Abort as e: | ||||
| if str(e) != _('no files to copy'): | if pycompat.bytestr(e) != _('no files to copy'): | ||||
| raise e | raise e | ||||
| else: | else: | ||||
| nolfiles = True | nolfiles = True | ||||
| finally: | finally: | ||||
| restorematchfn() | restorematchfn() | ||||
| wlock.release() | wlock.release() | ||||
| if nolfiles and nonormalfiles: | if nolfiles and nonormalfiles: | ||||