Show More
@@ -300,8 +300,8 b' import time' | |||||
300 | from mercurial.i18n import _ |
|
300 | from mercurial.i18n import _ | |
301 | from mercurial.node import short |
|
301 | from mercurial.node import short | |
302 | from mercurial import ( |
|
302 | from mercurial import ( | |
303 | cmdutil, |
|
|||
304 | error, |
|
303 | error, | |
|
304 | logcmdutil, | |||
305 | mail, |
|
305 | mail, | |
306 | registrar, |
|
306 | registrar, | |
307 | url, |
|
307 | url, | |
@@ -1090,9 +1090,9 b' class bugzilla(object):' | |||||
1090 | if not mapfile and not tmpl: |
|
1090 | if not mapfile and not tmpl: | |
1091 | tmpl = _('changeset {node|short} in repo {root} refers ' |
|
1091 | tmpl = _('changeset {node|short} in repo {root} refers ' | |
1092 | 'to bug {bug}.\ndetails:\n\t{desc|tabindent}') |
|
1092 | 'to bug {bug}.\ndetails:\n\t{desc|tabindent}') | |
1093 |
spec = cmdutil. |
|
1093 | spec = logcmdutil.templatespec(tmpl, mapfile) | |
1094 |
t = cmdutil.changeset |
|
1094 | t = logcmdutil.changesettemplater(self.ui, self.repo, spec, | |
1095 | False, None, False) |
|
1095 | False, None, False) | |
1096 | self.ui.pushbuffer() |
|
1096 | self.ui.pushbuffer() | |
1097 | t.show(ctx, changes=ctx.changeset(), |
|
1097 | t.show(ctx, changes=ctx.changeset(), | |
1098 | bug=str(bugid), |
|
1098 | bug=str(bugid), |
@@ -19,6 +19,7 b' from __future__ import absolute_import' | |||||
19 | from mercurial.i18n import _ |
|
19 | from mercurial.i18n import _ | |
20 | from mercurial import ( |
|
20 | from mercurial import ( | |
21 | cmdutil, |
|
21 | cmdutil, | |
|
22 | logcmdutil, | |||
22 | pycompat, |
|
23 | pycompat, | |
23 | registrar, |
|
24 | registrar, | |
24 | ) |
|
25 | ) | |
@@ -65,7 +66,7 b' def children(ui, repo, file_=None, **opt' | |||||
65 | ctx = repo[rev] |
|
66 | ctx = repo[rev] | |
66 | childctxs = ctx.children() |
|
67 | childctxs = ctx.children() | |
67 |
|
68 | |||
68 |
displayer = cmdutil. |
|
69 | displayer = logcmdutil.changesetdisplayer(ui, repo, opts) | |
69 | for cctx in childctxs: |
|
70 | for cctx in childctxs: | |
70 | displayer.show(cctx) |
|
71 | displayer.show(cctx) | |
71 | displayer.close() |
|
72 | displayer.close() |
@@ -18,6 +18,7 b' from mercurial.i18n import _' | |||||
18 | from mercurial import ( |
|
18 | from mercurial import ( | |
19 | cmdutil, |
|
19 | cmdutil, | |
20 | encoding, |
|
20 | encoding, | |
|
21 | logcmdutil, | |||
21 | patch, |
|
22 | patch, | |
22 | pycompat, |
|
23 | pycompat, | |
23 | registrar, |
|
24 | registrar, | |
@@ -54,7 +55,7 b' def countrate(ui, repo, amap, *pats, **o' | |||||
54 | return date.strftime(opts['dateformat']) |
|
55 | return date.strftime(opts['dateformat']) | |
55 | else: |
|
56 | else: | |
56 | tmpl = opts.get('oldtemplate') or opts.get('template') |
|
57 | tmpl = opts.get('oldtemplate') or opts.get('template') | |
57 |
tmpl = cmdutil.make |
|
58 | tmpl = logcmdutil.maketemplater(ui, repo, tmpl) | |
58 | def getkey(ctx): |
|
59 | def getkey(ctx): | |
59 | ui.pushbuffer() |
|
60 | ui.pushbuffer() | |
60 | tmpl.show(ctx) |
|
61 | tmpl.show(ctx) |
@@ -29,6 +29,7 b' from mercurial import (' | |||||
29 | hg, |
|
29 | hg, | |
30 | localrepo, |
|
30 | localrepo, | |
31 | lock, |
|
31 | lock, | |
|
32 | logcmdutil, | |||
32 | node, |
|
33 | node, | |
33 | pycompat, |
|
34 | pycompat, | |
34 | registrar, |
|
35 | registrar, | |
@@ -478,7 +479,7 b' def journal(ui, repo, *args, **opts):' | |||||
478 | displayname = "'%s'" % name |
|
479 | displayname = "'%s'" % name | |
479 | ui.status(_("previous locations of %s:\n") % displayname) |
|
480 | ui.status(_("previous locations of %s:\n") % displayname) | |
480 |
|
481 | |||
481 |
limit = cmdutil. |
|
482 | limit = logcmdutil.getlimit(opts) | |
482 | entry = None |
|
483 | entry = None | |
483 | ui.pager('journal') |
|
484 | ui.pager('journal') | |
484 | for count, entry in enumerate(repo.journal.filtered(name=name)): |
|
485 | for count, entry in enumerate(repo.journal.filtered(name=name)): | |
@@ -502,7 +503,8 b' def journal(ui, repo, *args, **opts):' | |||||
502 | fm.write('command', ' %s\n', entry.command) |
|
503 | fm.write('command', ' %s\n', entry.command) | |
503 |
|
504 | |||
504 | if opts.get("commits"): |
|
505 | if opts.get("commits"): | |
505 |
displayer = cmdutil. |
|
506 | displayer = logcmdutil.changesetdisplayer(ui, repo, opts, | |
|
507 | buffered=False) | |||
506 | for hash in entry.newhashes: |
|
508 | for hash in entry.newhashes: | |
507 | try: |
|
509 | try: | |
508 | ctx = repo[hash] |
|
510 | ctx = repo[hash] |
@@ -101,6 +101,7 b' from mercurial import (' | |||||
101 | extensions, |
|
101 | extensions, | |
102 | filelog, |
|
102 | filelog, | |
103 | localrepo, |
|
103 | localrepo, | |
|
104 | logcmdutil, | |||
104 | match, |
|
105 | match, | |
105 | patch, |
|
106 | patch, | |
106 | pathutil, |
|
107 | pathutil, | |
@@ -254,7 +255,7 b' class kwtemplater(object):' | |||||
254 | '''Replaces keywords in data with expanded template.''' |
|
255 | '''Replaces keywords in data with expanded template.''' | |
255 | def kwsub(mobj): |
|
256 | def kwsub(mobj): | |
256 | kw = mobj.group(1) |
|
257 | kw = mobj.group(1) | |
257 |
ct = cmdutil.make |
|
258 | ct = logcmdutil.maketemplater(self.ui, self.repo, | |
258 | self.templates[kw]) |
|
259 | self.templates[kw]) | |
259 | self.ui.pushbuffer() |
|
260 | self.ui.pushbuffer() | |
260 | ct.show(ctx, root=self.repo.root, file=path) |
|
261 | ct.show(ctx, root=self.repo.root, file=path) |
@@ -86,6 +86,7 b' from mercurial import (' | |||||
86 | hg, |
|
86 | hg, | |
87 | localrepo, |
|
87 | localrepo, | |
88 | lock as lockmod, |
|
88 | lock as lockmod, | |
|
89 | logcmdutil, | |||
89 | patch as patchmod, |
|
90 | patch as patchmod, | |
90 | phases, |
|
91 | phases, | |
91 | pycompat, |
|
92 | pycompat, | |
@@ -743,8 +744,8 b' class queue(object):' | |||||
743 | opts = {} |
|
744 | opts = {} | |
744 | stat = opts.get('stat') |
|
745 | stat = opts.get('stat') | |
745 | m = scmutil.match(repo[node1], files, opts) |
|
746 | m = scmutil.match(repo[node1], files, opts) | |
746 |
cmdutil.diffordiffstat(self.ui, repo, diffopts, node1, node2, |
|
747 | logcmdutil.diffordiffstat(self.ui, repo, diffopts, node1, node2, m, | |
747 | changes, stat, fp) |
|
748 | changes, stat, fp) | |
748 |
|
749 | |||
749 | def mergeone(self, repo, mergeq, head, patch, rev, diffopts): |
|
750 | def mergeone(self, repo, mergeq, head, patch, rev, diffopts): | |
750 | # first try just applying the patch |
|
751 | # first try just applying the patch |
@@ -142,8 +142,8 b' import time' | |||||
142 |
|
142 | |||
143 | from mercurial.i18n import _ |
|
143 | from mercurial.i18n import _ | |
144 | from mercurial import ( |
|
144 | from mercurial import ( | |
145 | cmdutil, |
|
|||
146 | error, |
|
145 | error, | |
|
146 | logcmdutil, | |||
147 | mail, |
|
147 | mail, | |
148 | patch, |
|
148 | patch, | |
149 | registrar, |
|
149 | registrar, | |
@@ -257,9 +257,9 b' class notifier(object):' | |||||
257 | mapfile = self.ui.config('notify', 'style') |
|
257 | mapfile = self.ui.config('notify', 'style') | |
258 | if not mapfile and not template: |
|
258 | if not mapfile and not template: | |
259 | template = deftemplates.get(hooktype) or single_template |
|
259 | template = deftemplates.get(hooktype) or single_template | |
260 |
spec = cmdutil. |
|
260 | spec = logcmdutil.templatespec(template, mapfile) | |
261 |
self.t = cmdutil.changeset |
|
261 | self.t = logcmdutil.changesettemplater(self.ui, self.repo, spec, | |
262 | False, None, False) |
|
262 | False, None, False) | |
263 |
|
263 | |||
264 | def strip(self, path): |
|
264 | def strip(self, path): | |
265 | '''strip leading slashes from local path, turn into web-safe path.''' |
|
265 | '''strip leading slashes from local path, turn into web-safe path.''' |
@@ -39,6 +39,7 b' from mercurial import (' | |||||
39 | error, |
|
39 | error, | |
40 | formatter, |
|
40 | formatter, | |
41 | graphmod, |
|
41 | graphmod, | |
|
42 | logcmdutil, | |||
42 | phases, |
|
43 | phases, | |
43 | pycompat, |
|
44 | pycompat, | |
44 | registrar, |
|
45 | registrar, | |
@@ -148,7 +149,7 b' def show(ui, repo, view=None, template=N' | |||||
148 | elif fn._csettopic: |
|
149 | elif fn._csettopic: | |
149 | ref = 'show%s' % fn._csettopic |
|
150 | ref = 'show%s' % fn._csettopic | |
150 | spec = formatter.lookuptemplate(ui, ref, template) |
|
151 | spec = formatter.lookuptemplate(ui, ref, template) | |
151 |
displayer = cmdutil.changeset |
|
152 | displayer = logcmdutil.changesettemplater(ui, repo, spec, buffered=True) | |
152 | return fn(ui, repo, displayer) |
|
153 | return fn(ui, repo, displayer) | |
153 | else: |
|
154 | else: | |
154 | return fn(ui, repo) |
|
155 | return fn(ui, repo) | |
@@ -409,8 +410,8 b' def showwork(ui, repo, displayer):' | |||||
409 | revdag = graphmod.dagwalker(repo, revs) |
|
410 | revdag = graphmod.dagwalker(repo, revs) | |
410 |
|
411 | |||
411 | ui.setconfig('experimental', 'graphshorten', True) |
|
412 | ui.setconfig('experimental', 'graphshorten', True) | |
412 | cmdutil.displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges, |
|
413 | logcmdutil.displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges, | |
413 | props={'nodelen': nodelen}) |
|
414 | props={'nodelen': nodelen}) | |
414 |
|
415 | |||
415 | def extsetup(ui): |
|
416 | def extsetup(ui): | |
416 | # Alias `hg <prefix><view>` to `hg show <view>`. |
|
417 | # Alias `hg <prefix><view>` to `hg show <view>`. |
@@ -24,6 +24,7 b' from mercurial import (' | |||||
24 | error, |
|
24 | error, | |
25 | exchange, |
|
25 | exchange, | |
26 | hg, |
|
26 | hg, | |
|
27 | logcmdutil, | |||
27 | match, |
|
28 | match, | |
28 | merge, |
|
29 | merge, | |
29 | node as nodemod, |
|
30 | node as nodemod, | |
@@ -501,7 +502,7 b' def hasnode(repo, node):' | |||||
501 |
|
502 | |||
502 | def browserevs(ui, repo, nodes, opts): |
|
503 | def browserevs(ui, repo, nodes, opts): | |
503 | '''interactively transplant changesets''' |
|
504 | '''interactively transplant changesets''' | |
504 |
displayer = cmdutil. |
|
505 | displayer = logcmdutil.changesetdisplayer(ui, repo, opts) | |
505 | transplants = [] |
|
506 | transplants = [] | |
506 | merges = [] |
|
507 | merges = [] | |
507 | prompt = _('apply changeset? [ynmpcq?]:' |
|
508 | prompt = _('apply changeset? [ynmpcq?]:' |
@@ -46,22 +46,6 b' from . import (' | |||||
46 | ) |
|
46 | ) | |
47 | stringio = util.stringio |
|
47 | stringio = util.stringio | |
48 |
|
48 | |||
49 | loglimit = logcmdutil.getlimit |
|
|||
50 | diffordiffstat = logcmdutil.diffordiffstat |
|
|||
51 | _changesetlabels = logcmdutil.changesetlabels |
|
|||
52 | changeset_printer = logcmdutil.changesetprinter |
|
|||
53 | jsonchangeset = logcmdutil.jsonchangeset |
|
|||
54 | changeset_templater = logcmdutil.changesettemplater |
|
|||
55 | logtemplatespec = logcmdutil.templatespec |
|
|||
56 | makelogtemplater = logcmdutil.maketemplater |
|
|||
57 | show_changeset = logcmdutil.changesetdisplayer |
|
|||
58 | getlogrevs = logcmdutil.getrevs |
|
|||
59 | getloglinerangerevs = logcmdutil.getlinerangerevs |
|
|||
60 | displaygraph = logcmdutil.displaygraph |
|
|||
61 | graphlog = logcmdutil.graphlog |
|
|||
62 | checkunsupportedgraphflags = logcmdutil.checkunsupportedgraphflags |
|
|||
63 | graphrevs = logcmdutil.graphrevs |
|
|||
64 |
|
||||
65 | # templates of common command options |
|
49 | # templates of common command options | |
66 |
|
50 | |||
67 | dryrunopts = [ |
|
51 | dryrunopts = [ | |
@@ -2526,7 +2510,7 b' def commitforceeditor(repo, ctx, subs, f' | |||||
2526 | def buildcommittemplate(repo, ctx, subs, extramsg, ref): |
|
2510 | def buildcommittemplate(repo, ctx, subs, extramsg, ref): | |
2527 | ui = repo.ui |
|
2511 | ui = repo.ui | |
2528 | spec = formatter.templatespec(ref, None, None) |
|
2512 | spec = formatter.templatespec(ref, None, None) | |
2529 |
t = changeset |
|
2513 | t = logcmdutil.changesettemplater(ui, repo, spec, None, {}, False) | |
2530 | t.t.cache.update((k, templater.unquotestring(v)) |
|
2514 | t.t.cache.update((k, templater.unquotestring(v)) | |
2531 | for k, v in repo.ui.configitems('committemplate')) |
|
2515 | for k, v in repo.ui.configitems('committemplate')) | |
2532 |
|
2516 |
@@ -41,6 +41,7 b' from . import (' | |||||
41 | help, |
|
41 | help, | |
42 | hg, |
|
42 | hg, | |
43 | lock as lockmod, |
|
43 | lock as lockmod, | |
|
44 | logcmdutil, | |||
44 | merge as mergemod, |
|
45 | merge as mergemod, | |
45 | obsolete, |
|
46 | obsolete, | |
46 | obsutil, |
|
47 | obsutil, | |
@@ -823,7 +824,7 b' def bisect(ui, repo, rev=None, extra=Non' | |||||
823 | cmdutil.bailifchanged(repo) |
|
824 | cmdutil.bailifchanged(repo) | |
824 | return hg.clean(repo, node, show_stats=show_stats) |
|
825 | return hg.clean(repo, node, show_stats=show_stats) | |
825 |
|
826 | |||
826 |
displayer = cmdutil. |
|
827 | displayer = logcmdutil.changesetdisplayer(ui, repo, {}) | |
827 |
|
828 | |||
828 | if command: |
|
829 | if command: | |
829 | changesets = 1 |
|
830 | changesets = 1 | |
@@ -1873,9 +1874,9 b' def diff(ui, repo, *pats, **opts):' | |||||
1873 | diffopts = patch.diffallopts(ui, opts) |
|
1874 | diffopts = patch.diffallopts(ui, opts) | |
1874 | m = scmutil.match(repo[node2], pats, opts) |
|
1875 | m = scmutil.match(repo[node2], pats, opts) | |
1875 | ui.pager('diff') |
|
1876 | ui.pager('diff') | |
1876 | cmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat, |
|
1877 | logcmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat, | |
1877 | listsubrepos=opts.get('subrepos'), |
|
1878 | listsubrepos=opts.get('subrepos'), | |
1878 | root=opts.get('root')) |
|
1879 | root=opts.get('root')) | |
1879 |
|
1880 | |||
1880 | @command('^export', |
|
1881 | @command('^export', | |
1881 | [('o', 'output', '', |
|
1882 | [('o', 'output', '', | |
@@ -2647,7 +2648,7 b' def heads(ui, repo, *branchrevs, **opts)' | |||||
2647 |
|
2648 | |||
2648 | ui.pager('heads') |
|
2649 | ui.pager('heads') | |
2649 | heads = sorted(heads, key=lambda x: -x.rev()) |
|
2650 | heads = sorted(heads, key=lambda x: -x.rev()) | |
2650 |
displayer = cmdutil. |
|
2651 | displayer = logcmdutil.changesetdisplayer(ui, repo, opts) | |
2651 | for ctx in heads: |
|
2652 | for ctx in heads: | |
2652 | displayer.show(ctx) |
|
2653 | displayer.show(ctx) | |
2653 | displayer.close() |
|
2654 | displayer.close() | |
@@ -3155,11 +3156,11 b' def incoming(ui, repo, source="default",' | |||||
3155 | """ |
|
3156 | """ | |
3156 | opts = pycompat.byteskwargs(opts) |
|
3157 | opts = pycompat.byteskwargs(opts) | |
3157 | if opts.get('graph'): |
|
3158 | if opts.get('graph'): | |
3158 | cmdutil.checkunsupportedgraphflags([], opts) |
|
3159 | logcmdutil.checkunsupportedgraphflags([], opts) | |
3159 | def display(other, chlist, displayer): |
|
3160 | def display(other, chlist, displayer): | |
3160 | revdag = cmdutil.graphrevs(other, chlist, opts) |
|
3161 | revdag = logcmdutil.graphrevs(other, chlist, opts) | |
3161 | cmdutil.displaygraph(ui, repo, revdag, displayer, |
|
3162 | logcmdutil.displaygraph(ui, repo, revdag, displayer, | |
3162 | graphmod.asciiedges) |
|
3163 | graphmod.asciiedges) | |
3163 |
|
3164 | |||
3164 | hg._incoming(display, lambda: 1, ui, repo, source, opts, buffered=True) |
|
3165 | hg._incoming(display, lambda: 1, ui, repo, source, opts, buffered=True) | |
3165 | return 0 |
|
3166 | return 0 | |
@@ -3418,16 +3419,16 b' def log(ui, repo, *pats, **opts):' | |||||
3418 | ) |
|
3419 | ) | |
3419 |
|
3420 | |||
3420 | repo = scmutil.unhidehashlikerevs(repo, opts.get('rev'), 'nowarn') |
|
3421 | repo = scmutil.unhidehashlikerevs(repo, opts.get('rev'), 'nowarn') | |
3421 |
revs, filematcher = cmdutil.get |
|
3422 | revs, filematcher = logcmdutil.getrevs(repo, pats, opts) | |
3422 | hunksfilter = None |
|
3423 | hunksfilter = None | |
3423 |
|
3424 | |||
3424 | if opts.get('graph'): |
|
3425 | if opts.get('graph'): | |
3425 | if linerange: |
|
3426 | if linerange: | |
3426 | raise error.Abort(_('graph not supported with line range patterns')) |
|
3427 | raise error.Abort(_('graph not supported with line range patterns')) | |
3427 | return cmdutil.graphlog(ui, repo, revs, filematcher, opts) |
|
3428 | return logcmdutil.graphlog(ui, repo, revs, filematcher, opts) | |
3428 |
|
3429 | |||
3429 | if linerange: |
|
3430 | if linerange: | |
3430 |
revs, lrfilematcher, hunksfilter = cmdutil.getl |
|
3431 | revs, lrfilematcher, hunksfilter = logcmdutil.getlinerangerevs( | |
3431 | repo, revs, opts) |
|
3432 | repo, revs, opts) | |
3432 |
|
3433 | |||
3433 | if filematcher is not None and lrfilematcher is not None: |
|
3434 | if filematcher is not None and lrfilematcher is not None: | |
@@ -3449,7 +3450,7 b' def log(ui, repo, *pats, **opts):' | |||||
3449 | getrenamed = templatekw.getrenamedfn(repo, endrev=endrev) |
|
3450 | getrenamed = templatekw.getrenamedfn(repo, endrev=endrev) | |
3450 |
|
3451 | |||
3451 | ui.pager('log') |
|
3452 | ui.pager('log') | |
3452 |
displayer = cmdutil. |
|
3453 | displayer = logcmdutil.changesetdisplayer(ui, repo, opts, buffered=True) | |
3453 | for rev in revs: |
|
3454 | for rev in revs: | |
3454 | ctx = repo[rev] |
|
3455 | ctx = repo[rev] | |
3455 | copies = None |
|
3456 | copies = None | |
@@ -3603,7 +3604,7 b' def merge(ui, repo, node=None, **opts):' | |||||
3603 | p2 = repo.lookup(node) |
|
3604 | p2 = repo.lookup(node) | |
3604 | nodes = repo.changelog.findmissing(common=[p1], heads=[p2]) |
|
3605 | nodes = repo.changelog.findmissing(common=[p1], heads=[p2]) | |
3605 |
|
3606 | |||
3606 |
displayer = cmdutil. |
|
3607 | displayer = logcmdutil.changesetdisplayer(ui, repo, opts) | |
3607 | for node in nodes: |
|
3608 | for node in nodes: | |
3608 | displayer.show(repo[node]) |
|
3609 | displayer.show(repo[node]) | |
3609 | displayer.close() |
|
3610 | displayer.close() | |
@@ -3667,16 +3668,17 b' def outgoing(ui, repo, dest=None, **opts' | |||||
3667 | """ |
|
3668 | """ | |
3668 | opts = pycompat.byteskwargs(opts) |
|
3669 | opts = pycompat.byteskwargs(opts) | |
3669 | if opts.get('graph'): |
|
3670 | if opts.get('graph'): | |
3670 | cmdutil.checkunsupportedgraphflags([], opts) |
|
3671 | logcmdutil.checkunsupportedgraphflags([], opts) | |
3671 | o, other = hg._outgoing(ui, repo, dest, opts) |
|
3672 | o, other = hg._outgoing(ui, repo, dest, opts) | |
3672 | if not o: |
|
3673 | if not o: | |
3673 | cmdutil.outgoinghooks(ui, repo, other, opts, o) |
|
3674 | cmdutil.outgoinghooks(ui, repo, other, opts, o) | |
3674 | return |
|
3675 | return | |
3675 |
|
3676 | |||
3676 | revdag = cmdutil.graphrevs(repo, o, opts) |
|
3677 | revdag = logcmdutil.graphrevs(repo, o, opts) | |
3677 | ui.pager('outgoing') |
|
3678 | ui.pager('outgoing') | |
3678 |
displayer = cmdutil. |
|
3679 | displayer = logcmdutil.changesetdisplayer(ui, repo, opts, buffered=True) | |
3679 |
cmdutil.displaygraph(ui, repo, revdag, displayer, |
|
3680 | logcmdutil.displaygraph(ui, repo, revdag, displayer, | |
|
3681 | graphmod.asciiedges) | |||
3680 | cmdutil.outgoinghooks(ui, repo, other, opts, o) |
|
3682 | cmdutil.outgoinghooks(ui, repo, other, opts, o) | |
3681 | return 0 |
|
3683 | return 0 | |
3682 |
|
3684 | |||
@@ -3751,7 +3753,7 b' def parents(ui, repo, file_=None, **opts' | |||||
3751 | else: |
|
3753 | else: | |
3752 | p = [cp.node() for cp in ctx.parents()] |
|
3754 | p = [cp.node() for cp in ctx.parents()] | |
3753 |
|
3755 | |||
3754 |
displayer = cmdutil. |
|
3756 | displayer = logcmdutil.changesetdisplayer(ui, repo, opts) | |
3755 | for n in p: |
|
3757 | for n in p: | |
3756 | if n != nullid: |
|
3758 | if n != nullid: | |
3757 | displayer.show(repo[n]) |
|
3759 | displayer.show(repo[n]) | |
@@ -4983,7 +4985,7 b' def summary(ui, repo, **opts):' | |||||
4983 | # shows a working directory parent *changeset*: |
|
4985 | # shows a working directory parent *changeset*: | |
4984 | # i18n: column positioning for "hg summary" |
|
4986 | # i18n: column positioning for "hg summary" | |
4985 | ui.write(_('parent: %d:%s ') % (p.rev(), p), |
|
4987 | ui.write(_('parent: %d:%s ') % (p.rev(), p), | |
4986 |
label=cmdutil. |
|
4988 | label=logcmdutil.changesetlabels(p)) | |
4987 | ui.write(' '.join(p.tags()), label='log.tag') |
|
4989 | ui.write(' '.join(p.tags()), label='log.tag') | |
4988 | if p.bookmarks(): |
|
4990 | if p.bookmarks(): | |
4989 | marks.extend(p.bookmarks()) |
|
4991 | marks.extend(p.bookmarks()) | |
@@ -5405,7 +5407,7 b' def tip(ui, repo, **opts):' | |||||
5405 | Returns 0 on success. |
|
5407 | Returns 0 on success. | |
5406 | """ |
|
5408 | """ | |
5407 | opts = pycompat.byteskwargs(opts) |
|
5409 | opts = pycompat.byteskwargs(opts) | |
5408 |
displayer = cmdutil. |
|
5410 | displayer = logcmdutil.changesetdisplayer(ui, repo, opts) | |
5409 | displayer.show(repo['tip']) |
|
5411 | displayer.show(repo['tip']) | |
5410 | displayer.close() |
|
5412 | displayer.close() | |
5411 |
|
5413 |
@@ -48,6 +48,7 b' from . import (' | |||||
48 | hg, |
|
48 | hg, | |
49 | localrepo, |
|
49 | localrepo, | |
50 | lock as lockmod, |
|
50 | lock as lockmod, | |
|
51 | logcmdutil, | |||
51 | merge as mergemod, |
|
52 | merge as mergemod, | |
52 | obsolete, |
|
53 | obsolete, | |
53 | obsutil, |
|
54 | obsutil, | |
@@ -2396,7 +2397,7 b' def debugtemplate(ui, repo, tmpl, **opts' | |||||
2396 | t = formatter.maketemplater(ui, tmpl, resources=tres) |
|
2397 | t = formatter.maketemplater(ui, tmpl, resources=tres) | |
2397 | ui.write(t.render(props)) |
|
2398 | ui.write(t.render(props)) | |
2398 | else: |
|
2399 | else: | |
2399 |
displayer = cmdutil.make |
|
2400 | displayer = logcmdutil.maketemplater(ui, repo, tmpl) | |
2400 | for r in revs: |
|
2401 | for r in revs: | |
2401 | displayer.show(repo[r], **pycompat.strkwargs(props)) |
|
2402 | displayer.show(repo[r], **pycompat.strkwargs(props)) | |
2402 | displayer.close() |
|
2403 | displayer.close() |
@@ -31,6 +31,7 b' from . import (' | |||||
31 | httppeer, |
|
31 | httppeer, | |
32 | localrepo, |
|
32 | localrepo, | |
33 | lock, |
|
33 | lock, | |
|
34 | logcmdutil, | |||
34 | logexchange, |
|
35 | logexchange, | |
35 | merge as mergemod, |
|
36 | merge as mergemod, | |
36 | node, |
|
37 | node, | |
@@ -885,7 +886,7 b' def _incoming(displaychlist, subreporecu' | |||||
885 | ui.status(_("no changes found\n")) |
|
886 | ui.status(_("no changes found\n")) | |
886 | return subreporecurse() |
|
887 | return subreporecurse() | |
887 | ui.pager('incoming') |
|
888 | ui.pager('incoming') | |
888 |
displayer = cmdutil. |
|
889 | displayer = logcmdutil.changesetdisplayer(ui, other, opts, buffered) | |
889 | displaychlist(other, chlist, displayer) |
|
890 | displaychlist(other, chlist, displayer) | |
890 | displayer.close() |
|
891 | displayer.close() | |
891 | finally: |
|
892 | finally: | |
@@ -904,7 +905,7 b' def incoming(ui, repo, source, opts):' | |||||
904 | return ret |
|
905 | return ret | |
905 |
|
906 | |||
906 | def display(other, chlist, displayer): |
|
907 | def display(other, chlist, displayer): | |
907 |
limit = cmdutil. |
|
908 | limit = logcmdutil.getlimit(opts) | |
908 | if opts.get('newest_first'): |
|
909 | if opts.get('newest_first'): | |
909 | chlist.reverse() |
|
910 | chlist.reverse() | |
910 | count = 0 |
|
911 | count = 0 | |
@@ -949,7 +950,7 b' def outgoing(ui, repo, dest, opts):' | |||||
949 | ret = min(ret, sub.outgoing(ui, dest, opts)) |
|
950 | ret = min(ret, sub.outgoing(ui, dest, opts)) | |
950 | return ret |
|
951 | return ret | |
951 |
|
952 | |||
952 |
limit = cmdutil. |
|
953 | limit = logcmdutil.getlimit(opts) | |
953 | o, other = _outgoing(ui, repo, dest, opts) |
|
954 | o, other = _outgoing(ui, repo, dest, opts) | |
954 | if not o: |
|
955 | if not o: | |
955 | cmdutil.outgoinghooks(ui, repo, other, opts, o) |
|
956 | cmdutil.outgoinghooks(ui, repo, other, opts, o) | |
@@ -958,7 +959,7 b' def outgoing(ui, repo, dest, opts):' | |||||
958 | if opts.get('newest_first'): |
|
959 | if opts.get('newest_first'): | |
959 | o.reverse() |
|
960 | o.reverse() | |
960 | ui.pager('outgoing') |
|
961 | ui.pager('outgoing') | |
961 |
displayer = cmdutil. |
|
962 | displayer = logcmdutil.changesetdisplayer(ui, repo, opts) | |
962 | count = 0 |
|
963 | count = 0 | |
963 | for n in o: |
|
964 | for n in o: | |
964 | if limit is not None and count >= limit: |
|
965 | if limit is not None and count >= limit: |
@@ -2342,7 +2342,7 b' def diff(repo, node1=None, node2=None, m' | |||||
2342 | if hunksfilterfn is not None: |
|
2342 | if hunksfilterfn is not None: | |
2343 | # If the file has been removed, fctx2 is None; but this should |
|
2343 | # If the file has been removed, fctx2 is None; but this should | |
2344 | # not occur here since we catch removed files early in |
|
2344 | # not occur here since we catch removed files early in | |
2345 |
# cmdutil.get |
|
2345 | # logcmdutil.getlinerangerevs() for 'hg log -L'. | |
2346 | assert fctx2 is not None, \ |
|
2346 | assert fctx2 is not None, \ | |
2347 | 'fctx2 unexpectly None in diff hunks filtering' |
|
2347 | 'fctx2 unexpectly None in diff hunks filtering' | |
2348 | hunks = hunksfilterfn(fctx2, hunks) |
|
2348 | hunks = hunksfilterfn(fctx2, hunks) |
@@ -411,7 +411,7 b' def intrev(ctx):' | |||||
411 |
|
411 | |||
412 | def formatchangeid(ctx): |
|
412 | def formatchangeid(ctx): | |
413 | """Format changectx as '{rev}:{node|formatnode}', which is the default |
|
413 | """Format changectx as '{rev}:{node|formatnode}', which is the default | |
414 |
template provided by cmdutil.changeset |
|
414 | template provided by logcmdutil.changesettemplater""" | |
415 | repo = ctx.repo() |
|
415 | repo = ctx.repo() | |
416 | return formatrevnode(repo.ui, intrev(ctx), binnode(ctx)) |
|
416 | return formatrevnode(repo.ui, intrev(ctx), binnode(ctx)) | |
417 |
|
417 |
@@ -28,6 +28,7 b' from . import (' | |||||
28 | error, |
|
28 | error, | |
29 | exchange, |
|
29 | exchange, | |
30 | filemerge, |
|
30 | filemerge, | |
|
31 | logcmdutil, | |||
31 | match as matchmod, |
|
32 | match as matchmod, | |
32 | node, |
|
33 | node, | |
33 | pathutil, |
|
34 | pathutil, | |
@@ -907,10 +908,10 b' class hgsubrepo(abstractsubrepo):' | |||||
907 | # in hex format |
|
908 | # in hex format | |
908 | if node2 is not None: |
|
909 | if node2 is not None: | |
909 | node2 = node.bin(node2) |
|
910 | node2 = node.bin(node2) | |
910 | cmdutil.diffordiffstat(ui, self._repo, diffopts, |
|
911 | logcmdutil.diffordiffstat(ui, self._repo, diffopts, | |
911 | node1, node2, match, |
|
912 | node1, node2, match, | |
912 | prefix=posixpath.join(prefix, self._path), |
|
913 | prefix=posixpath.join(prefix, self._path), | |
913 | listsubrepos=True, **opts) |
|
914 | listsubrepos=True, **opts) | |
914 | except error.RepoLookupError as inst: |
|
915 | except error.RepoLookupError as inst: | |
915 | self.ui.warn(_('warning: error "%s" in subrepository "%s"\n') |
|
916 | self.ui.warn(_('warning: error "%s" in subrepository "%s"\n') | |
916 | % (inst, subrelpath(self))) |
|
917 | % (inst, subrelpath(self))) |
@@ -917,7 +917,7 b' def showinstabilities(**args):' | |||||
917 | def showverbosity(ui, **args): |
|
917 | def showverbosity(ui, **args): | |
918 | """String. The current output verbosity in 'debug', 'quiet', 'verbose', |
|
918 | """String. The current output verbosity in 'debug', 'quiet', 'verbose', | |
919 | or ''.""" |
|
919 | or ''.""" | |
920 |
# see cmdutil.changeset |
|
920 | # see logcmdutil.changesettemplater for priority of these flags | |
921 | if ui.debugflag: |
|
921 | if ui.debugflag: | |
922 | return 'debug' |
|
922 | return 'debug' | |
923 | elif ui.quiet: |
|
923 | elif ui.quiet: |
@@ -115,7 +115,7 b' o (0) root' | |||||
115 | > ui.write(smartset.prettyformat(revs) + '\n') |
|
115 | > ui.write(smartset.prettyformat(revs) + '\n') | |
116 | > revs = smartset.baseset() # display no revisions |
|
116 | > revs = smartset.baseset() # display no revisions | |
117 | > return revs, filematcher |
|
117 | > return revs, filematcher | |
118 |
> extensions.wrapfunction(cmdutil, 'get |
|
118 | > extensions.wrapfunction(logcmdutil, 'getrevs', printrevset) | |
119 | > aliases, entry = cmdutil.findcmd('log', commands.table) |
|
119 | > aliases, entry = cmdutil.findcmd('log', commands.table) | |
120 | > entry[1].append(('', 'print-revset', False, |
|
120 | > entry[1].append(('', 'print-revset', False, | |
121 | > 'print generated revset and exit (DEPRECATED)')) |
|
121 | > 'print generated revset and exit (DEPRECATED)')) | |
@@ -2421,7 +2421,7 b' working-directory revision' | |||||
2421 | | |
|
2421 | | | |
2422 | ~ |
|
2422 | ~ | |
2423 |
|
2423 | |||
2424 |
node template with changeset |
|
2424 | node template with changesetprinter: | |
2425 |
|
2425 | |||
2426 | $ hg log -Gqr 5:7 --config ui.graphnodetemplate='"{rev}"' |
|
2426 | $ hg log -Gqr 5:7 --config ui.graphnodetemplate='"{rev}"' | |
2427 | 7 7:02dbb8e276b8 |
|
2427 | 7 7:02dbb8e276b8 | |
@@ -2433,7 +2433,7 b' node template with changeset_printer:' | |||||
2433 | | |
|
2433 | | | |
2434 | ~ |
|
2434 | ~ | |
2435 |
|
2435 | |||
2436 |
node template with changeset |
|
2436 | node template with changesettemplater (shared cache variable): | |
2437 |
|
2437 | |||
2438 | $ hg log -Gr 5:7 -T '{latesttag % "{rev} {tag}+{distance}"}\n' \ |
|
2438 | $ hg log -Gr 5:7 -T '{latesttag % "{rev} {tag}+{distance}"}\n' \ | |
2439 | > --config ui.graphnodetemplate='{ifeq(latesttagdistance, 0, "#", graphnode)}' |
|
2439 | > --config ui.graphnodetemplate='{ifeq(latesttagdistance, 0, "#", graphnode)}' |
@@ -4,8 +4,8 b' Test hg log changeset printer external h' | |||||
4 | $ cat > $TESTTMP/logexthook.py <<EOF |
|
4 | $ cat > $TESTTMP/logexthook.py <<EOF | |
5 | > from __future__ import absolute_import |
|
5 | > from __future__ import absolute_import | |
6 | > from mercurial import ( |
|
6 | > from mercurial import ( | |
7 | > cmdutil, |
|
|||
8 | > commands, |
|
7 | > commands, | |
|
8 | > logcmdutil, | |||
9 | > repair, |
|
9 | > repair, | |
10 | > ) |
|
10 | > ) | |
11 | > def rot13description(self, ctx): |
|
11 | > def rot13description(self, ctx): | |
@@ -13,7 +13,7 b' Test hg log changeset printer external h' | |||||
13 | > description = ctx.description().strip().splitlines()[0].encode('rot13') |
|
13 | > description = ctx.description().strip().splitlines()[0].encode('rot13') | |
14 | > self.ui.write("%s: %s\n" % (summary, description)) |
|
14 | > self.ui.write("%s: %s\n" % (summary, description)) | |
15 | > def reposetup(ui, repo): |
|
15 | > def reposetup(ui, repo): | |
16 |
> cmdutil.changeset |
|
16 | > logcmdutil.changesetprinter._exthook = rot13description | |
17 | > EOF |
|
17 | > EOF | |
18 |
|
18 | |||
19 | Prepare the repository |
|
19 | Prepare the repository |
General Comments 0
You need to be logged in to leave comments.
Login now