changeset 47300:8b2d09c7e5cd

updatecaches: deprecate the `full` argument 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. Differential Revision: https://phab.mercurial-scm.org/D10731
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 17 May 2021 15:24:46 +0200
parents 7edaf91c7886
children 97f04eaafa65
files mercurial/localrepo.py
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Mon May 17 15:42:18 2021 +0200
+++ b/mercurial/localrepo.py	Mon May 17 15:24:46 2021 +0200
@@ -2754,13 +2754,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):