Patchwork D7458: shelve: add the missing `create` parameter to the bundlerepo constructor

login
register
mail settings
Submitter phabricator
Date Nov. 19, 2019, 10:46 p.m.
Message ID <differential-rev-PHID-DREV-x5ln3ldhhycq4rkqmha3-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43370/
State Superseded
Headers show

Comments

phabricator - Nov. 19, 2019, 10:46 p.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Caught by pytype.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/shelve.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-devel
phabricator - Nov. 20, 2019, 8:02 a.m.
dlax added a comment.
dlax accepted this revision.


  Good catch.
  
  On the other hand, it's not clear to me what's the point of this "create" argument given `bundlerepo.instance()` will just use it to raise Abort if it is true.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7458/new/

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

To: mharbison72, #hg-reviewers, dlax
Cc: dlax, mercurial-devel
phabricator - Nov. 20, 2019, 12:57 p.m.
mharbison72 added a comment.


  In D7458#109743 <https://phab.mercurial-scm.org/D7458#109743>, @dlax wrote:
  
  > Good catch.
  > On the other hand, it's not clear to me what's the point of this "create" argument given `bundlerepo.instance()` will just use it to raise Abort if it is true.
  
  I think it’s so that the factory method is the same for each repo type, though I didn’t verify that’s still the case.  I am surprised that this parameter doesn’t default to False.  See 386f04d6ecb3 <https://phab.mercurial-scm.org/rHG386f04d6ecb3b852ad77182b9f152ab7c990ae36>.  But I didn’t know if changing the signature on stable would be ok, or if there was a valid reason for the current signature.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7458/new/

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

To: mharbison72, #hg-reviewers, dlax
Cc: dlax, mercurial-devel

Patch

diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -146,7 +146,7 @@ 
     def bundlerepo(self):
         path = self.vfs.join(self.fname)
         return bundlerepo.instance(
-            self.repo.baseui, b'bundle://%s+%s' % (self.repo.root, path)
+            self.repo.baseui, b'bundle://%s+%s' % (self.repo.root, path), False
         )
 
     def writebundle(self, bases, node):