diff mercurial/copies.py @ 47759:d7515d29761d stable 5.9rc0

branching: merge default into stable This mark the start of the 5.9 freeze.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 21 Jul 2021 22:52:09 +0200
parents 5fa083a5ff04
children d86875b75838
line wrap: on
line diff
--- a/mercurial/copies.py	Fri Jul 09 00:25:14 2021 +0530
+++ b/mercurial/copies.py	Wed Jul 21 22:52:09 2021 +0200
@@ -12,10 +12,7 @@
 import os
 
 from .i18n import _
-from .node import (
-    nullid,
-    nullrev,
-)
+from .node import nullrev
 
 from . import (
     match as matchmod,
@@ -321,15 +318,16 @@
                 if p in children_count:
                     children_count[p] += 1
         revinfo = _revinfo_getter(repo, match)
-        return _combine_changeset_copies(
-            revs,
-            children_count,
-            b.rev(),
-            revinfo,
-            match,
-            isancestor,
-            multi_thread,
-        )
+        with repo.changelog.reading():
+            return _combine_changeset_copies(
+                revs,
+                children_count,
+                b.rev(),
+                revinfo,
+                match,
+                isancestor,
+                multi_thread,
+            )
     else:
         # When not using side-data, we will process the edges "from" the parent.
         # so we need a full mapping of the parent -> children relation.
@@ -579,7 +577,7 @@
             parents = fctx._filelog.parents(fctx._filenode)
             nb_parents = 0
             for n in parents:
-                if n != nullid:
+                if n != repo.nullid:
                     nb_parents += 1
             return nb_parents >= 2