Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 3242:1539f788e913
Make changectx.filenode raise repo.LookupError on failure
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Tue, 03 Oct 2006 12:28:27 -0700 |
parents | a184cd0c2db9 |
children | 45f0c49f0449 |
comparison
equal
deleted
inserted
replaced
3241:a184cd0c2db9 | 3242:1539f788e913 |
---|---|
71 c = self._repo.changelog.children(self._node) | 71 c = self._repo.changelog.children(self._node) |
72 return [ changectx(self._repo, x) for x in c ] | 72 return [ changectx(self._repo, x) for x in c ] |
73 | 73 |
74 def filenode(self, path): | 74 def filenode(self, path): |
75 if hasattr(self, "_manifest"): | 75 if hasattr(self, "_manifest"): |
76 return self._manifest[path] | 76 try: |
77 return self._manifest[path] | |
78 except KeyError: | |
79 raise repo.LookupError(_("'%s' not found in manifest") % path) | |
77 node, flag = self._repo.manifest.find(self._changeset[0], path) | 80 node, flag = self._repo.manifest.find(self._changeset[0], path) |
81 if not node: | |
82 raise repo.LookupError(_("'%s' not found in manifest") % path) | |
83 | |
78 return node | 84 return node |
79 | 85 |
80 def filectx(self, path, fileid=None): | 86 def filectx(self, path, fileid=None): |
81 """get a file context from this changeset""" | 87 """get a file context from this changeset""" |
82 if fileid is None: | 88 if fileid is None: |