# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 2021-09-15 08:02:11
# Node ID dd267f16042fa997d83cbe537d999f812cbb1023
# Parent  72b80a0124f8ff11920897caa46dbe6f30e7b85b

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

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -387,10 +387,8 @@ class dirstate(object):
             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: