Patchwork D10731: updatecaches: deprecate the `full` argument

login
register
mail settings
Submitter phabricator
Date May 18, 2021, 7:49 a.m.
Message ID <differential-rev-PHID-DREV-6gin3472q4hkhz5mzste-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49051/
State Superseded
Headers show

Comments

phabricator - May 18, 2021, 7:49 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Now that all users were migrated, we can use deprecate the old way. This would
  give potential extensions code a heads up on the API change.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2740,13 +2740,18 @@ 
 
         unfi = self.unfiltered()
 
-        if caches is None:
-            if full:
-                caches = repository.CACHES_ALL
-                if full == b"post-clone":
-                    caches = repository.CACHES_POST_CLONE
-            else:
-                caches = repository.CACHES_DEFAULT
+        if full:
+            msg = (
+                "`full` argument for `repo.updatecaches` is deprecated\n"
+                "(use `caches=repository.CACHE_ALL` instead)"
+            )
+            self.ui.deprecwarn(msg, "5.9")
+            caches = repository.CACHES_ALL
+            if full == b"post-clone":
+                caches = repository.CACHES_POST_CLONE
+            caches = repository.CACHES_ALL
+        elif caches is None:
+            caches = repository.CACHES_DEFAULT
 
         if repository.CACHE_BRANCHMAP_SERVED in caches:
             if tr is None or tr.changes[b'origrepolen'] < len(self):