dirstate: add p1/p2 convenience methods
authorMatt Mackall <mpm@selenic.com>
Mon, 04 Apr 2011 15:52:55 -0500
changeset 13876 10c7d92ac482
parent 13875 ff3c683eb8ff
child 13877 653121e6941f
dirstate: add p1/p2 convenience methods
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Mon Apr 04 15:30:54 2011 -0500
+++ b/mercurial/dirstate.py	Mon Apr 04 15:52:55 2011 -0500
@@ -203,6 +203,12 @@
     def parents(self):
         return [self._validate(p) for p in self._pl]
 
+    def p1(self):
+        return self._validate(self._pl[0])
+
+    def p2(self):
+        return self._validate(self._pl[1])
+
     def branch(self):
         return encoding.tolocal(self._branch)