comparison hgext/graphlog.py @ 14042:9966c95b8c4f

graphmod: use revsets internally Thanks for the idea and most of the implementation to Klaus Koch Backs revisions() and filerevs() with DAG walker which can iterate through arbitrary list of revisions instead of strict one by one iteration from start to stop. When a gap occurs in a revisions (i.e. in file log), the next topological parent within the revset is searched and the connection to it is printed in the ascii graph. File graph can draw sometimes more connections than previous version, because graph is produced according to the revset, not according to a file's filelog. In case the graph contains several branches where the left parent is null, the graphs for each are printed sequentially, not in parallel as it was a case earlier (see for example the graph for README in hg-dev).
author Alexander Solovyov <alexander@solovyov.net>
date Sun, 13 Mar 2011 15:53:38 +0100
parents bfeaa88b875d
children 1c1e1232abdc
comparison
equal deleted inserted replaced
14041:bcc6ed0f6c3b 14042:9966c95b8c4f
247 limit = cmdutil.loglimit(opts) 247 limit = cmdutil.loglimit(opts)
248 start, stop = get_revs(repo, opts["rev"]) 248 start, stop = get_revs(repo, opts["rev"])
249 if start == nullrev: 249 if start == nullrev:
250 return 250 return
251 251
252 if path:
253 path = scmutil.canonpath(repo.root, os.getcwd(), path)
254 if path: # could be reset in canonpath 252 if path: # could be reset in canonpath
255 revdag = graphmod.filerevs(repo, path, start, stop, limit) 253 revdag = graphmod.filerevs(repo, path, start, stop, limit)
256 else: 254 else:
257 if limit is not None: 255 if limit is not None:
258 stop = max(stop, start - limit + 1) 256 stop = max(stop, start - limit + 1)