# HG changeset patch # User Sean Farley # Date 1375745214 18000 # Node ID d0448e9d45541fcf1a2e2543e3ce612da2ddd658 # Parent 9f57ebf0cce8da4521c0e761f9d8efe046ed3366 basectx: move p2 from changectx diff -r 9f57ebf0cce8 -r d0448e9d4554 mercurial/context.py --- a/mercurial/context.py Mon Aug 05 18:26:15 2013 -0500 +++ b/mercurial/context.py Mon Aug 05 18:26:54 2013 -0500 @@ -87,6 +87,11 @@ def p1(self): return self._parents[0] + def p2(self): + if len(self._parents) == 2: + return self._parents[1] + return changectx(self._repo, -1) + class changectx(basectx): """A changecontext object makes access to data related to a particular changeset convenient. It represents a read-only context already presnt in @@ -248,11 +253,6 @@ def hidden(self): return self._rev in repoview.filterrevs(self._repo, 'visible') - def p2(self): - if len(self._parents) == 2: - return self._parents[1] - return changectx(self._repo, -1) - def children(self): """return contexts for each child changeset""" c = self._repo.changelog.children(self._node)