Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 17181:6f71167292f2
log: support --graph without graphlog extension
The glog command is preserved in the extension for backward compatibility.
author | Patrick Mezard <patrick@mezard.eu> |
---|---|
date | Sat, 14 Jul 2012 19:09:22 +0200 |
parents | ae0629161090 |
children | cdf1532d89c6 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Sat Jul 14 18:55:21 2012 +0200 +++ b/mercurial/cmdutil.py Sat Jul 14 19:09:22 2012 +0200 @@ -1430,6 +1430,26 @@ graphmod.ascii(ui, state, type, char, lines, coldata) displayer.close() +def graphlog(ui, repo, *pats, **opts): + # Parameters are identical to log command ones + revs, expr, filematcher = getgraphlogrevs(repo, pats, opts) + revs = sorted(revs, reverse=1) + limit = loglimit(opts) + if limit is not None: + revs = revs[:limit] + revdag = graphmod.dagwalker(repo, revs) + + getrenamed = None + if opts.get('copies'): + endrev = None + if opts.get('rev'): + endrev = max(scmutil.revrange(repo, opts.get('rev'))) + 1 + getrenamed = templatekw.getrenamedfn(repo, endrev=endrev) + displayer = show_changeset(ui, repo, opts, buffered=True) + showparents = [ctx.node() for ctx in repo[None].parents()] + displaygraph(ui, revdag, displayer, showparents, + graphmod.asciiedges, getrenamed, filematcher) + def add(ui, repo, match, dryrun, listsubrepos, prefix, explicitonly): join = lambda f: os.path.join(prefix, f) bad = []