Show More
@@ -14,8 +14,8 b' revision graph is also shown.' | |||
|
14 | 14 | |
|
15 | 15 | from mercurial.cmdutil import show_changeset |
|
16 | 16 | from mercurial.i18n import _ |
|
17 |
from mercurial import cmdutil, commands, extensions |
|
|
18 |
from mercurial import hg, util, graphmod |
|
|
17 | from mercurial import cmdutil, commands, extensions | |
|
18 | from mercurial import hg, util, graphmod | |
|
19 | 19 | |
|
20 | 20 | cmdtable = {} |
|
21 | 21 | command = cmdutil.command(cmdtable) |
@@ -59,24 +59,7 b' def graphlog(ui, repo, *pats, **opts):' | |||
|
59 | 59 | Nodes printed as an @ character are parents of the working |
|
60 | 60 | directory. |
|
61 | 61 | """ |
|
62 | ||
|
63 | revs, expr, filematcher = cmdutil.getgraphlogrevs(repo, pats, opts) | |
|
64 | revs = sorted(revs, reverse=1) | |
|
65 | limit = cmdutil.loglimit(opts) | |
|
66 | if limit is not None: | |
|
67 | revs = revs[:limit] | |
|
68 | revdag = graphmod.dagwalker(repo, revs) | |
|
69 | ||
|
70 | getrenamed = None | |
|
71 | if opts.get('copies'): | |
|
72 | endrev = None | |
|
73 | if opts.get('rev'): | |
|
74 | endrev = max(scmutil.revrange(repo, opts.get('rev'))) + 1 | |
|
75 | getrenamed = templatekw.getrenamedfn(repo, endrev=endrev) | |
|
76 | displayer = show_changeset(ui, repo, opts, buffered=True) | |
|
77 | showparents = [ctx.node() for ctx in repo[None].parents()] | |
|
78 | cmdutil.displaygraph(ui, revdag, displayer, showparents, | |
|
79 | graphmod.asciiedges, getrenamed, filematcher) | |
|
62 | return cmdutil.graphlog(ui, repo, *pats, **opts) | |
|
80 | 63 | |
|
81 | 64 | def graphrevs(repo, nodes, opts): |
|
82 | 65 | limit = cmdutil.loglimit(opts) |
@@ -129,7 +112,6 b' def gincoming(ui, repo, source="default"' | |||
|
129 | 112 | |
|
130 | 113 | def uisetup(ui): |
|
131 | 114 | '''Initialize the extension.''' |
|
132 | _wrapcmd('log', commands.table, graphlog) | |
|
133 | 115 | _wrapcmd('incoming', commands.table, gincoming) |
|
134 | 116 | _wrapcmd('outgoing', commands.table, goutgoing) |
|
135 | 117 |
@@ -1430,6 +1430,26 b' def displaygraph(ui, dag, displayer, sho' | |||
|
1430 | 1430 | graphmod.ascii(ui, state, type, char, lines, coldata) |
|
1431 | 1431 | displayer.close() |
|
1432 | 1432 | |
|
1433 | def graphlog(ui, repo, *pats, **opts): | |
|
1434 | # Parameters are identical to log command ones | |
|
1435 | revs, expr, filematcher = getgraphlogrevs(repo, pats, opts) | |
|
1436 | revs = sorted(revs, reverse=1) | |
|
1437 | limit = loglimit(opts) | |
|
1438 | if limit is not None: | |
|
1439 | revs = revs[:limit] | |
|
1440 | revdag = graphmod.dagwalker(repo, revs) | |
|
1441 | ||
|
1442 | getrenamed = None | |
|
1443 | if opts.get('copies'): | |
|
1444 | endrev = None | |
|
1445 | if opts.get('rev'): | |
|
1446 | endrev = max(scmutil.revrange(repo, opts.get('rev'))) + 1 | |
|
1447 | getrenamed = templatekw.getrenamedfn(repo, endrev=endrev) | |
|
1448 | displayer = show_changeset(ui, repo, opts, buffered=True) | |
|
1449 | showparents = [ctx.node() for ctx in repo[None].parents()] | |
|
1450 | displaygraph(ui, revdag, displayer, showparents, | |
|
1451 | graphmod.asciiedges, getrenamed, filematcher) | |
|
1452 | ||
|
1433 | 1453 | def add(ui, repo, match, dryrun, listsubrepos, prefix, explicitonly): |
|
1434 | 1454 | join = lambda f: os.path.join(prefix, f) |
|
1435 | 1455 | bad = [] |
@@ -3928,6 +3928,7 b' def locate(ui, repo, *pats, **opts):' | |||
|
3928 | 3928 | ('P', 'prune', [], |
|
3929 | 3929 | _('do not display revision or any of its ancestors'), _('REV')), |
|
3930 | 3930 | ('', 'hidden', False, _('show hidden changesets (DEPRECATED)')), |
|
3931 | ('G', 'graph', None, _("show the revision DAG")), | |
|
3931 | 3932 | ] + logopts + walkopts, |
|
3932 | 3933 | _('[OPTION]... [FILE]')) |
|
3933 | 3934 | def log(ui, repo, *pats, **opts): |
@@ -4012,6 +4013,8 b' def log(ui, repo, *pats, **opts):' | |||
|
4012 | 4013 | |
|
4013 | 4014 | Returns 0 on success. |
|
4014 | 4015 | """ |
|
4016 | if opts.get('graph'): | |
|
4017 | return cmdutil.graphlog(ui, repo, *pats, **opts) | |
|
4015 | 4018 | |
|
4016 | 4019 | matchfn = scmutil.match(repo[None], pats, opts) |
|
4017 | 4020 | limit = cmdutil.loglimit(opts) |
@@ -199,7 +199,7 b' Show all commands + options' | |||
|
199 | 199 | export: output, switch-parent, rev, text, git, nodates |
|
200 | 200 | forget: include, exclude |
|
201 | 201 | init: ssh, remotecmd, insecure |
|
202 | log: follow, follow-first, date, copies, keyword, rev, removed, only-merges, user, only-branch, branch, prune, hidden, patch, git, limit, no-merges, stat, style, template, include, exclude | |
|
202 | log: follow, follow-first, date, copies, keyword, rev, removed, only-merges, user, only-branch, branch, prune, hidden, graph, patch, git, limit, no-merges, stat, style, template, include, exclude | |
|
203 | 203 | merge: force, rev, preview, tool |
|
204 | 204 | phase: public, draft, secret, force, rev |
|
205 | 205 | pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure |
General Comments 0
You need to be logged in to leave comments.
Login now