Mercurial > public > mercurial-scm > hg-stable
diff mercurial/logcmdutil.py @ 36236:7bc10d3f68b4
log: factor out function to feed revisions to displayer
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 21 Jan 2018 16:15:20 +0900 |
parents | 1abf089a1d70 |
children | 27cd83152d31 |
line wrap: on
line diff
--- a/mercurial/logcmdutil.py Sun Jan 21 16:04:59 2018 +0900 +++ b/mercurial/logcmdutil.py Sun Jan 21 16:15:20 2018 +0900 @@ -899,10 +899,24 @@ lines = [] displayer.close() -def graphlog(ui, repo, revs, displayer, getrenamed): +def displaygraphrevs(ui, repo, revs, displayer, getrenamed): revdag = graphmod.dagwalker(repo, revs) displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges, getrenamed) +def displayrevs(ui, repo, revs, displayer, getrenamed): + for rev in revs: + ctx = repo[rev] + copies = None + if getrenamed is not None and rev: + copies = [] + for fn in ctx.files(): + rename = getrenamed(fn, rev) + if rename: + copies.append((fn, rename[0])) + displayer.show(ctx, copies=copies) + displayer.flush(ctx) + displayer.close() + def checkunsupportedgraphflags(pats, opts): for op in ["newest_first"]: if op in opts and opts[op]: