author | Paul Crowley <paul@lshift.net> |
Mon, 18 Apr 2011 11:13:23 +0100 | |
changeset 299 | f41666a08b87 |
parent 242 | 03d8f07230b3 |
child 376 | d503d5a786f3 |
permissions | -rw-r--r-- |
242
03d8f07230b3
Tidy up file prologues; move credits to CREDITS
Paul Crowley <paul@lshift.net>
parents:
67
diff
changeset
|
1 |
""" |
03d8f07230b3
Tidy up file prologues; move credits to CREDITS
Paul Crowley <paul@lshift.net>
parents:
67
diff
changeset
|
2 |
Find all the changes in a node in a way portable across Mercurial versions |
03d8f07230b3
Tidy up file prologues; move credits to CREDITS
Paul Crowley <paul@lshift.net>
parents:
67
diff
changeset
|
3 |
""" |
52
f9eb98bb0791
Encapsulate change finding with backwards compatibility
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
4 |
|
f9eb98bb0791
Encapsulate change finding with backwards compatibility
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
5 |
def changes(repo, node): |
f9eb98bb0791
Encapsulate change finding with backwards compatibility
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
6 |
start = repo.changectx(node).rev() |
f9eb98bb0791
Encapsulate change finding with backwards compatibility
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
7 |
try: |
f9eb98bb0791
Encapsulate change finding with backwards compatibility
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
8 |
end = len(repo.changelog) |
f9eb98bb0791
Encapsulate change finding with backwards compatibility
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
9 |
except: |
f9eb98bb0791
Encapsulate change finding with backwards compatibility
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
10 |
end = repo.changelog.count() |
f9eb98bb0791
Encapsulate change finding with backwards compatibility
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
11 |
for rev in xrange(start, end): |
f9eb98bb0791
Encapsulate change finding with backwards compatibility
Paul Crowley <paul@lshift.net>
parents:
diff
changeset
|
12 |
yield repo.changectx(rev) |