Patchwork D6469: bookmarks: use correct store for "ambiguity check"

login
register
mail settings
Submitter phabricator
Date June 1, 2019, 5:48 a.m.
Message ID <differential-rev-PHID-DREV-ko7mma33b5egkncc5jhp-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/40293/
State Superseded
Headers show

Comments

phabricator - June 1, 2019, 5:48 a.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I still don't quite know what the check does, but I clearly got it
  wrong in https://phab.mercurial-scm.org/rHG526750cdd02d39cc718bc2ab2b89f909d007be4b (bookmarks: keep bookmarks in .hg/store if new
  config set, 2019-05-15). Just compare with the strings we use in
  @repofilecache and @storecache. These bugs were then copied to the
  stable branch in https://phab.mercurial-scm.org/rHGc2b83c957621b67251e08e75be7805e4227795f6 (localrepo: grab mixedrepostorecache
  class from https://phab.mercurial-scm.org/rHG526750cdd02d39cc718bc2ab2b89f909d007be4b, 2019-05-20) and https://phab.mercurial-scm.org/rHG2338bdea44744312e42632d68bc00491184c748b (bookmark: also
  make bookmark cache depends of the changelog, 2019-05-20). As a
  result, test-wireproto-exchangev2.t is flaky on both branches. This
  patch fixes that.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - June 1, 2019, 5:48 a.m.
martinvonz added a comment.


  This is meant for the stable branch

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - June 5, 2019, 11:17 a.m.
marmoute requested changes to this revision.
marmoute added a comment.
This revision now requires changes to proceed.


  Can we go fully explicit ? Having both `plain` and `store` as the possible value?

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers, marmoute
Cc: marmoute, mercurial-devel
phabricator - June 5, 2019, 1:03 p.m.
martinvonz requested review of this revision.
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D6469#94049, @marmoute wrote:
  
  > Can we go fully explicit ? Having both `plain` and `store` as the possible value?
  
  
  I'd prefer to avoid that on the stable branch. It would require more changes (to the various `vfsmap` instances). I wanted to do it on the default branch, though.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers, marmoute
Cc: marmoute, mercurial-devel
phabricator - June 5, 2019, 7:05 p.m.
marmoute added a comment.


  Ah, I see. The move from ('plain', '') to ('', 'plain') is matching the key used for the vfsmap?
  If so, go ahead with this patch on stable.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -133,10 +133,10 @@ 
 
     def join(self, obj, fnameandlocation):
         fname, location = fnameandlocation
-        if location == '':
+        if location == 'plain':
             return obj.vfs.join(fname)
         else:
-            if location != 'store':
+            if location != '':
                 raise error.ProgrammingError('unexpected location: %s' %
                                              location)
             return obj.sjoin(fname)
@@ -1219,8 +1219,8 @@ 
         cls = repoview.newtype(self.unfiltered().__class__)
         return cls(self, name, visibilityexceptions)
 
-    @mixedrepostorecache(('bookmarks', ''), ('bookmarks.current', ''),
-                         ('00changelog.i', 'store'))
+    @mixedrepostorecache(('bookmarks', 'plain'), ('bookmarks.current', 'plain'),
+                         ('00changelog.i', ''))
     def _bookmarks(self):
         return bookmarks.bmstore(self)