diff mercurial/localrepo.py @ 3203:14792adabf80

Merge with upstream
author Thomas Arendsen Hein <thomas@intevation.de>
date Sat, 30 Sep 2006 09:46:03 +0200
parents ff15ba23c1cf
children 53e843840349 8d4855fd9d7b
line wrap: on
line diff
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -321,6 +321,19 @@ class localrepository(repo.repository):
     def changectx(self, changeid=None):
         return context.changectx(self, changeid)
 
+    def parents(self, changeid=None):
+        '''
+        get list of changectxs for parents of changeid or working directory
+        '''
+        if changeid is None:
+            pl = self.dirstate.parents()
+        else:
+            n = self.changelog.lookup(changeid)
+            pl = self.changelog.parents(n)
+        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.
            fileid can be a file revision or node."""