##// END OF EJS Templates
log: factor out function to feed revisions to displayer
Yuya Nishihara -
r36216:7bc10d3f default
parent child Browse files
Show More
@@ -3434,22 +3434,10 b' def log(ui, repo, *pats, **opts):'
3434 3434 displayer = logcmdutil.changesetdisplayer(ui, repo, opts, differ,
3435 3435 buffered=True)
3436 3436 if opts.get('graph'):
3437 logcmdutil.graphlog(ui, repo, revs, displayer, getrenamed)
3438 return
3439
3440 for rev in revs:
3441 ctx = repo[rev]
3442 copies = None
3443 if getrenamed is not None and rev:
3444 copies = []
3445 for fn in ctx.files():
3446 rename = getrenamed(fn, rev)
3447 if rename:
3448 copies.append((fn, rename[0]))
3449 displayer.show(ctx, copies=copies)
3450 displayer.flush(ctx)
3451
3452 displayer.close()
3437 displayfn = logcmdutil.displaygraphrevs
3438 else:
3439 displayfn = logcmdutil.displayrevs
3440 displayfn(ui, repo, revs, displayer, getrenamed)
3453 3441
3454 3442 @command('manifest',
3455 3443 [('r', 'rev', '', _('revision to display'), _('REV')),
@@ -899,10 +899,24 b' def displaygraph(ui, repo, dag, displaye'
899 899 lines = []
900 900 displayer.close()
901 901
902 def graphlog(ui, repo, revs, displayer, getrenamed):
902 def displaygraphrevs(ui, repo, revs, displayer, getrenamed):
903 903 revdag = graphmod.dagwalker(repo, revs)
904 904 displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges, getrenamed)
905 905
906 def displayrevs(ui, repo, revs, displayer, getrenamed):
907 for rev in revs:
908 ctx = repo[rev]
909 copies = None
910 if getrenamed is not None and rev:
911 copies = []
912 for fn in ctx.files():
913 rename = getrenamed(fn, rev)
914 if rename:
915 copies.append((fn, rename[0]))
916 displayer.show(ctx, copies=copies)
917 displayer.flush(ctx)
918 displayer.close()
919
906 920 def checkunsupportedgraphflags(pats, opts):
907 921 for op in ["newest_first"]:
908 922 if op in opts and opts[op]:
General Comments 0
You need to be logged in to leave comments. Login now