# HG changeset patch # User Pierre-Yves David # Date 1709686432 -3600 # Node ID a03fa40afd014ae704d116ef79103e4bd3b430f5 # Parent 530b4cffd6a638d54d5b7f2cbdf3a6770ce6b4b5 filteredhash: rename the filteredhash function The new name is less ambiguous, as we are about to introduce an alternative function it seems like a good idea to have clearer name to distinct the two. diff -r 530b4cffd6a6 -r a03fa40afd01 mercurial/branchmap.py --- a/mercurial/branchmap.py Wed Mar 06 01:43:51 2024 +0100 +++ b/mercurial/branchmap.py Wed Mar 06 01:53:52 2024 +0100 @@ -466,7 +466,11 @@ # tiprev doesn't correspond to tipnode: repo was stripped, or this # repo has a different order of changesets return False - tiphash = scmutil.filteredhash(repo, self.tiprev, needobsolete=True) + tiphash = scmutil.combined_filtered_and_obsolete_hash( + repo, + self.tiprev, + needobsolete=True, + ) # hashes don't match if this repo view has a different set of filtered # revisions (e.g. due to phase changes) or obsolete revisions (e.g. # history was rewritten) @@ -710,8 +714,10 @@ # However. we've just updated the cache and we assume it's valid, # so let's make the cache key valid as well by recomputing it from # the cached data - self.filteredhash = scmutil.filteredhash( - repo, self.tiprev, needobsolete=True + self.filteredhash = scmutil.combined_filtered_and_obsolete_hash( + repo, + self.tiprev, + needobsolete=True, ) self._state = STATE_DIRTY diff -r 530b4cffd6a6 -r a03fa40afd01 mercurial/scmutil.py --- a/mercurial/scmutil.py Wed Mar 06 01:43:51 2024 +0100 +++ b/mercurial/scmutil.py Wed Mar 06 01:53:52 2024 +0100 @@ -349,7 +349,7 @@ self._newfiles.add(f) -def filteredhash(repo, maxrev, needobsolete=False): +def combined_filtered_and_obsolete_hash(repo, maxrev, needobsolete=False): """build hash of filtered revisions in the current repoview. Multiple caches perform up-to-date validation by checking that the diff -r 530b4cffd6a6 -r a03fa40afd01 mercurial/tags.py --- a/mercurial/tags.py Wed Mar 06 01:43:51 2024 +0100 +++ b/mercurial/tags.py Wed Mar 06 01:53:52 2024 +0100 @@ -433,7 +433,11 @@ if ( cacherev == tiprev and cachenode == tipnode - and cachehash == scmutil.filteredhash(repo, tiprev) + and cachehash + == scmutil.combined_filtered_and_obsolete_hash( + repo, + tiprev, + ) ): tags = _readtags(ui, repo, cachelines, cachefile.name) cachefile.close() @@ -441,7 +445,14 @@ if cachefile: cachefile.close() # ignore rest of file - valid = (tiprev, tipnode, scmutil.filteredhash(repo, tiprev)) + valid = ( + tiprev, + tipnode, + scmutil.combined_filtered_and_obsolete_hash( + repo, + tiprev, + ), + ) repoheads = repo.heads() # Case 2 (uncommon): empty repo; get out quickly and don't bother