Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 6742:2d54e7c1e69d
context: clean up parents()
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 26 Jun 2008 13:46:33 -0500 |
parents | b148e9099133 |
children | 86e8187b721a |
line wrap: on
line diff
--- a/mercurial/localrepo.py Thu Jun 26 13:46:31 2008 -0500 +++ b/mercurial/localrepo.py Thu Jun 26 13:46:33 2008 -0500 @@ -489,17 +489,8 @@ 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])] + '''get list of changectxs for parents of changeid''' + return self.changectx(changeid).parents() def filectx(self, path, changeid=None, fileid=None): """changeid can be a changeset revision, node, or tag.