Patchwork D9198: sidedata: return enough data to set the proper flag in the future

login
register
mail settings
Submitter phabricator
Date Oct. 13, 2020, 10:40 a.m.
Message ID <differential-rev-PHID-DREV-wljy3kotyiot3itxqq5k-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47446/
State Superseded
Headers show

Comments

phabricator - Oct. 13, 2020, 10:40 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  If the revision has information relevant to copy tracing, we need to set a
  dedicated flag in revlog. Currently the upgrade process is failing to do so.
  Before we teach the upgrade process about flags, we make the information
  available where we will needs it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9198

AFFECTED FILES
  mercurial/metadata.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/metadata.py b/mercurial/metadata.py
--- a/mercurial/metadata.py
+++ b/mercurial/metadata.py
@@ -798,7 +798,7 @@ 
 def _getsidedata(srcrepo, rev):
     ctx = srcrepo[rev]
     files = compute_all_files_changes(ctx)
-    return encode_files_sidedata(files)
+    return encode_files_sidedata(files), files.has_copies_info
 
 
 def getsidedataadder(srcrepo, destrepo):
@@ -876,18 +876,19 @@ 
     staging = {}
 
     def sidedata_companion(revlog, rev):
-        sidedata = {}
+        data = {}, False
         if util.safehasattr(revlog, b'filteredrevs'):  # this is a changelog
             # Is the data previously shelved ?
             sidedata = staging.pop(rev, None)
             if sidedata is None:
                 # look at the queued result until we find the one we are lookig
                 # for (shelve the other ones)
-                r, sidedata = sidedataq.get()
+                r, data = sidedataq.get()
                 while r != rev:
-                    staging[r] = sidedata
+                    staging[r] = data
                     r, sidedata = sidedataq.get()
             tokens.release()
+        sidedataq, has_copies_info = data
         return False, (), sidedata
 
     return sidedata_companion
@@ -901,7 +902,7 @@ 
     def sidedatacompanion(revlog, rev):
         sidedata = {}
         if util.safehasattr(revlog, 'filteredrevs'):  # this is a changelog
-            sidedata = _getsidedata(srcrepo, rev)
+            sidedata, has_copies_info = _getsidedata(srcrepo, rev)
         return False, (), sidedata
 
     return sidedatacompanion