comparison mercurial/logcmdutil.py @ 36196:1abf089a1d70

graphlog: deduplicate preprocessing of log command
author Yuya Nishihara <yuya@tcha.org>
date Sun, 21 Jan 2018 16:03:14 +0900
parents c1104fe76e69
children 7bc10d3f68b4
comparison
equal deleted inserted replaced
36195:513d268eddfe 36196:1abf089a1d70
897 for type, char, width, coldata in itertools.chain([firstedge], edges): 897 for type, char, width, coldata in itertools.chain([firstedge], edges):
898 graphmod.ascii(ui, state, type, char, lines, coldata) 898 graphmod.ascii(ui, state, type, char, lines, coldata)
899 lines = [] 899 lines = []
900 displayer.close() 900 displayer.close()
901 901
902 def graphlog(ui, repo, revs, differ, opts): 902 def graphlog(ui, repo, revs, displayer, getrenamed):
903 # Parameters are identical to log command ones
904 revdag = graphmod.dagwalker(repo, revs) 903 revdag = graphmod.dagwalker(repo, revs)
905
906 getrenamed = None
907 if opts.get('copies'):
908 endrev = None
909 if opts.get('rev'):
910 endrev = scmutil.revrange(repo, opts.get('rev')).max() + 1
911 getrenamed = templatekw.getrenamedfn(repo, endrev=endrev)
912
913 ui.pager('log')
914 displayer = changesetdisplayer(ui, repo, opts, differ, buffered=True)
915 displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges, getrenamed) 904 displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges, getrenamed)
916 905
917 def checkunsupportedgraphflags(pats, opts): 906 def checkunsupportedgraphflags(pats, opts):
918 for op in ["newest_first"]: 907 for op in ["newest_first"]:
919 if op in opts and opts[op]: 908 if op in opts and opts[op]: