comparison 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
comparison
equal deleted inserted replaced
17180:ae0629161090 17181:6f71167292f2
1428 edges = edgefn(type, char, lines, seen, rev, parents) 1428 edges = edgefn(type, char, lines, seen, rev, parents)
1429 for type, char, lines, coldata in edges: 1429 for type, char, lines, coldata in edges:
1430 graphmod.ascii(ui, state, type, char, lines, coldata) 1430 graphmod.ascii(ui, state, type, char, lines, coldata)
1431 displayer.close() 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 def add(ui, repo, match, dryrun, listsubrepos, prefix, explicitonly): 1453 def add(ui, repo, match, dryrun, listsubrepos, prefix, explicitonly):
1434 join = lambda f: os.path.join(prefix, f) 1454 join = lambda f: os.path.join(prefix, f)
1435 bad = [] 1455 bad = []
1436 oldbad = match.bad 1456 oldbad = match.bad
1437 match.bad = lambda x, y: bad.append(x) or oldbad(x, y) 1457 match.bad = lambda x, y: bad.append(x) or oldbad(x, y)