dirstate: make a conditionnal easier to read in `setparents`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 15 Sep 2021 10:02:11 +0200
changeset 47987 dd267f16042f
parent 47986 72b80a0124f8
child 47988 d459c6b84961
dirstate: make a conditionnal easier to read in `setparents` By grabing `nullid` in the local space, we get the conditionnal to fit in one line. Differential Revision: https://phab.mercurial-scm.org/D11427
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Wed Sep 15 09:50:44 2021 +0200
+++ b/mercurial/dirstate.py	Wed Sep 15 10:02:11 2021 +0200
@@ -387,10 +387,8 @@
             self._origpl = self._pl
         self._map.setparents(p1, p2)
         copies = {}
-        if (
-            oldp2 != self._nodeconstants.nullid
-            and p2 == self._nodeconstants.nullid
-        ):
+        nullid = self._nodeconstants.nullid
+        if oldp2 != nullid and p2 == nullid:
             candidatefiles = self._map.non_normal_or_other_parent_paths()
 
             for f in candidatefiles: