localrepo.parents: return null context for no parents
authorMatt Mackall <mpm@selenic.com>
Fri, 29 Sep 2006 15:56:36 -0500
changeset 3164 ff15ba23c1cf
parent 3163 1605e336d229
child 3165 e78185746554
localrepo.parents: return null context for no parents
mercurial/localrepo.py
--- 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.