Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
| Automatic diff as part of commit; lint not applicable. |
| Automatic diff as part of commit; unit tests not applicable. |
| return _debugbundle2(ui, gen, all=all, **opts) | return _debugbundle2(ui, gen, all=all, **opts) | ||||
| _debugchangegroup(ui, gen, all=all, **opts) | _debugchangegroup(ui, gen, all=all, **opts) | ||||
| @command('debugcapabilities', | @command('debugcapabilities', | ||||
| [], _('PATH'), | [], _('PATH'), | ||||
| norepo=True) | norepo=True) | ||||
| def debugcapabilities(ui, path, **opts): | def debugcapabilities(ui, path, **opts): | ||||
| """lists the capabilities of a remote peer""" | """lists the capabilities of a remote peer""" | ||||
| opts = pycompat.byteskwargs(opts) | |||||
| peer = hg.peer(ui, opts, path) | peer = hg.peer(ui, opts, path) | ||||
| caps = peer.capabilities() | caps = peer.capabilities() | ||||
| ui.write(('Main capabilities:\n')) | ui.write(('Main capabilities:\n')) | ||||
| for c in sorted(caps): | for c in sorted(caps): | ||||
| ui.write((' %s\n') % c) | ui.write((' %s\n') % c) | ||||
| b2caps = bundle2.bundle2caps(peer) | b2caps = bundle2.bundle2caps(peer) | ||||
| if b2caps: | if b2caps: | ||||
| ui.write(('Bundle2 capabilities:\n')) | ui.write(('Bundle2 capabilities:\n')) | ||||
| @command('debugformat', | @command('debugformat', | ||||
| [] + cmdutil.formatteropts, | [] + cmdutil.formatteropts, | ||||
| _('')) | _('')) | ||||
| def debugformat(ui, repo, **opts): | def debugformat(ui, repo, **opts): | ||||
| """display format information about the current repository | """display format information about the current repository | ||||
| Use --verbose to get extra information about current config value and | Use --verbose to get extra information about current config value and | ||||
| Mercurial default.""" | Mercurial default.""" | ||||
| opts = pycompat.byteskwargs(opts) | |||||
| maxvariantlength = max(len(fv.name) for fv in upgrade.allformatvariant) | maxvariantlength = max(len(fv.name) for fv in upgrade.allformatvariant) | ||||
| maxvariantlength = max(len('format-variant'), maxvariantlength) | maxvariantlength = max(len('format-variant'), maxvariantlength) | ||||
| def makeformatname(name): | def makeformatname(name): | ||||
| return '%s:' + (' ' * (maxvariantlength - len(name))) | return '%s:' + (' ' * (maxvariantlength - len(name))) | ||||
| fm = ui.formatter('debugformat', opts) | fm = ui.formatter('debugformat', opts) | ||||
| if fm.isplain(): | if fm.isplain(): | ||||
| if ui.debug(): | if ui.debug(): | ||||
| def ctx2str(ctx): | def ctx2str(ctx): | ||||
| return ctx.hex() | return ctx.hex() | ||||
| node2str = hex | node2str = hex | ||||
| for rev in scmutil.revrange(repo, revs): | for rev in scmutil.revrange(repo, revs): | ||||
| ctx = repo[rev] | ctx = repo[rev] | ||||
| ui.write('%s\n'% ctx2str(ctx)) | ui.write('%s\n'% ctx2str(ctx)) | ||||
| for succsset in obsutil.successorssets(repo, ctx.node(), | for succsset in obsutil.successorssets(repo, ctx.node(), | ||||
| closest=opts['closest'], | closest=opts[r'closest'], | ||||
| cache=cache): | cache=cache): | ||||
| if succsset: | if succsset: | ||||
| ui.write(' ') | ui.write(' ') | ||||
| ui.write(node2str(succsset[0])) | ui.write(node2str(succsset[0])) | ||||
| for node in succsset[1:]: | for node in succsset[1:]: | ||||
| ui.write(' ') | ui.write(' ') | ||||
| ui.write(node2str(node)) | ui.write(node2str(node)) | ||||
| ui.write('\n') | ui.write('\n') | ||||
| opts = pycompat.byteskwargs(opts) | opts = pycompat.byteskwargs(opts) | ||||
| repo = hg.peer(ui, opts, repopath) | repo = hg.peer(ui, opts, repopath) | ||||
| for opt in cmdutil.remoteopts: | for opt in cmdutil.remoteopts: | ||||
| del opts[opt[1]] | del opts[opt[1]] | ||||
| args = {} | args = {} | ||||
| for k, v in opts.iteritems(): | for k, v in opts.iteritems(): | ||||
| if v: | if v: | ||||
| args[k] = v | args[k] = v | ||||
| args = pycompat.strkwargs(args) | |||||
| # run twice to check that we don't mess up the stream for the next command | # run twice to check that we don't mess up the stream for the next command | ||||
| res1 = repo.debugwireargs(*vals, **args) | res1 = repo.debugwireargs(*vals, **args) | ||||
| res2 = repo.debugwireargs(*vals, **args) | res2 = repo.debugwireargs(*vals, **args) | ||||
| ui.write("%s\n" % res1) | ui.write("%s\n" % res1) | ||||
| if res1 != res2: | if res1 != res2: | ||||
| ui.warn("%s\n" % res2) | ui.warn("%s\n" % res2) | ||||