- """Find the last revision in which the file existed."""
- repo_file = self._title_to_file(title)
- changectx = self._changectx() # start with tip
- visited = set()
-
- stack = [changectx]
- visited.add(changectx)
-
- while repo_file not in changectx:
- if not stack:
+ """
+ Find the revision of the file in repo.
+ Only look for files still existing in repo's tip.
+ """
+ tip = self._changectx()
+ file = self._title_to_file(title)
+ logging.info('Looking for %s', file)
+ if file in tip:
+ fctx = tip[file]
+ else:
+ file = self._title_to_file(title, type='')
+ logging.info('.xml not found, trying plain')
+ if file in tip:
+ fctx = tip[file]
+ else: