##// END OF EJS Templates
commitablefilectx: move parents from workingfilectx
Sean Farley -
r19704:bad0bd99 default
parent child Browse files
Show More
@@ -1205,24 +1205,6 b' class commitablefilectx(basefilectx):'
1205 def __nonzero__(self):
1205 def __nonzero__(self):
1206 return True
1206 return True
1207
1207
1208 class workingfilectx(commitablefilectx):
1209 """A workingfilectx object makes access to data related to a particular
1210 file in the working directory convenient."""
1211 def __init__(self, repo, path, filelog=None, workingctx=None):
1212 super(workingfilectx, self).__init__(repo, path, filelog, workingctx)
1213
1214 @propertycache
1215 def _changectx(self):
1216 return workingctx(self._repo)
1217
1218 def data(self):
1219 return self._repo.wread(self._path)
1220 def renamed(self):
1221 rp = self._repo.dirstate.copied(self._path)
1222 if not rp:
1223 return None
1224 return rp, self._changectx._parents[0]._manifest.get(rp, nullid)
1225
1226 def parents(self):
1208 def parents(self):
1227 '''return parent filectxs, following copies if necessary'''
1209 '''return parent filectxs, following copies if necessary'''
1228 def filenode(ctx, path):
1210 def filenode(ctx, path):
@@ -1244,6 +1226,24 b' class workingfilectx(commitablefilectx):'
1244 return [filectx(self._repo, p, fileid=n, filelog=l)
1226 return [filectx(self._repo, p, fileid=n, filelog=l)
1245 for p, n, l in pl if n != nullid]
1227 for p, n, l in pl if n != nullid]
1246
1228
1229 class workingfilectx(commitablefilectx):
1230 """A workingfilectx object makes access to data related to a particular
1231 file in the working directory convenient."""
1232 def __init__(self, repo, path, filelog=None, workingctx=None):
1233 super(workingfilectx, self).__init__(repo, path, filelog, workingctx)
1234
1235 @propertycache
1236 def _changectx(self):
1237 return workingctx(self._repo)
1238
1239 def data(self):
1240 return self._repo.wread(self._path)
1241 def renamed(self):
1242 rp = self._repo.dirstate.copied(self._path)
1243 if not rp:
1244 return None
1245 return rp, self._changectx._parents[0]._manifest.get(rp, nullid)
1246
1247 def children(self):
1247 def children(self):
1248 return []
1248 return []
1249
1249
General Comments 0
You need to be logged in to leave comments. Login now