diff mercurial/metadata.py @ 45735:edf4fa06df94

upgrade: allow sidedata upgrade to modify revision flag In the process, we fix the lack of HAS_COPIES_INFO flag on upgrade, and test the results. Differential Revision: https://phab.mercurial-scm.org/D9199
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 13 Oct 2020 05:14:37 +0200
parents 53c265a6fc83
children 18c17d63fdab
line wrap: on
line diff
--- a/mercurial/metadata.py	Tue Oct 13 03:30:49 2020 +0200
+++ b/mercurial/metadata.py	Tue Oct 13 05:14:37 2020 +0200
@@ -893,8 +893,11 @@
                     staging[r] = data
                     r, sidedata = sidedataq.get()
             tokens.release()
-        sidedataq, has_copies_info = data
-        return False, (), sidedata
+        sidedata, has_copies_info = data
+        new_flag = 0
+        if has_copies_info:
+            new_flag = sidedataflag.REVIDX_HASCOPIESINFO
+        return False, (), sidedata, new_flag, 0
 
     return sidedata_companion
 
@@ -905,10 +908,14 @@
     It just compute it in the same thread on request"""
 
     def sidedatacompanion(revlog, rev):
-        sidedata = {}
+        sidedata, has_copies_info = {}, False
         if util.safehasattr(revlog, 'filteredrevs'):  # this is a changelog
             sidedata, has_copies_info = _getsidedata(srcrepo, rev)
-        return False, (), sidedata
+        new_flag = 0
+        if has_copies_info:
+            new_flag = sidedataflag.REVIDX_HASCOPIESINFO
+
+        return False, (), sidedata, new_flag, 0
 
     return sidedatacompanion
 
@@ -924,6 +931,6 @@
                     sidedatamod.SD_FILESADDED,
                     sidedatamod.SD_FILESREMOVED,
                 )
-        return False, f, {}
+        return False, f, {}, 0, sidedataflag.REVIDX_HASCOPIESINFO
 
     return sidedatacompanion