##// END OF EJS Templates
Make filectx.__init__ use LookupError
Brendan Cully -
r3227:618a7f2c default
parent child Browse files
Show More
@@ -8,7 +8,7 b''
8 from node import *
8 from node import *
9 from i18n import gettext as _
9 from i18n import gettext as _
10 from demandload import demandload
10 from demandload import demandload
11 demandload(globals(), "ancestor bdiff repo util")
11 demandload(globals(), "ancestor bdiff repo revlog util")
12
12
13 class changectx(object):
13 class changectx(object):
14 """A changecontext object makes access to data related to a particular
14 """A changecontext object makes access to data related to a particular
@@ -104,10 +104,10 b' class changectx(object):'
104 class filectx(object):
104 class filectx(object):
105 """A filecontext object makes access to data related to a particular
105 """A filecontext object makes access to data related to a particular
106 filerevision convenient."""
106 filerevision convenient."""
107 def __init__(self, repo, path, changeid=None, fileid=None, filelog=None):
107 def __init__(self, repo_, path, changeid=None, fileid=None, filelog=None):
108 """changeid can be a changeset revision, node, or tag.
108 """changeid can be a changeset revision, node, or tag.
109 fileid can be a file revision or node."""
109 fileid can be a file revision or node."""
110 self._repo = repo
110 self._repo = repo_
111 self._path = path
111 self._path = path
112
112
113 assert changeid is not None or fileid is not None
113 assert changeid is not None or fileid is not None
@@ -120,7 +120,10 b' class filectx(object):'
120 if fileid is None:
120 if fileid is None:
121 self._changeid = changeid
121 self._changeid = changeid
122 else:
122 else:
123 self._filenode = self._filelog.lookup(fileid)
123 try:
124 self._filenode = self._filelog.lookup(fileid)
125 except revlog.RevlogError, inst:
126 raise repo.LookupError(str(inst))
124 self._changeid = self._filelog.linkrev(self._filenode)
127 self._changeid = self._filelog.linkrev(self._filenode)
125
128
126 def __getattr__(self, name):
129 def __getattr__(self, name):
General Comments 0
You need to be logged in to leave comments. Login now