comparison hgext/graphlog.py @ 7374:ccec5ae82282

graphlog: kill whitespace from earlier refactoring
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Fri, 14 Nov 2008 18:34:47 +0100
parents 6ad2b914acbd
children ef22cb8896d6
comparison
equal deleted inserted replaced
7373:d9e9dd2b00fb 7374:ccec5ae82282
14 from mercurial.node import nullrev 14 from mercurial.node import nullrev
15 from mercurial.util import Abort, canonpath 15 from mercurial.util import Abort, canonpath
16 16
17 def revisions(repo, start, stop): 17 def revisions(repo, start, stop):
18 """cset DAG generator yielding (rev, node, [parents]) tuples 18 """cset DAG generator yielding (rev, node, [parents]) tuples
19 19
20 This generator function walks through the revision history from revision 20 This generator function walks through the revision history from revision
21 start to revision stop (which must be less than or equal to start). 21 start to revision stop (which must be less than or equal to start).
22 """ 22 """
23 assert start >= stop 23 assert start >= stop
24 cur = start 24 cur = start
28 yield (ctx, parents) 28 yield (ctx, parents)
29 cur -= 1 29 cur -= 1
30 30
31 def filerevs(repo, path, start, stop): 31 def filerevs(repo, path, start, stop):
32 """file cset DAG generator yielding (rev, node, [parents]) tuples 32 """file cset DAG generator yielding (rev, node, [parents]) tuples
33 33
34 This generator function walks through the revision history of a single 34 This generator function walks through the revision history of a single
35 file from revision start to revision stop (which must be less than or 35 file from revision start to revision stop (which must be less than or
36 equal to start). 36 equal to start).
37 """ 37 """
38 assert start >= stop 38 assert start >= stop
47 break 47 break
48 filerev -= 1 48 filerev -= 1
49 49
50 def grapher(nodes): 50 def grapher(nodes):
51 """grapher for asciigraph on a list of nodes and their parents 51 """grapher for asciigraph on a list of nodes and their parents
52 52
53 nodes must generate tuples (node, parents, char, lines) where 53 nodes must generate tuples (node, parents, char, lines) where
54
55 - parents must generate the parents of node, in sorted order, 54 - parents must generate the parents of node, in sorted order,
56 and max length 2, 55 and max length 2,
57 - char is the char to print as the node symbol, and 56 - char is the char to print as the node symbol, and
58 - lines are the lines to display next to the node. 57 - lines are the lines to display next to the node.
59 """ 58 """
60 seen = [] 59 seen = []
61 for node, parents, char, lines in nodes: 60 for node, parents, char, lines in nodes:
62 if node not in seen: 61 if node not in seen:
63 seen.append(node) 62 seen.append(node)