diff options
author | Radomir Dopieralski <hatta-dev@sheep.art.pl> | 2010-07-17 11:09:01 (GMT) |
---|---|---|
committer | Radomir Dopieralski <hatta-dev@sheep.art.pl> | 2010-07-17 11:09:01 (GMT) |
commit | a849c28d5945a2ac59119b6428c12b7a897fe166 (patch) | |
tree | 018cc07e25ed3c2a8eb5afc20137d468e1f028e9 | |
parent | 6f04fcd96bb6fa10194fc133c4f4ff7d6db970db (diff) |
Tweak the revision finding code, add changectx.rev()==0 check thanks to Prologic
-rwxr-xr-x | hatta.py | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -631,16 +631,17 @@ class WikiStorage(object): """Find the last revision in which the file existed.""" repo_file = self._title_to_file(title) - changectx = self._changectx() - stack = [changectx] - while repo_file not in changectx: - if not stack: - return None + stack = [self._changectx()] + while stack: changectx = stack.pop() + if repo_file in changectx: + return changectx[repo_file] + if changectx.rev() == 0: + return None for parent in changectx.parents(): if parent != changectx: stack.append(parent) - return changectx[repo_file] + return None def page_history(self, title): """Iterate over the page's history.""" |