Mercurial > public > mercurial-scm > hg
comparison mercurial/graphmod.py @ 10111:27457d31ae3f
cmdutil: replace sys.maxint with None as default value in loglimit
Semantically, it is better to use None over any other value when there is
"no value". Using maxint in this context is quite hackish, and is not forward
compatible.
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Mon, 14 Dec 2009 00:32:29 +0900 |
parents | 4c844f16bf39 |
children | d6512b3e9ac0 |
comparison
equal
deleted
inserted
replaced
10110:9ed13f718e53 | 10111:27457d31ae3f |
---|---|
15 The node and parent ids are arbitrary integers which identify a node in the | 15 The node and parent ids are arbitrary integers which identify a node in the |
16 context of the graph returned. Type is a constant specifying the node type. | 16 context of the graph returned. Type is a constant specifying the node type. |
17 Data depends on type. | 17 Data depends on type. |
18 """ | 18 """ |
19 | 19 |
20 import sys | |
21 from mercurial.node import nullrev | 20 from mercurial.node import nullrev |
22 | 21 |
23 CHANGESET = 'C' | 22 CHANGESET = 'C' |
24 | 23 |
25 def revisions(repo, start, stop): | 24 def revisions(repo, start, stop): |
35 ctx = repo[cur] | 34 ctx = repo[cur] |
36 parents = [p.rev() for p in ctx.parents() if p.rev() != nullrev] | 35 parents = [p.rev() for p in ctx.parents() if p.rev() != nullrev] |
37 yield (cur, CHANGESET, ctx, sorted(parents)) | 36 yield (cur, CHANGESET, ctx, sorted(parents)) |
38 cur -= 1 | 37 cur -= 1 |
39 | 38 |
40 def filerevs(repo, path, start, stop, limit=sys.maxint): | 39 def filerevs(repo, path, start, stop, limit=None): |
41 """file cset DAG generator yielding (id, CHANGESET, ctx, [parentids]) tuples | 40 """file cset DAG generator yielding (id, CHANGESET, ctx, [parentids]) tuples |
42 | 41 |
43 This generator function walks through the revision history of a single | 42 This generator function walks through the revision history of a single |
44 file from revision start down to revision stop. | 43 file from revision start down to revision stop. |
45 """ | 44 """ |