Add localrepo.parents to get parent changectxs.
--- a/mercurial/localrepo.py Tue Sep 26 16:21:52 2006 -0500
+++ b/mercurial/localrepo.py Fri Sep 29 15:48:16 2006 -0500
@@ -321,6 +321,17 @@
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)
+ return [self.changectx(n) for n in pl if n != nullid]
+
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."""