changeset 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 e78185746554
files mercurial/localrepo.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Fri Sep 29 15:48:16 2006 -0500
+++ b/mercurial/localrepo.py	Fri Sep 29 15:56:36 2006 -0500
@@ -330,7 +330,9 @@
         else:
             n = self.changelog.lookup(changeid)
             pl = self.changelog.parents(n)
-        return [self.changectx(n) for n in pl if n != nullid]
+        if pl[1] == nullid:
+            return [self.changectx(pl[0])]
+        return [self.changectx(pl[0]), self.changectx(pl[1])]
 
     def filectx(self, path, changeid=None, fileid=None):
         """changeid can be a changeset revision, node, or tag.