Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 3163:1605e336d229
Add localrepo.parents to get parent changectxs.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 29 Sep 2006 15:48:16 -0500 |
parents | 81da3c45aabd |
children | ff15ba23c1cf |
comparison
equal
deleted
inserted
replaced
3162:a9e75b371315 | 3163:1605e336d229 |
---|---|
318 f = f[1:] | 318 f = f[1:] |
319 return filelog.filelog(self.opener, f, self.revlogversion) | 319 return filelog.filelog(self.opener, f, self.revlogversion) |
320 | 320 |
321 def changectx(self, changeid=None): | 321 def changectx(self, changeid=None): |
322 return context.changectx(self, changeid) | 322 return context.changectx(self, changeid) |
323 | |
324 def parents(self, changeid=None): | |
325 ''' | |
326 get list of changectxs for parents of changeid or working directory | |
327 ''' | |
328 if changeid is None: | |
329 pl = self.dirstate.parents() | |
330 else: | |
331 n = self.changelog.lookup(changeid) | |
332 pl = self.changelog.parents(n) | |
333 return [self.changectx(n) for n in pl if n != nullid] | |
323 | 334 |
324 def filectx(self, path, changeid=None, fileid=None): | 335 def filectx(self, path, changeid=None, fileid=None): |
325 """changeid can be a changeset revision, node, or tag. | 336 """changeid can be a changeset revision, node, or tag. |
326 fileid can be a file revision or node.""" | 337 fileid can be a file revision or node.""" |
327 return context.filectx(self, path, changeid, fileid) | 338 return context.filectx(self, path, changeid, fileid) |