diff mercurial/revset.py @ 41397:0bd56c291359

cleanup: use p1() and p2() instead of parents()[0] and parents()[1] We have had these methods on both contexts and dirstate for a long time now. Differential Revision: https://phab.mercurial-scm.org/D5706
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 25 Jan 2019 23:36:23 -0800
parents ee7791f2515b
children 59638c6fcb70
line wrap: on
line diff
--- a/mercurial/revset.py	Mon Jan 21 15:29:14 2019 +0000
+++ b/mercurial/revset.py	Fri Jan 25 23:36:23 2019 -0800
@@ -471,7 +471,7 @@
             try:
                 r = cl.parentrevs(r)[0]
             except error.WdirUnsupported:
-                r = repo[r].parents()[0].rev()
+                r = repo[r].p1().rev()
         ps.add(r)
     return subset & ps
 
@@ -1572,7 +1572,7 @@
         try:
             ps.add(cl.parentrevs(r)[0])
         except error.WdirUnsupported:
-            ps.add(repo[r].parents()[0].rev())
+            ps.add(repo[r].p1().rev())
     ps -= {node.nullrev}
     # XXX we should turn this into a baseset instead of a set, smartset may do
     # some optimizations from the fact this is a baseset.
@@ -1691,7 +1691,7 @@
             try:
                 ps.add(cl.parentrevs(r)[0])
             except error.WdirUnsupported:
-                ps.add(repo[r].parents()[0].rev())
+                ps.add(repo[r].p1().rev())
         else:
             try:
                 parents = cl.parentrevs(r)