##// END OF EJS Templates
cleanup: mark some ui.(status|note|warn|write) calls as not needing i18n...
Augie Fackler -
r43350:86e4daa2 default
parent child Browse files
Show More
@@ -56,7 +56,7 b' def debugshell(ui, repo, **opts):'
56 with demandimport.deactivated():
56 with demandimport.deactivated():
57 __import__(pdbmap[debugger])
57 __import__(pdbmap[debugger])
58 except ImportError:
58 except ImportError:
59 ui.warn(
59 ui.warnnoi18n(
60 b"%s debugger specified but %s module was not found\n"
60 b"%s debugger specified but %s module was not found\n"
61 % (debugger, pdbmap[debugger])
61 % (debugger, pdbmap[debugger])
62 )
62 )
@@ -1307,7 +1307,7 b' def perfphasesremote(ui, repo, dest=None'
1307 hint=b"see 'hg help config.paths'",
1307 hint=b"see 'hg help config.paths'",
1308 )
1308 )
1309 dest = path.pushloc or path.loc
1309 dest = path.pushloc or path.loc
1310 ui.status(b'analysing phase of %s\n' % util.hidepassword(dest))
1310 ui.statusnoi18n(b'analysing phase of %s\n' % util.hidepassword(dest))
1311 other = hg.peer(repo, opts, dest)
1311 other = hg.peer(repo, opts, dest)
1312
1312
1313 # easier to perform discovery through the operation
1313 # easier to perform discovery through the operation
@@ -1323,9 +1323,9 b' def perfphasesremote(ui, repo, dest=None'
1323 del other
1323 del other
1324 publishing = remotephases.get(b'publishing', False)
1324 publishing = remotephases.get(b'publishing', False)
1325 if publishing:
1325 if publishing:
1326 ui.status(b'publishing: yes\n')
1326 ui.statusnoi18n(b'publishing: yes\n')
1327 else:
1327 else:
1328 ui.status(b'publishing: no\n')
1328 ui.statusnoi18n(b'publishing: no\n')
1329
1329
1330 nodemap = repo.changelog.nodemap
1330 nodemap = repo.changelog.nodemap
1331 nonpublishroots = 0
1331 nonpublishroots = 0
@@ -1335,8 +1335,8 b' def perfphasesremote(ui, repo, dest=None'
1335 node = bin(nhex)
1335 node = bin(nhex)
1336 if node in nodemap and int(phase):
1336 if node in nodemap and int(phase):
1337 nonpublishroots += 1
1337 nonpublishroots += 1
1338 ui.status(b'number of roots: %d\n' % len(remotephases))
1338 ui.statusnoi18n(b'number of roots: %d\n' % len(remotephases))
1339 ui.status(b'number of known non public roots: %d\n' % nonpublishroots)
1339 ui.statusnoi18n(b'number of known non public roots: %d\n' % nonpublishroots)
1340
1340
1341 def d():
1341 def d():
1342 phases.remotephasessummary(repo, remotesubset, remotephases)
1342 phases.remotephasessummary(repo, remotesubset, remotephases)
@@ -3694,7 +3694,7 b' def perfwrite(ui, repo, **opts):'
3694
3694
3695 def write():
3695 def write():
3696 for i in range(100000):
3696 for i in range(100000):
3697 ui.write(b'Testing write performance\n')
3697 ui.writenoi18n(b'Testing write performance\n')
3698
3698
3699 timer(write)
3699 timer(write)
3700 fm.end()
3700 fm.end()
@@ -47,7 +47,7 b' def showavailables(ui, initlevel):'
47
47
48
48
49 def checkseclevel(ui, doc, name, initlevel):
49 def checkseclevel(ui, doc, name, initlevel):
50 ui.note('checking "%s"\n' % name)
50 ui.notenoi18n('checking "%s"\n' % name)
51 if not isinstance(doc, bytes):
51 if not isinstance(doc, bytes):
52 doc = doc.encode('utf-8')
52 doc = doc.encode('utf-8')
53 blocks, pruned = minirst.parse(doc, 0, ['verbose'])
53 blocks, pruned = minirst.parse(doc, 0, ['verbose'])
@@ -70,11 +70,11 b' def checkseclevel(ui, doc, name, initlev'
70 continue
70 continue
71 nextlevel = mark2level[mark]
71 nextlevel = mark2level[mark]
72 if curlevel < nextlevel and curlevel + 1 != nextlevel:
72 if curlevel < nextlevel and curlevel + 1 != nextlevel:
73 ui.warn('gap of section level at "%s" of %s\n' % (title, name))
73 ui.warnnoi18n('gap of section level at "%s" of %s\n' % (title, name))
74 showavailables(ui, initlevel)
74 showavailables(ui, initlevel)
75 errorcnt += 1
75 errorcnt += 1
76 continue
76 continue
77 ui.note(
77 ui.notenoi18n(
78 'appropriate section level for "%s %s"\n'
78 'appropriate section level for "%s %s"\n'
79 % (mark * (nextlevel * 2), title)
79 % (mark * (nextlevel * 2), title)
80 )
80 )
@@ -88,7 +88,7 b' def checkcmdtable(ui, cmdtable, namefmt,'
88 for k, entry in cmdtable.items():
88 for k, entry in cmdtable.items():
89 name = k.split(b"|")[0].lstrip(b"^")
89 name = k.split(b"|")[0].lstrip(b"^")
90 if not entry[0].__doc__:
90 if not entry[0].__doc__:
91 ui.note('skip checking %s: no help document\n' % (namefmt % name))
91 ui.notenoi18n('skip checking %s: no help document\n' % (namefmt % name))
92 continue
92 continue
93 errorcnt += checkseclevel(
93 errorcnt += checkseclevel(
94 ui, entry[0].__doc__, namefmt % name, initlevel
94 ui, entry[0].__doc__, namefmt % name, initlevel
@@ -113,7 +113,7 b' def checkhghelps(ui):'
113 ):
113 ):
114 mod = extensions.load(ui, name, None)
114 mod = extensions.load(ui, name, None)
115 if not mod.__doc__:
115 if not mod.__doc__:
116 ui.note('skip checking %s extension: no help document\n' % name)
116 ui.notenoi18n('skip checking %s extension: no help document\n' % name)
117 continue
117 continue
118 errorcnt += checkseclevel(
118 errorcnt += checkseclevel(
119 ui, mod.__doc__, '%s extension' % name, initlevel_ext
119 ui, mod.__doc__, '%s extension' % name, initlevel_ext
@@ -138,7 +138,7 b' def checkfile(ui, filename, initlevel):'
138 with open(filename) as fp:
138 with open(filename) as fp:
139 doc = fp.read()
139 doc = fp.read()
140
140
141 ui.note(
141 ui.notenoi18n(
142 'checking input from %s with initlevel %d\n' % (filename, initlevel)
142 'checking input from %s with initlevel %d\n' % (filename, initlevel)
143 )
143 )
144 return checkseclevel(ui, doc, 'input from %s' % filename, initlevel)
144 return checkseclevel(ui, doc, 'input from %s' % filename, initlevel)
@@ -1021,7 +1021,7 b' def debugcvsps(ui, *args, **opts):'
1021 )
1021 )
1022 )
1022 )
1023 if cs.branchpoints:
1023 if cs.branchpoints:
1024 ui.write(
1024 ui.writenoi18n(
1025 b'Branchpoints: %s \n' % b', '.join(sorted(cs.branchpoints))
1025 b'Branchpoints: %s \n' % b', '.join(sorted(cs.branchpoints))
1026 )
1026 )
1027 if opts[b"parents"] and cs.parents:
1027 if opts[b"parents"] and cs.parents:
@@ -1044,9 +1044,9 b' def debugcvsps(ui, *args, **opts):'
1044 if r:
1044 if r:
1045 ui.write((b'Ancestors: %s\n' % (b','.join(r))))
1045 ui.write((b'Ancestors: %s\n' % (b','.join(r))))
1046
1046
1047 ui.write(b'Log:\n')
1047 ui.writenoi18n(b'Log:\n')
1048 ui.write(b'%s\n\n' % cs.comment)
1048 ui.write(b'%s\n\n' % cs.comment)
1049 ui.write(b'Members: \n')
1049 ui.writenoi18n(b'Members: \n')
1050 for f in cs.entries:
1050 for f in cs.entries:
1051 fn = f.file
1051 fn = f.file
1052 if fn.startswith(opts[b"prefix"]):
1052 if fn.startswith(opts[b"prefix"]):
@@ -97,17 +97,17 b' def difftree(ui, repo, node1=None, node2'
97
97
98 for f in modified:
98 for f in modified:
99 # TODO get file permissions
99 # TODO get file permissions
100 ui.write(
100 ui.writenoi18n(
101 b":100664 100664 %s %s M\t%s\t%s\n"
101 b":100664 100664 %s %s M\t%s\t%s\n"
102 % (short(mmap[f]), short(mmap2[f]), f, f)
102 % (short(mmap[f]), short(mmap2[f]), f, f)
103 )
103 )
104 for f in added:
104 for f in added:
105 ui.write(
105 ui.writenoi18n(
106 b":000000 100664 %s %s N\t%s\t%s\n"
106 b":000000 100664 %s %s N\t%s\t%s\n"
107 % (empty, short(mmap2[f]), f, f)
107 % (empty, short(mmap2[f]), f, f)
108 )
108 )
109 for f in removed:
109 for f in removed:
110 ui.write(
110 ui.writenoi18n(
111 b":100664 000000 %s %s D\t%s\t%s\n"
111 b":100664 000000 %s %s D\t%s\t%s\n"
112 % (short(mmap[f]), empty, f, f)
112 % (short(mmap[f]), empty, f, f)
113 )
113 )
@@ -166,7 +166,7 b' def catcommit(ui, repo, n, prefix, ctx=N'
166 ui.write((b"branch %s\n" % ctx.branch()))
166 ui.write((b"branch %s\n" % ctx.branch()))
167 if obsolete.isenabled(repo, obsolete.createmarkersopt):
167 if obsolete.isenabled(repo, obsolete.createmarkersopt):
168 if ctx.obsolete():
168 if ctx.obsolete():
169 ui.write(b"obsolete\n")
169 ui.writenoi18n(b"obsolete\n")
170 ui.write((b"phase %s\n\n" % ctx.phasestr()))
170 ui.write((b"phase %s\n\n" % ctx.phasestr()))
171
171
172 if prefix != b"":
172 if prefix != b"":
@@ -517,7 +517,7 b' def demo(ui, repo, *args, **opts):'
517
517
518 uisetup(ui)
518 uisetup(ui)
519 reposetup(ui, repo)
519 reposetup(ui, repo)
520 ui.write(b'[extensions]\nkeyword =\n')
520 ui.writenoi18n(b'[extensions]\nkeyword =\n')
521 demoitems(b'keyword', ui.configitems(b'keyword'))
521 demoitems(b'keyword', ui.configitems(b'keyword'))
522 demoitems(b'keywordset', ui.configitems(b'keywordset'))
522 demoitems(b'keywordset', ui.configitems(b'keywordset'))
523 demoitems(b'keywordmaps', kwmaps.iteritems())
523 demoitems(b'keywordmaps', kwmaps.iteritems())
@@ -774,7 +774,7 b' def phabsend(ui, repo, *revs, **opts):'
774 try:
774 try:
775 writediffproperties(unfi[newnode], diffmap[old.node()])
775 writediffproperties(unfi[newnode], diffmap[old.node()])
776 except util.urlerr.urlerror:
776 except util.urlerr.urlerror:
777 ui.warn(b'Failed to update metadata for D%s\n' % drevid)
777 ui.warnnoi18n(b'Failed to update metadata for D%s\n' % drevid)
778 # Remove local tags since it's no longer necessary
778 # Remove local tags since it's no longer necessary
779 tagname = b'D%d' % drevid
779 tagname = b'D%d' % drevid
780 if tagname in repo.tags():
780 if tagname in repo.tags():
@@ -187,7 +187,7 b' def debugindexdot(orig, ui, repo, file_)'
187
187
188 r = buildtemprevlog(repo, os.path.basename(file_)[:-2])
188 r = buildtemprevlog(repo, os.path.basename(file_)[:-2])
189
189
190 ui.write(b"digraph G {\n")
190 ui.writenoi18n(b"digraph G {\n")
191 for i in r:
191 for i in r:
192 node = r.node(i)
192 node = r.node(i)
193 pp = r.parents(node)
193 pp = r.parents(node)
@@ -289,7 +289,7 b' def debugdatapack(ui, *paths, **opts):'
289 (b"smaller" if difference > 0 else b"bigger"),
289 (b"smaller" if difference > 0 else b"bigger"),
290 )
290 )
291
291
292 ui.write(
292 ui.writenoi18n(
293 b"Total:%s%s %s (%s)\n"
293 b"Total:%s%s %s (%s)\n"
294 % (
294 % (
295 b"".ljust(2 * hashlen - len(b"Total:")),
295 b"".ljust(2 * hashlen - len(b"Total:")),
@@ -316,7 +316,7 b' def showstack(ui, repo, displayer):'
316 else:
316 else:
317 ui.write(b' ')
317 ui.write(b' ')
318
318
319 ui.write(b'o ')
319 ui.writenoi18n(b'o ')
320 displayer.show(ctx, nodelen=nodelen)
320 displayer.show(ctx, nodelen=nodelen)
321 displayer.flush(ctx)
321 displayer.flush(ctx)
322 ui.write(b'\n')
322 ui.write(b'\n')
@@ -378,7 +378,7 b' def showstack(ui, repo, displayer):'
378 ui.write(b' / ')
378 ui.write(b' / ')
379
379
380 ui.write(_(b'(stack base)'), b'\n', label=b'stack.label')
380 ui.write(_(b'(stack base)'), b'\n', label=b'stack.label')
381 ui.write(b'o ')
381 ui.writenoi18n(b'o ')
382
382
383 displayer.show(basectx, nodelen=nodelen)
383 displayer.show(basectx, nodelen=nodelen)
384 displayer.flush(basectx)
384 displayer.flush(basectx)
@@ -215,4 +215,4 b' def extsetup(ui):'
215 # command line options is not yet applied when
215 # command line options is not yet applied when
216 # extensions.loadall() is called.
216 # extensions.loadall() is called.
217 if b'--debug' in sys.argv:
217 if b'--debug' in sys.argv:
218 ui.write(b"[win32mbcs] activated with encoding: %s\n" % _encoding)
218 ui.writenoi18n(b"[win32mbcs] activated with encoding: %s\n" % _encoding)
@@ -2388,7 +2388,7 b' def handleobsmarker(op, inpart):'
2388 tr = op.gettransaction()
2388 tr = op.gettransaction()
2389 markerdata = inpart.read()
2389 markerdata = inpart.read()
2390 if op.ui.config(b'experimental', b'obsmarkers-exchange-debug'):
2390 if op.ui.config(b'experimental', b'obsmarkers-exchange-debug'):
2391 op.ui.write(
2391 op.ui.writenoi18n(
2392 b'obsmarker-exchange: %i bytes received\n' % len(markerdata)
2392 b'obsmarker-exchange: %i bytes received\n' % len(markerdata)
2393 )
2393 )
2394 # The mergemarkers call will crash if marker creation is not enabled.
2394 # The mergemarkers call will crash if marker creation is not enabled.
@@ -304,7 +304,7 b' def debugbuilddag('
304 def _debugchangegroup(ui, gen, all=None, indent=0, **opts):
304 def _debugchangegroup(ui, gen, all=None, indent=0, **opts):
305 indent_string = b' ' * indent
305 indent_string = b' ' * indent
306 if all:
306 if all:
307 ui.write(
307 ui.writenoi18n(
308 b"%sformat: id, p1, p2, cset, delta base, len(delta)\n"
308 b"%sformat: id, p1, p2, cset, delta base, len(delta)\n"
309 % indent_string
309 % indent_string
310 )
310 )
@@ -438,12 +438,12 b' def debugcapabilities(ui, path, **opts):'
438 opts = pycompat.byteskwargs(opts)
438 opts = pycompat.byteskwargs(opts)
439 peer = hg.peer(ui, opts, path)
439 peer = hg.peer(ui, opts, path)
440 caps = peer.capabilities()
440 caps = peer.capabilities()
441 ui.write(b'Main capabilities:\n')
441 ui.writenoi18n(b'Main capabilities:\n')
442 for c in sorted(caps):
442 for c in sorted(caps):
443 ui.write(b' %s\n' % c)
443 ui.write(b' %s\n' % c)
444 b2caps = bundle2.bundle2caps(peer)
444 b2caps = bundle2.bundle2caps(peer)
445 if b2caps:
445 if b2caps:
446 ui.write(b'Bundle2 capabilities:\n')
446 ui.writenoi18n(b'Bundle2 capabilities:\n')
447 for key, values in sorted(b2caps.iteritems()):
447 for key, values in sorted(b2caps.iteritems()):
448 ui.write(b' %s\n' % key)
448 ui.write(b' %s\n' % key)
449 for v in values:
449 for v in values:
@@ -487,7 +487,7 b' def debugcheckstate(ui, repo):'
487 )
487 )
488 def debugcolor(ui, repo, **opts):
488 def debugcolor(ui, repo, **opts):
489 """show available color, effects or style"""
489 """show available color, effects or style"""
490 ui.write(b'color mode: %s\n' % stringutil.pprint(ui._colormode))
490 ui.writenoi18n(b'color mode: %s\n' % stringutil.pprint(ui._colormode))
491 if opts.get(r'style'):
491 if opts.get(r'style'):
492 return _debugdisplaystyle(ui)
492 return _debugdisplaystyle(ui)
493 else:
493 else:
@@ -651,11 +651,11 b' def debugdate(ui, date, range=None, **op'
651 d = dateutil.parsedate(date, util.extendeddateformats)
651 d = dateutil.parsedate(date, util.extendeddateformats)
652 else:
652 else:
653 d = dateutil.parsedate(date)
653 d = dateutil.parsedate(date)
654 ui.write(b"internal: %d %d\n" % d)
654 ui.writenoi18n(b"internal: %d %d\n" % d)
655 ui.write(b"standard: %s\n" % dateutil.datestr(d))
655 ui.writenoi18n(b"standard: %s\n" % dateutil.datestr(d))
656 if range:
656 if range:
657 m = dateutil.matchdate(range)
657 m = dateutil.matchdate(range)
658 ui.write(b"match: %s\n" % m(d[0]))
658 ui.writenoi18n(b"match: %s\n" % m(d[0]))
659
659
660
660
661 @command(
661 @command(
@@ -922,7 +922,7 b' def debugdiscovery(ui, repo, remoteurl=b'
922 )
922 )
923 common = set(common)
923 common = set(common)
924 if not opts.get(b'nonheads'):
924 if not opts.get(b'nonheads'):
925 ui.write(
925 ui.writenoi18n(
926 b"unpruned common: %s\n"
926 b"unpruned common: %s\n"
927 % b" ".join(sorted(short(n) for n in common))
927 % b" ".join(sorted(short(n) for n in common))
928 )
928 )
@@ -969,24 +969,24 b' def debugdiscovery(ui, repo, remoteurl=b'
969 data[b'nb-revs-missing'] = data[b'nb-revs'] - data[b'nb-revs-common']
969 data[b'nb-revs-missing'] = data[b'nb-revs'] - data[b'nb-revs-common']
970
970
971 # display discovery summary
971 # display discovery summary
972 ui.write(b"elapsed time: %(elapsed)f seconds\n" % data)
972 ui.writenoi18n(b"elapsed time: %(elapsed)f seconds\n" % data)
973 ui.write(b"heads summary:\n")
973 ui.writenoi18n(b"heads summary:\n")
974 ui.write(b" total common heads: %(nb-common)9d\n" % data)
974 ui.writenoi18n(b" total common heads: %(nb-common)9d\n" % data)
975 ui.write(b" also local heads: %(nb-common-local)9d\n" % data)
975 ui.writenoi18n(b" also local heads: %(nb-common-local)9d\n" % data)
976 ui.write(b" also remote heads: %(nb-common-remote)9d\n" % data)
976 ui.writenoi18n(b" also remote heads: %(nb-common-remote)9d\n" % data)
977 ui.write(b" both: %(nb-common-both)9d\n" % data)
977 ui.writenoi18n(b" both: %(nb-common-both)9d\n" % data)
978 ui.write(b" local heads: %(nb-local)9d\n" % data)
978 ui.writenoi18n(b" local heads: %(nb-local)9d\n" % data)
979 ui.write(b" common: %(nb-common-local)9d\n" % data)
979 ui.writenoi18n(b" common: %(nb-common-local)9d\n" % data)
980 ui.write(b" missing: %(nb-local-missing)9d\n" % data)
980 ui.writenoi18n(b" missing: %(nb-local-missing)9d\n" % data)
981 ui.write(b" remote heads: %(nb-remote)9d\n" % data)
981 ui.writenoi18n(b" remote heads: %(nb-remote)9d\n" % data)
982 ui.write(b" common: %(nb-common-remote)9d\n" % data)
982 ui.writenoi18n(b" common: %(nb-common-remote)9d\n" % data)
983 ui.write(b" unknown: %(nb-remote-unknown)9d\n" % data)
983 ui.writenoi18n(b" unknown: %(nb-remote-unknown)9d\n" % data)
984 ui.write(b"local changesets: %(nb-revs)9d\n" % data)
984 ui.writenoi18n(b"local changesets: %(nb-revs)9d\n" % data)
985 ui.write(b" common: %(nb-revs-common)9d\n" % data)
985 ui.writenoi18n(b" common: %(nb-revs-common)9d\n" % data)
986 ui.write(b" missing: %(nb-revs-missing)9d\n" % data)
986 ui.writenoi18n(b" missing: %(nb-revs-missing)9d\n" % data)
987
987
988 if ui.verbose:
988 if ui.verbose:
989 ui.write(
989 ui.writenoi18n(
990 b"common heads: %s\n" % b" ".join(sorted(short(n) for n in common))
990 b"common heads: %s\n" % b" ".join(sorted(short(n) for n in common))
991 )
991 )
992
992
@@ -1163,7 +1163,7 b' def debugfileset(ui, repo, expr, **opts)'
1163
1163
1164 m = ctx.matchfileset(expr)
1164 m = ctx.matchfileset(expr)
1165 if opts[b'show_matcher'] or (opts[b'show_matcher'] is None and ui.verbose):
1165 if opts[b'show_matcher'] or (opts[b'show_matcher'] is None and ui.verbose):
1166 ui.write(b'* matcher:\n', stringutil.prettyrepr(m), b'\n')
1166 ui.writenoi18n(b'* matcher:\n', stringutil.prettyrepr(m), b'\n')
1167 for f in sorted(files):
1167 for f in sorted(files):
1168 if not m(f):
1168 if not m(f):
1169 continue
1169 continue
@@ -1245,19 +1245,19 b' def debugformat(ui, repo, **opts):'
1245 @command(b'debugfsinfo', [], _(b'[PATH]'), norepo=True)
1245 @command(b'debugfsinfo', [], _(b'[PATH]'), norepo=True)
1246 def debugfsinfo(ui, path=b"."):
1246 def debugfsinfo(ui, path=b"."):
1247 """show information detected about current filesystem"""
1247 """show information detected about current filesystem"""
1248 ui.write(b'path: %s\n' % path)
1248 ui.writenoi18n(b'path: %s\n' % path)
1249 ui.write(b'mounted on: %s\n' % (util.getfsmountpoint(path) or b'(unknown)'))
1249 ui.writenoi18n(b'mounted on: %s\n' % (util.getfsmountpoint(path) or b'(unknown)'))
1250 ui.write(b'exec: %s\n' % (util.checkexec(path) and b'yes' or b'no'))
1250 ui.writenoi18n(b'exec: %s\n' % (util.checkexec(path) and b'yes' or b'no'))
1251 ui.write(b'fstype: %s\n' % (util.getfstype(path) or b'(unknown)'))
1251 ui.writenoi18n(b'fstype: %s\n' % (util.getfstype(path) or b'(unknown)'))
1252 ui.write(b'symlink: %s\n' % (util.checklink(path) and b'yes' or b'no'))
1252 ui.writenoi18n(b'symlink: %s\n' % (util.checklink(path) and b'yes' or b'no'))
1253 ui.write(b'hardlink: %s\n' % (util.checknlink(path) and b'yes' or b'no'))
1253 ui.writenoi18n(b'hardlink: %s\n' % (util.checknlink(path) and b'yes' or b'no'))
1254 casesensitive = b'(unknown)'
1254 casesensitive = b'(unknown)'
1255 try:
1255 try:
1256 with pycompat.namedtempfile(prefix=b'.debugfsinfo', dir=path) as f:
1256 with pycompat.namedtempfile(prefix=b'.debugfsinfo', dir=path) as f:
1257 casesensitive = util.fscasesensitive(f.name) and b'yes' or b'no'
1257 casesensitive = util.fscasesensitive(f.name) and b'yes' or b'no'
1258 except OSError:
1258 except OSError:
1259 pass
1259 pass
1260 ui.write(b'case-sensitive: %s\n' % casesensitive)
1260 ui.writenoi18n(b'case-sensitive: %s\n' % casesensitive)
1261
1261
1262
1262
1263 @command(
1263 @command(
@@ -1409,7 +1409,7 b' def debugindexdot(ui, repo, file_=None, '
1409 """dump an index DAG as a graphviz dot file"""
1409 """dump an index DAG as a graphviz dot file"""
1410 opts = pycompat.byteskwargs(opts)
1410 opts = pycompat.byteskwargs(opts)
1411 r = cmdutil.openstorage(repo, b'debugindexdot', file_, opts)
1411 r = cmdutil.openstorage(repo, b'debugindexdot', file_, opts)
1412 ui.write(b"digraph G {\n")
1412 ui.writenoi18n(b"digraph G {\n")
1413 for i in r:
1413 for i in r:
1414 node = r.node(i)
1414 node = r.node(i)
1415 pp = r.parents(node)
1415 pp = r.parents(node)
@@ -1818,13 +1818,13 b' def debuglocks(ui, repo, **opts):'
1818 pid,
1818 pid,
1819 host,
1819 host,
1820 )
1820 )
1821 ui.write(b"%-6s %s (%ds)\n" % (name + b":", locker, age))
1821 ui.writenoi18n(b"%-6s %s (%ds)\n" % (name + b":", locker, age))
1822 return 1
1822 return 1
1823 except OSError as e:
1823 except OSError as e:
1824 if e.errno != errno.ENOENT:
1824 if e.errno != errno.ENOENT:
1825 raise
1825 raise
1826
1826
1827 ui.write(b"%-6s free\n" % (name + b":"))
1827 ui.writenoi18n(b"%-6s free\n" % (name + b":"))
1828 return 0
1828 return 0
1829
1829
1830 held += report(repo.svfs, b"lock", repo.lock)
1830 held += report(repo.svfs, b"lock", repo.lock)
@@ -1920,7 +1920,7 b' def debugmergestate(ui, repo, *args):'
1920 return h
1920 return h
1921
1921
1922 def printrecords(version):
1922 def printrecords(version):
1923 ui.write(b'* version %d records\n' % version)
1923 ui.writenoi18n(b'* version %d records\n' % version)
1924 if version == 1:
1924 if version == 1:
1925 records = v1records
1925 records = v1records
1926 else:
1926 else:
@@ -1929,12 +1929,12 b' def debugmergestate(ui, repo, *args):'
1929 for rtype, record in records:
1929 for rtype, record in records:
1930 # pretty print some record types
1930 # pretty print some record types
1931 if rtype == b'L':
1931 if rtype == b'L':
1932 ui.write(b'local: %s\n' % record)
1932 ui.writenoi18n(b'local: %s\n' % record)
1933 elif rtype == b'O':
1933 elif rtype == b'O':
1934 ui.write(b'other: %s\n' % record)
1934 ui.writenoi18n(b'other: %s\n' % record)
1935 elif rtype == b'm':
1935 elif rtype == b'm':
1936 driver, mdstate = record.split(b'\0', 1)
1936 driver, mdstate = record.split(b'\0', 1)
1937 ui.write(b'merge driver: %s (state "%s")\n' % (driver, mdstate))
1937 ui.writenoi18n(b'merge driver: %s (state "%s")\n' % (driver, mdstate))
1938 elif rtype in b'FDC':
1938 elif rtype in b'FDC':
1939 r = record.split(b'\0')
1939 r = record.split(b'\0')
1940 f, state, hash, lfile, afile, anode, ofile = r[0:7]
1940 f, state, hash, lfile, afile, anode, ofile = r[0:7]
@@ -1943,16 +1943,16 b' def debugmergestate(ui, repo, *args):'
1943 flags = r[7]
1943 flags = r[7]
1944 else:
1944 else:
1945 onode, flags = r[7:9]
1945 onode, flags = r[7:9]
1946 ui.write(
1946 ui.writenoi18n(
1947 b'file: %s (record type "%s", state "%s", hash %s)\n'
1947 b'file: %s (record type "%s", state "%s", hash %s)\n'
1948 % (f, rtype, state, _hashornull(hash))
1948 % (f, rtype, state, _hashornull(hash))
1949 )
1949 )
1950 ui.write(b' local path: %s (flags "%s")\n' % (lfile, flags))
1950 ui.writenoi18n(b' local path: %s (flags "%s")\n' % (lfile, flags))
1951 ui.write(
1951 ui.writenoi18n(
1952 b' ancestor path: %s (node %s)\n'
1952 b' ancestor path: %s (node %s)\n'
1953 % (afile, _hashornull(anode))
1953 % (afile, _hashornull(anode))
1954 )
1954 )
1955 ui.write(
1955 ui.writenoi18n(
1956 b' other path: %s (node %s)\n'
1956 b' other path: %s (node %s)\n'
1957 % (ofile, _hashornull(onode))
1957 % (ofile, _hashornull(onode))
1958 )
1958 )
@@ -1965,20 +1965,20 b' def debugmergestate(ui, repo, *args):'
1965 extrastrings.append(b'%s = %s' % (extras[i], extras[i + 1]))
1965 extrastrings.append(b'%s = %s' % (extras[i], extras[i + 1]))
1966 i += 2
1966 i += 2
1967
1967
1968 ui.write(
1968 ui.writenoi18n(
1969 b'file extras: %s (%s)\n'
1969 b'file extras: %s (%s)\n'
1970 % (filename, b', '.join(extrastrings))
1970 % (filename, b', '.join(extrastrings))
1971 )
1971 )
1972 elif rtype == b'l':
1972 elif rtype == b'l':
1973 labels = record.split(b'\0', 2)
1973 labels = record.split(b'\0', 2)
1974 labels = [l for l in labels if len(l) > 0]
1974 labels = [l for l in labels if len(l) > 0]
1975 ui.write(b'labels:\n')
1975 ui.writenoi18n(b'labels:\n')
1976 ui.write((b' local: %s\n' % labels[0]))
1976 ui.write((b' local: %s\n' % labels[0]))
1977 ui.write((b' other: %s\n' % labels[1]))
1977 ui.write((b' other: %s\n' % labels[1]))
1978 if len(labels) > 2:
1978 if len(labels) > 2:
1979 ui.write((b' base: %s\n' % labels[2]))
1979 ui.write((b' base: %s\n' % labels[2]))
1980 else:
1980 else:
1981 ui.write(
1981 ui.writenoi18n(
1982 b'unrecognized entry: %s\t%s\n'
1982 b'unrecognized entry: %s\t%s\n'
1983 % (rtype, record.replace(b'\0', b'\t'))
1983 % (rtype, record.replace(b'\0', b'\t'))
1984 )
1984 )
@@ -2004,15 +2004,15 b' def debugmergestate(ui, repo, *args):'
2004 v2records.sort(key=key)
2004 v2records.sort(key=key)
2005
2005
2006 if not v1records and not v2records:
2006 if not v1records and not v2records:
2007 ui.write(b'no merge state found\n')
2007 ui.writenoi18n(b'no merge state found\n')
2008 elif not v2records:
2008 elif not v2records:
2009 ui.note(b'no version 2 merge state\n')
2009 ui.notenoi18n(b'no version 2 merge state\n')
2010 printrecords(1)
2010 printrecords(1)
2011 elif ms._v1v2match(v1records, v2records):
2011 elif ms._v1v2match(v1records, v2records):
2012 ui.note(b'v1 and v2 states match: using v2\n')
2012 ui.notenoi18n(b'v1 and v2 states match: using v2\n')
2013 printrecords(2)
2013 printrecords(2)
2014 else:
2014 else:
2015 ui.note(b'v1 and v2 states mismatch: using v1\n')
2015 ui.notenoi18n(b'v1 and v2 states mismatch: using v1\n')
2016 printrecords(1)
2016 printrecords(1)
2017 if ui.verbose:
2017 if ui.verbose:
2018 printrecords(2)
2018 printrecords(2)
@@ -2381,15 +2381,15 b' def debugpickmergetool(ui, repo, *pats, '
2381 overrides = {}
2381 overrides = {}
2382 if opts[b'tool']:
2382 if opts[b'tool']:
2383 overrides[(b'ui', b'forcemerge')] = opts[b'tool']
2383 overrides[(b'ui', b'forcemerge')] = opts[b'tool']
2384 ui.note(b'with --tool %r\n' % (pycompat.bytestr(opts[b'tool'])))
2384 ui.notenoi18n(b'with --tool %r\n' % (pycompat.bytestr(opts[b'tool'])))
2385
2385
2386 with ui.configoverride(overrides, b'debugmergepatterns'):
2386 with ui.configoverride(overrides, b'debugmergepatterns'):
2387 hgmerge = encoding.environ.get(b"HGMERGE")
2387 hgmerge = encoding.environ.get(b"HGMERGE")
2388 if hgmerge is not None:
2388 if hgmerge is not None:
2389 ui.note(b'with HGMERGE=%r\n' % (pycompat.bytestr(hgmerge)))
2389 ui.notenoi18n(b'with HGMERGE=%r\n' % (pycompat.bytestr(hgmerge)))
2390 uimerge = ui.config(b"ui", b"merge")
2390 uimerge = ui.config(b"ui", b"merge")
2391 if uimerge:
2391 if uimerge:
2392 ui.note(b'with ui.merge=%r\n' % (pycompat.bytestr(uimerge)))
2392 ui.notenoi18n(b'with ui.merge=%r\n' % (pycompat.bytestr(uimerge)))
2393
2393
2394 ctx = scmutil.revsingle(repo, opts.get(b'rev'))
2394 ctx = scmutil.revsingle(repo, opts.get(b'rev'))
2395 m = scmutil.match(ctx, pats, opts)
2395 m = scmutil.match(ctx, pats, opts)
@@ -2785,34 +2785,34 b' def debugrevlog(ui, repo, file_=None, **'
2785 else:
2785 else:
2786 return value, 100.0
2786 return value, 100.0
2787
2787
2788 ui.write(b'format : %d\n' % format)
2788 ui.writenoi18n(b'format : %d\n' % format)
2789 ui.write(b'flags : %s\n' % b', '.join(flags))
2789 ui.writenoi18n(b'flags : %s\n' % b', '.join(flags))
2790
2790
2791 ui.write(b'\n')
2791 ui.write(b'\n')
2792 fmt = pcfmtstr(totalsize)
2792 fmt = pcfmtstr(totalsize)
2793 fmt2 = dfmtstr(totalsize)
2793 fmt2 = dfmtstr(totalsize)
2794 ui.write(b'revisions : ' + fmt2 % numrevs)
2794 ui.writenoi18n(b'revisions : ' + fmt2 % numrevs)
2795 ui.write(b' merges : ' + fmt % pcfmt(nummerges, numrevs))
2795 ui.writenoi18n(b' merges : ' + fmt % pcfmt(nummerges, numrevs))
2796 ui.write(b' normal : ' + fmt % pcfmt(numrevs - nummerges, numrevs))
2796 ui.writenoi18n(b' normal : ' + fmt % pcfmt(numrevs - nummerges, numrevs))
2797 ui.write(b'revisions : ' + fmt2 % numrevs)
2797 ui.writenoi18n(b'revisions : ' + fmt2 % numrevs)
2798 ui.write(b' empty : ' + fmt % pcfmt(numempty, numrevs))
2798 ui.writenoi18n(b' empty : ' + fmt % pcfmt(numempty, numrevs))
2799 ui.write(
2799 ui.writenoi18n(
2800 b' text : '
2800 b' text : '
2801 + fmt % pcfmt(numemptytext, numemptytext + numemptydelta)
2801 + fmt % pcfmt(numemptytext, numemptytext + numemptydelta)
2802 )
2802 )
2803 ui.write(
2803 ui.writenoi18n(
2804 b' delta : '
2804 b' delta : '
2805 + fmt % pcfmt(numemptydelta, numemptytext + numemptydelta)
2805 + fmt % pcfmt(numemptydelta, numemptytext + numemptydelta)
2806 )
2806 )
2807 ui.write(b' snapshot : ' + fmt % pcfmt(numfull + numsemi, numrevs))
2807 ui.writenoi18n(b' snapshot : ' + fmt % pcfmt(numfull + numsemi, numrevs))
2808 for depth in sorted(numsnapdepth):
2808 for depth in sorted(numsnapdepth):
2809 ui.write(
2809 ui.write(
2810 (b' lvl-%-3d : ' % depth)
2810 (b' lvl-%-3d : ' % depth)
2811 + fmt % pcfmt(numsnapdepth[depth], numrevs)
2811 + fmt % pcfmt(numsnapdepth[depth], numrevs)
2812 )
2812 )
2813 ui.write(b' deltas : ' + fmt % pcfmt(numdeltas, numrevs))
2813 ui.writenoi18n(b' deltas : ' + fmt % pcfmt(numdeltas, numrevs))
2814 ui.write(b'revision size : ' + fmt2 % totalsize)
2814 ui.writenoi18n(b'revision size : ' + fmt2 % totalsize)
2815 ui.write(
2815 ui.writenoi18n(
2816 b' snapshot : ' + fmt % pcfmt(fulltotal + semitotal, totalsize)
2816 b' snapshot : ' + fmt % pcfmt(fulltotal + semitotal, totalsize)
2817 )
2817 )
2818 for depth in sorted(numsnapdepth):
2818 for depth in sorted(numsnapdepth):
@@ -2820,7 +2820,7 b' def debugrevlog(ui, repo, file_=None, **'
2820 (b' lvl-%-3d : ' % depth)
2820 (b' lvl-%-3d : ' % depth)
2821 + fmt % pcfmt(snaptotal[depth], totalsize)
2821 + fmt % pcfmt(snaptotal[depth], totalsize)
2822 )
2822 )
2823 ui.write(b' deltas : ' + fmt % pcfmt(deltatotal, totalsize))
2823 ui.writenoi18n(b' deltas : ' + fmt % pcfmt(deltatotal, totalsize))
2824
2824
2825 def fmtchunktype(chunktype):
2825 def fmtchunktype(chunktype):
2826 if chunktype == b'empty':
2826 if chunktype == b'empty':
@@ -2831,44 +2831,44 b' def debugrevlog(ui, repo, file_=None, **'
2831 return b' 0x%s : ' % hex(chunktype)
2831 return b' 0x%s : ' % hex(chunktype)
2832
2832
2833 ui.write(b'\n')
2833 ui.write(b'\n')
2834 ui.write(b'chunks : ' + fmt2 % numrevs)
2834 ui.writenoi18n(b'chunks : ' + fmt2 % numrevs)
2835 for chunktype in sorted(chunktypecounts):
2835 for chunktype in sorted(chunktypecounts):
2836 ui.write(fmtchunktype(chunktype))
2836 ui.write(fmtchunktype(chunktype))
2837 ui.write(fmt % pcfmt(chunktypecounts[chunktype], numrevs))
2837 ui.write(fmt % pcfmt(chunktypecounts[chunktype], numrevs))
2838 ui.write(b'chunks size : ' + fmt2 % totalsize)
2838 ui.writenoi18n(b'chunks size : ' + fmt2 % totalsize)
2839 for chunktype in sorted(chunktypecounts):
2839 for chunktype in sorted(chunktypecounts):
2840 ui.write(fmtchunktype(chunktype))
2840 ui.write(fmtchunktype(chunktype))
2841 ui.write(fmt % pcfmt(chunktypesizes[chunktype], totalsize))
2841 ui.write(fmt % pcfmt(chunktypesizes[chunktype], totalsize))
2842
2842
2843 ui.write(b'\n')
2843 ui.write(b'\n')
2844 fmt = dfmtstr(max(avgchainlen, maxchainlen, maxchainspan, compratio))
2844 fmt = dfmtstr(max(avgchainlen, maxchainlen, maxchainspan, compratio))
2845 ui.write(b'avg chain length : ' + fmt % avgchainlen)
2845 ui.writenoi18n(b'avg chain length : ' + fmt % avgchainlen)
2846 ui.write(b'max chain length : ' + fmt % maxchainlen)
2846 ui.writenoi18n(b'max chain length : ' + fmt % maxchainlen)
2847 ui.write(b'max chain reach : ' + fmt % maxchainspan)
2847 ui.writenoi18n(b'max chain reach : ' + fmt % maxchainspan)
2848 ui.write(b'compression ratio : ' + fmt % compratio)
2848 ui.writenoi18n(b'compression ratio : ' + fmt % compratio)
2849
2849
2850 if format > 0:
2850 if format > 0:
2851 ui.write(b'\n')
2851 ui.write(b'\n')
2852 ui.write(
2852 ui.writenoi18n(
2853 b'uncompressed data size (min/max/avg) : %d / %d / %d\n'
2853 b'uncompressed data size (min/max/avg) : %d / %d / %d\n'
2854 % tuple(datasize)
2854 % tuple(datasize)
2855 )
2855 )
2856 ui.write(
2856 ui.writenoi18n(
2857 b'full revision size (min/max/avg) : %d / %d / %d\n'
2857 b'full revision size (min/max/avg) : %d / %d / %d\n'
2858 % tuple(fullsize)
2858 % tuple(fullsize)
2859 )
2859 )
2860 ui.write(
2860 ui.writenoi18n(
2861 b'inter-snapshot size (min/max/avg) : %d / %d / %d\n'
2861 b'inter-snapshot size (min/max/avg) : %d / %d / %d\n'
2862 % tuple(semisize)
2862 % tuple(semisize)
2863 )
2863 )
2864 for depth in sorted(snapsizedepth):
2864 for depth in sorted(snapsizedepth):
2865 if depth == 0:
2865 if depth == 0:
2866 continue
2866 continue
2867 ui.write(
2867 ui.writenoi18n(
2868 b' level-%-3d (min/max/avg) : %d / %d / %d\n'
2868 b' level-%-3d (min/max/avg) : %d / %d / %d\n'
2869 % ((depth,) + tuple(snapsizedepth[depth]))
2869 % ((depth,) + tuple(snapsizedepth[depth]))
2870 )
2870 )
2871 ui.write(
2871 ui.writenoi18n(
2872 b'delta size (min/max/avg) : %d / %d / %d\n'
2872 b'delta size (min/max/avg) : %d / %d / %d\n'
2873 % tuple(deltasize)
2873 % tuple(deltasize)
2874 )
2874 )
@@ -2877,21 +2877,21 b' def debugrevlog(ui, repo, file_=None, **'
2877 ui.write(b'\n')
2877 ui.write(b'\n')
2878 fmt = pcfmtstr(numdeltas)
2878 fmt = pcfmtstr(numdeltas)
2879 fmt2 = pcfmtstr(numdeltas, 4)
2879 fmt2 = pcfmtstr(numdeltas, 4)
2880 ui.write(b'deltas against prev : ' + fmt % pcfmt(numprev, numdeltas))
2880 ui.writenoi18n(b'deltas against prev : ' + fmt % pcfmt(numprev, numdeltas))
2881 if numprev > 0:
2881 if numprev > 0:
2882 ui.write(
2882 ui.writenoi18n(
2883 b' where prev = p1 : ' + fmt2 % pcfmt(nump1prev, numprev)
2883 b' where prev = p1 : ' + fmt2 % pcfmt(nump1prev, numprev)
2884 )
2884 )
2885 ui.write(
2885 ui.writenoi18n(
2886 b' where prev = p2 : ' + fmt2 % pcfmt(nump2prev, numprev)
2886 b' where prev = p2 : ' + fmt2 % pcfmt(nump2prev, numprev)
2887 )
2887 )
2888 ui.write(
2888 ui.writenoi18n(
2889 b' other : ' + fmt2 % pcfmt(numoprev, numprev)
2889 b' other : ' + fmt2 % pcfmt(numoprev, numprev)
2890 )
2890 )
2891 if gdelta:
2891 if gdelta:
2892 ui.write(b'deltas against p1 : ' + fmt % pcfmt(nump1, numdeltas))
2892 ui.writenoi18n(b'deltas against p1 : ' + fmt % pcfmt(nump1, numdeltas))
2893 ui.write(b'deltas against p2 : ' + fmt % pcfmt(nump2, numdeltas))
2893 ui.writenoi18n(b'deltas against p2 : ' + fmt % pcfmt(nump2, numdeltas))
2894 ui.write(
2894 ui.writenoi18n(
2895 b'deltas against other : ' + fmt % pcfmt(numother, numdeltas)
2895 b'deltas against other : ' + fmt % pcfmt(numother, numdeltas)
2896 )
2896 )
2897
2897
@@ -2929,7 +2929,7 b' def debugrevlogindex(ui, repo, file_=Non'
2929 % (b"nodeid".ljust(idlen), b"p1".ljust(idlen))
2929 % (b"nodeid".ljust(idlen), b"p1".ljust(idlen))
2930 )
2930 )
2931 else:
2931 else:
2932 ui.write(
2932 ui.writenoi18n(
2933 b" rev linkrev %s %s p2\n"
2933 b" rev linkrev %s %s p2\n"
2934 % (b"nodeid".ljust(idlen), b"p1".ljust(idlen))
2934 % (b"nodeid".ljust(idlen), b"p1".ljust(idlen))
2935 )
2935 )
@@ -2943,7 +2943,7 b' def debugrevlogindex(ui, repo, file_=Non'
2943 % b"nodeid".rjust(idlen)
2943 % b"nodeid".rjust(idlen)
2944 )
2944 )
2945 else:
2945 else:
2946 ui.write(
2946 ui.writenoi18n(
2947 b" rev flag size link p1 p2 %s\n"
2947 b" rev flag size link p1 p2 %s\n"
2948 % b"nodeid".rjust(idlen)
2948 % b"nodeid".rjust(idlen)
2949 )
2949 )
@@ -3109,14 +3109,14 b' def debugrevspec(ui, repo, expr, **opts)'
3109 arevs = revset.makematcher(treebystage[b'analyzed'])(repo)
3109 arevs = revset.makematcher(treebystage[b'analyzed'])(repo)
3110 brevs = revset.makematcher(treebystage[b'optimized'])(repo)
3110 brevs = revset.makematcher(treebystage[b'optimized'])(repo)
3111 if opts[b'show_set'] or (opts[b'show_set'] is None and ui.verbose):
3111 if opts[b'show_set'] or (opts[b'show_set'] is None and ui.verbose):
3112 ui.write(b"* analyzed set:\n", stringutil.prettyrepr(arevs), b"\n")
3112 ui.writenoi18n(b"* analyzed set:\n", stringutil.prettyrepr(arevs), b"\n")
3113 ui.write(b"* optimized set:\n", stringutil.prettyrepr(brevs), b"\n")
3113 ui.writenoi18n(b"* optimized set:\n", stringutil.prettyrepr(brevs), b"\n")
3114 arevs = list(arevs)
3114 arevs = list(arevs)
3115 brevs = list(brevs)
3115 brevs = list(brevs)
3116 if arevs == brevs:
3116 if arevs == brevs:
3117 return 0
3117 return 0
3118 ui.write(b'--- analyzed\n', label=b'diff.file_a')
3118 ui.writenoi18n(b'--- analyzed\n', label=b'diff.file_a')
3119 ui.write(b'+++ optimized\n', label=b'diff.file_b')
3119 ui.writenoi18n(b'+++ optimized\n', label=b'diff.file_b')
3120 sm = difflib.SequenceMatcher(None, arevs, brevs)
3120 sm = difflib.SequenceMatcher(None, arevs, brevs)
3121 for tag, alo, ahi, blo, bhi in sm.get_opcodes():
3121 for tag, alo, ahi, blo, bhi in sm.get_opcodes():
3122 if tag in (r'delete', r'replace'):
3122 if tag in (r'delete', r'replace'):
@@ -3133,7 +3133,7 b' def debugrevspec(ui, repo, expr, **opts)'
3133 func = revset.makematcher(tree)
3133 func = revset.makematcher(tree)
3134 revs = func(repo)
3134 revs = func(repo)
3135 if opts[b'show_set'] or (opts[b'show_set'] is None and ui.verbose):
3135 if opts[b'show_set'] or (opts[b'show_set'] is None and ui.verbose):
3136 ui.write(b"* set:\n", stringutil.prettyrepr(revs), b"\n")
3136 ui.writenoi18n(b"* set:\n", stringutil.prettyrepr(revs), b"\n")
3137 if not opts[b'show_revs']:
3137 if not opts[b'show_revs']:
3138 return
3138 return
3139 for c in revs:
3139 for c in revs:
@@ -3311,9 +3311,9 b' def debugssl(ui, repo, source=None, **op'
3311 def debugsub(ui, repo, rev=None):
3311 def debugsub(ui, repo, rev=None):
3312 ctx = scmutil.revsingle(repo, rev, None)
3312 ctx = scmutil.revsingle(repo, rev, None)
3313 for k, v in sorted(ctx.substate.items()):
3313 for k, v in sorted(ctx.substate.items()):
3314 ui.write(b'path %s\n' % k)
3314 ui.writenoi18n(b'path %s\n' % k)
3315 ui.write(b' source %s\n' % v[0])
3315 ui.writenoi18n(b' source %s\n' % v[0])
3316 ui.write(b' revision %s\n' % v[1])
3316 ui.writenoi18n(b' revision %s\n' % v[1])
3317
3317
3318
3318
3319 @command(
3319 @command(
@@ -3414,22 +3414,22 b' def debugtemplate(ui, repo, tmpl, **opts'
3414 ui.note(templater.prettyformat(tree), b'\n')
3414 ui.note(templater.prettyformat(tree), b'\n')
3415 newtree = templater.expandaliases(tree, aliases)
3415 newtree = templater.expandaliases(tree, aliases)
3416 if newtree != tree:
3416 if newtree != tree:
3417 ui.note(b"* expanded:\n", templater.prettyformat(newtree), b'\n')
3417 ui.notenoi18n(b"* expanded:\n", templater.prettyformat(newtree), b'\n')
3418
3418
3419 if revs is None:
3419 if revs is None:
3420 tres = formatter.templateresources(ui, repo)
3420 tres = formatter.templateresources(ui, repo)
3421 t = formatter.maketemplater(ui, tmpl, resources=tres)
3421 t = formatter.maketemplater(ui, tmpl, resources=tres)
3422 if ui.verbose:
3422 if ui.verbose:
3423 kwds, funcs = t.symbolsuseddefault()
3423 kwds, funcs = t.symbolsuseddefault()
3424 ui.write(b"* keywords: %s\n" % b', '.join(sorted(kwds)))
3424 ui.writenoi18n(b"* keywords: %s\n" % b', '.join(sorted(kwds)))
3425 ui.write(b"* functions: %s\n" % b', '.join(sorted(funcs)))
3425 ui.writenoi18n(b"* functions: %s\n" % b', '.join(sorted(funcs)))
3426 ui.write(t.renderdefault(props))
3426 ui.write(t.renderdefault(props))
3427 else:
3427 else:
3428 displayer = logcmdutil.maketemplater(ui, repo, tmpl)
3428 displayer = logcmdutil.maketemplater(ui, repo, tmpl)
3429 if ui.verbose:
3429 if ui.verbose:
3430 kwds, funcs = displayer.t.symbolsuseddefault()
3430 kwds, funcs = displayer.t.symbolsuseddefault()
3431 ui.write(b"* keywords: %s\n" % b', '.join(sorted(kwds)))
3431 ui.writenoi18n(b"* keywords: %s\n" % b', '.join(sorted(kwds)))
3432 ui.write(b"* functions: %s\n" % b', '.join(sorted(funcs)))
3432 ui.writenoi18n(b"* functions: %s\n" % b', '.join(sorted(funcs)))
3433 for r in revs:
3433 for r in revs:
3434 displayer.show(repo[r], **pycompat.strkwargs(props))
3434 displayer.show(repo[r], **pycompat.strkwargs(props))
3435 displayer.close()
3435 displayer.close()
@@ -3444,7 +3444,7 b' def debugtemplate(ui, repo, tmpl, **opts'
3444 def debuguigetpass(ui, prompt=b''):
3444 def debuguigetpass(ui, prompt=b''):
3445 """show prompt to type password"""
3445 """show prompt to type password"""
3446 r = ui.getpass(prompt)
3446 r = ui.getpass(prompt)
3447 ui.write(b'respose: %s\n' % r)
3447 ui.writenoi18n(b'respose: %s\n' % r)
3448
3448
3449
3449
3450 @command(
3450 @command(
@@ -3456,7 +3456,7 b" def debuguigetpass(ui, prompt=b''):"
3456 def debuguiprompt(ui, prompt=b''):
3456 def debuguiprompt(ui, prompt=b''):
3457 """show plain prompt"""
3457 """show plain prompt"""
3458 r = ui.prompt(prompt)
3458 r = ui.prompt(prompt)
3459 ui.write(b'response: %s\n' % r)
3459 ui.writenoi18n(b'response: %s\n' % r)
3460
3460
3461
3461
3462 @command(b'debugupdatecaches', [])
3462 @command(b'debugupdatecaches', [])
@@ -3522,7 +3522,7 b' def debugwalk(ui, repo, *pats, **opts):'
3522 opts = pycompat.byteskwargs(opts)
3522 opts = pycompat.byteskwargs(opts)
3523 m = scmutil.match(repo[None], pats, opts)
3523 m = scmutil.match(repo[None], pats, opts)
3524 if ui.verbose:
3524 if ui.verbose:
3525 ui.write(b'* matcher:\n', stringutil.prettyrepr(m), b'\n')
3525 ui.writenoi18n(b'* matcher:\n', stringutil.prettyrepr(m), b'\n')
3526 items = list(repo[None].walk(m))
3526 items = list(repo[None].walk(m))
3527 if not items:
3527 if not items:
3528 return
3528 return
@@ -93,7 +93,7 b' class request(object):'
93 except: # re-raises below
93 except: # re-raises below
94 if exc is None:
94 if exc is None:
95 exc = sys.exc_info()[1]
95 exc = sys.exc_info()[1]
96 self.ui.warn(b'error in exit handlers:\n')
96 self.ui.warnnoi18n(b'error in exit handlers:\n')
97 self.ui.traceback(force=True)
97 self.ui.traceback(force=True)
98 finally:
98 finally:
99 if exc is not None:
99 if exc is not None:
@@ -383,11 +383,11 b' def wrapsocket(sock, keyfile, certfile, '
383 sslkeylog.set_keylog(
383 sslkeylog.set_keylog(
384 pycompat.fsdecode(encoding.environ[b'SSLKEYLOGFILE'])
384 pycompat.fsdecode(encoding.environ[b'SSLKEYLOGFILE'])
385 )
385 )
386 ui.warn(
386 ui.warnnoi18n(
387 b'sslkeylog enabled by SSLKEYLOGFILE environment variable\n'
387 b'sslkeylog enabled by SSLKEYLOGFILE environment variable\n'
388 )
388 )
389 except ImportError:
389 except ImportError:
390 ui.warn(
390 ui.warnnoi18n(
391 b'sslkeylog module missing, '
391 b'sslkeylog module missing, '
392 b'but SSLKEYLOGFILE set in environment\n'
392 b'but SSLKEYLOGFILE set in environment\n'
393 )
393 )
@@ -14,10 +14,10 b' def testdispatch(cmd):'
14 """
14 """
15 ui = uimod.ui.load()
15 ui = uimod.ui.load()
16 extensions.populateui(ui)
16 extensions.populateui(ui)
17 ui.status(b"running: %s\n" % cmd)
17 ui.statusnoi18n(b"running: %s\n" % cmd)
18 req = dispatch.request(cmd.split(), ui)
18 req = dispatch.request(cmd.split(), ui)
19 result = dispatch.dispatch(req)
19 result = dispatch.dispatch(req)
20 ui.status(b"result: %r\n" % result)
20 ui.statusnoi18n(b"result: %r\n" % result)
21
21
22
22
23 # create file 'foo', add and commit
23 # create file 'foo', add and commit
@@ -10,8 +10,8 b' from mercurial.utils import stringutil'
10 # ensure errors aren't buffered
10 # ensure errors aren't buffered
11 testui = uimod.ui()
11 testui = uimod.ui()
12 testui.pushbuffer()
12 testui.pushbuffer()
13 testui.write(b'buffered\n')
13 testui.writenoi18n(b'buffered\n')
14 testui.warn(b'warning\n')
14 testui.warnnoi18n(b'warning\n')
15 testui.write_err(b'error\n')
15 testui.write_err(b'error\n')
16 print(stringutil.pprint(testui.popbuffer(), bprefix=True).decode('ascii'))
16 print(stringutil.pprint(testui.popbuffer(), bprefix=True).decode('ascii'))
17
17
General Comments 0
You need to be logged in to leave comments. Login now