Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 3164:ff15ba23c1cf
localrepo.parents: return null context for no parents
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 29 Sep 2006 15:56:36 -0500 |
parents | 1605e336d229 |
children | 8d4855fd9d7b 53e843840349 |
comparison
equal
deleted
inserted
replaced
3163:1605e336d229 | 3164:ff15ba23c1cf |
---|---|
328 if changeid is None: | 328 if changeid is None: |
329 pl = self.dirstate.parents() | 329 pl = self.dirstate.parents() |
330 else: | 330 else: |
331 n = self.changelog.lookup(changeid) | 331 n = self.changelog.lookup(changeid) |
332 pl = self.changelog.parents(n) | 332 pl = self.changelog.parents(n) |
333 return [self.changectx(n) for n in pl if n != nullid] | 333 if pl[1] == nullid: |
334 return [self.changectx(pl[0])] | |
335 return [self.changectx(pl[0]), self.changectx(pl[1])] | |
334 | 336 |
335 def filectx(self, path, changeid=None, fileid=None): | 337 def filectx(self, path, changeid=None, fileid=None): |
336 """changeid can be a changeset revision, node, or tag. | 338 """changeid can be a changeset revision, node, or tag. |
337 fileid can be a file revision or node.""" | 339 fileid can be a file revision or node.""" |
338 return context.filectx(self, path, changeid, fileid) | 340 return context.filectx(self, path, changeid, fileid) |