They were added using byteify-strings.py.
- skip-blame because just b'' prefixes
| hg-reviewers |
They were added using byteify-strings.py.
| Automatic diff as part of commit; lint not applicable. |
| Automatic diff as part of commit; unit tests not applicable. |
| Property | Old Value | New Value |
|---|---|---|
| File Mode | 100755 | 100644 |
| fancyopts, | fancyopts, | ||||
| simplemerge, | simplemerge, | ||||
| ui as uimod, | ui as uimod, | ||||
| ) | ) | ||||
| from mercurial.utils import ( | from mercurial.utils import ( | ||||
| procutil, | procutil, | ||||
| ) | ) | ||||
| options = [('L', 'label', [], _('labels to use on conflict markers')), | options = [(b'L', b'label', [], _(b'labels to use on conflict markers')), | ||||
| ('a', 'text', None, _('treat all files as text')), | (b'a', b'text', None, _(b'treat all files as text')), | ||||
| ('p', 'print', None, | (b'p', b'print', None, | ||||
| _('print results instead of overwriting LOCAL')), | _(b'print results instead of overwriting LOCAL')), | ||||
| ('', 'no-minimal', None, _('no effect (DEPRECATED)')), | (b'', b'no-minimal', None, _(b'no effect (DEPRECATED)')), | ||||
| ('h', 'help', None, _('display help and exit')), | (b'h', b'help', None, _(b'display help and exit')), | ||||
| ('q', 'quiet', None, _('suppress output'))] | (b'q', b'quiet', None, _(b'suppress output'))] | ||||
| usage = _('''simplemerge [OPTS] LOCAL BASE OTHER | usage = _('''simplemerge [OPTS] LOCAL BASE OTHER | ||||
| Simple three-way file merge utility with a minimal feature set. | Simple three-way file merge utility with a minimal feature set. | ||||
| Apply to LOCAL the changes necessary to go from BASE to OTHER. | Apply to LOCAL the changes necessary to go from BASE to OTHER. | ||||
| By default, LOCAL is overwritten with the results of this operation. | By default, LOCAL is overwritten with the results of this operation. | ||||
| ''') | ''') | ||||
| class ParseError(Exception): | class ParseError(Exception): | ||||
| """Exception raised on errors in parsing the command line.""" | """Exception raised on errors in parsing the command line.""" | ||||
| def showhelp(): | def showhelp(): | ||||
| sys.stdout.write(usage) | sys.stdout.write(usage) | ||||
| sys.stdout.write('\noptions:\n') | sys.stdout.write(b'\noptions:\n') | ||||
| out_opts = [] | out_opts = [] | ||||
| for shortopt, longopt, default, desc in options: | for shortopt, longopt, default, desc in options: | ||||
| out_opts.append(('%2s%s' % (shortopt and '-%s' % shortopt, | out_opts.append((b'%2s%s' % (shortopt and b'-%s' % shortopt, | ||||
| longopt and ' --%s' % longopt), | longopt and b' --%s' % longopt), | ||||
| '%s' % desc)) | b'%s' % desc)) | ||||
| opts_len = max([len(opt[0]) for opt in out_opts]) | opts_len = max([len(opt[0]) for opt in out_opts]) | ||||
| for first, second in out_opts: | for first, second in out_opts: | ||||
| sys.stdout.write(' %-*s %s\n' % (opts_len, first, second)) | sys.stdout.write(b' %-*s %s\n' % (opts_len, first, second)) | ||||
| try: | try: | ||||
| for fp in (sys.stdin, sys.stdout, sys.stderr): | for fp in (sys.stdin, sys.stdout, sys.stderr): | ||||
| procutil.setbinary(fp) | procutil.setbinary(fp) | ||||
| opts = {} | opts = {} | ||||
| try: | try: | ||||
| args = fancyopts.fancyopts(sys.argv[1:], options, opts) | args = fancyopts.fancyopts(sys.argv[1:], options, opts) | ||||
| except getopt.GetoptError as e: | except getopt.GetoptError as e: | ||||
| raise ParseError(e) | raise ParseError(e) | ||||
| if opts['help']: | if opts[b'help']: | ||||
| showhelp() | showhelp() | ||||
| sys.exit(0) | sys.exit(0) | ||||
| if len(args) != 3: | if len(args) != 3: | ||||
| raise ParseError(_('wrong number of arguments')) | raise ParseError(_(b'wrong number of arguments')) | ||||
| local, base, other = args | local, base, other = args | ||||
| sys.exit(simplemerge.simplemerge(uimod.ui.load(), | sys.exit(simplemerge.simplemerge(uimod.ui.load(), | ||||
| context.arbitraryfilectx(local), | context.arbitraryfilectx(local), | ||||
| context.arbitraryfilectx(base), | context.arbitraryfilectx(base), | ||||
| context.arbitraryfilectx(other), | context.arbitraryfilectx(other), | ||||
| **opts)) | **opts)) | ||||
| except ParseError as e: | except ParseError as e: | ||||
| sys.stdout.write("%s: %s\n" % (sys.argv[0], e)) | sys.stdout.write(b"%s: %s\n" % (sys.argv[0], e)) | ||||
| showhelp() | showhelp() | ||||
| sys.exit(1) | sys.exit(1) | ||||
| except error.Abort as e: | except error.Abort as e: | ||||
| sys.stderr.write("abort: %s\n" % e) | sys.stderr.write(b"abort: %s\n" % e) | ||||
| sys.exit(255) | sys.exit(255) | ||||
| except KeyboardInterrupt: | except KeyboardInterrupt: | ||||
| sys.exit(255) | sys.exit(255) | ||||