Mon, 17 Sep 2018 17:47:24 +0800 bundle2: make server.bundle2.stream default to True
Anton Shestakov <av6@dwimlabs.net> [Mon, 17 Sep 2018 17:47:24 +0800] rev 39722
bundle2: make server.bundle2.stream default to True Support for bundle2 streaming clones has been shipped in Mercurial 4.5 (7eedbd5d4880), but was never activated by default. It's time to have more people use it. The new format allows streaming clones to transport cache (hooray for speed) and phaseroots (fixes phase-related issues). Changes in tests: bundle2 capabilities now have "stream=v2" (plus a '\n' as a separator) and therefore take 14 bytes more: "%0Astream%3Dv2". Tip for tests that have data encoded with CBOR: 0xd3 - 0xc5 = 14. $USUAL_BUNDLE2_CAPS$ replaces $USUAL_BUNDLE2_CAPS_SERVER$, which is the same thing, but without "stream=v2". Since streaming clones now also transfer caches, the reported byte and file counts are higher (e.g. 816 bytes in 9 files instead of 613 bytes in 4 files, a bit of --debug and manual math confirms that the caches take these extra 203 bytes in 5 files). Differential Revision: https://phab.mercurial-scm.org/D4680
Mon, 17 Sep 2018 16:52:34 +0800 bundle2: graduate bundle2.stream option from experimental to server section
Anton Shestakov <av6@dwimlabs.net> [Mon, 17 Sep 2018 16:52:34 +0800] rev 39721
bundle2: graduate bundle2.stream option from experimental to server section Differential Revision: https://phab.mercurial-scm.org/D4679
Thu, 20 Sep 2018 17:02:31 +0800 tests: split capabilities into separate lines while searching for "narrow"
Anton Shestakov <av6@dwimlabs.net> [Thu, 20 Sep 2018 17:02:31 +0800] rev 39720
tests: split capabilities into separate lines while searching for "narrow" This test is interested only in capabilities that are related to narrow, so let's omit everything else. Makes it easier to update other capabilities (and "rev-branch-cache" is one of the usual patterns that are already present in tests/common-patterns.py anyway). Differential Revision: https://phab.mercurial-scm.org/D4678
Wed, 19 Sep 2018 23:54:16 -0400 py3: resolve Unicode issues around `hg serve` on Windows
Matt Harbison <matt_harbison@yahoo.com> [Wed, 19 Sep 2018 23:54:16 -0400] rev 39719
py3: resolve Unicode issues around `hg serve` on Windows Presumably we're going to want to use CreateProcessW(), and possibly get rid of pycompat.getcwd() here (which maps to the DeprecationWarning causing os.getcwdb()) to use os.getcwd() directly. But this was a minimal change to get rid of some stacktraces in test-run-tests.t.
Wed, 19 Sep 2018 21:41:58 -0400 run-tests: avoid os.getcwdb() on Windows
Matt Harbison <matt_harbison@yahoo.com> [Wed, 19 Sep 2018 21:41:58 -0400] rev 39718
run-tests: avoid os.getcwdb() on Windows Any call to this issues a DeprecationWarning about the Windows bytes API being deprecated. There are a handful of these calls in core, but test-run-tests.t was littered with these, as it's printed everytime run-tests.py is launched. I'm not sure what the long term strategy for Unicode on Windows in the test runner is, but this seems no worse than the current conversion strategy.
Wed, 19 Sep 2018 20:45:57 -0400 run-tests: quote PYTHON when spawning a subprocess
Matt Harbison <matt_harbison@yahoo.com> [Wed, 19 Sep 2018 20:45:57 -0400] rev 39717
run-tests: quote PYTHON when spawning a subprocess Same reason as 5abc47d4ca6b. This covers running *.py tests, as well as inline python blocks. I didn't hit the path around line 3079, but it seems correct to quote.
Mon, 17 Sep 2018 20:43:40 -0400 narrow: add test showing that local-to-local narrow clones don't work
Augie Fackler <augie@google.com> [Mon, 17 Sep 2018 20:43:40 -0400] rev 39716
narrow: add test showing that local-to-local narrow clones don't work It turns out they've never actually worked: prior to some recent refactoring they just unintentionally followed the full-clone path, which we unintentionally relied on in a test at Google. Differential Revision: https://phab.mercurial-scm.org/D4640
Wed, 19 Sep 2018 17:34:36 -0700 fastannotate: process files as they arrive
Martin von Zweigbergk <martinvonz@google.com> [Wed, 19 Sep 2018 17:34:36 -0700] rev 39715
fastannotate: process files as they arrive peer.commandexecutor()'s context manager waits for all responses to arrive in its __exit__() method. We want to process the results as they arrive, so we should do that inside the context manager scope. Note that the futures' result() methods have been replaced to make sure that the command executor's sendcommands() method is called when the first future's result is requested, so we don't need to do that. A minor side-effect is that we can no longer easily tell when the server has started sending us responses, so that long statement was lost. Differential Revision: https://phab.mercurial-scm.org/D4666
Tue, 18 Sep 2018 22:14:03 -0400 py3: make osenvironb a proxy for, instead of a copy of os.environ where needed
Matt Harbison <matt_harbison@yahoo.com> [Tue, 18 Sep 2018 22:14:03 -0400] rev 39714
py3: make osenvironb a proxy for, instead of a copy of os.environ where needed Without this, TESTDIR and a few other variables weren't defined in the *.t test. I didn't bother implementing all of the view functions for simplicity. All that is actually used is __{get,set}item__(), get() and pop(), but the rest seems easy enough to add for futureproofing.
Tue, 22 May 2018 16:16:11 +0200 memctx: simplify _manifest with new revlog nodeids
Sean Farley <sean@farley.io> [Tue, 22 May 2018 16:16:11 +0200] rev 39713
memctx: simplify _manifest with new revlog nodeids This was originally written before we had modifiednodeid and addednodeid, so we had to get the parents of the context, the data from the function, and then hash that. This is much more simple now and helps refactor more code later.
Tue, 22 May 2018 12:35:38 +0200 context: remove unused overlayfilectx (API)
Sean Farley <sean@farley.io> [Tue, 22 May 2018 12:35:38 +0200] rev 39712
context: remove unused overlayfilectx (API) It seems that this was maybe used in an extension but at this point nothing in lfs, hg-experimental, or any other cursory repo looked at has a reference to this class; so, for now, let's just remove it.
Mon, 11 Jun 2018 20:48:47 -0700 context: fix typo in workingcommitctx
Sean Farley <sean@farley.io> [Mon, 11 Jun 2018 20:48:47 -0700] rev 39711
context: fix typo in workingcommitctx This was probably a copy pasta error in 745e3b485632. Refactoring memctx code exposed this bug.
Tue, 17 Jul 2018 17:16:22 -0700 filectx: fix return of renamed
Sean Farley <sean@farley.io> [Tue, 17 Jul 2018 17:16:22 -0700] rev 39710
filectx: fix return of renamed How is this not blowing up everywhere? It seems that filelog.renamed has always returned False (incorrectly a boolean) instead of the assumed None. Tracing through history, you need to skip over my move of code in 2013 by annotating from 896193a9cab4^ and you can see the original code is from 2007 (180a3eee4b75) and that ab9fa7a85dd9 broke this by assuming renamed was a bool (instead of None). Refactoring memctx code later exposed this bug.
Wed, 19 Sep 2018 00:23:02 -0400 tests: glob over some quoting differences in test-narrow-widen-no-ellipsis.t
Matt Harbison <matt_harbison@yahoo.com> [Wed, 19 Sep 2018 00:23:02 -0400] rev 39709
tests: glob over some quoting differences in test-narrow-widen-no-ellipsis.t
Tue, 18 Sep 2018 23:56:38 -0400 py3: byteify contrib/check-config.py
Matt Harbison <matt_harbison@yahoo.com> [Tue, 18 Sep 2018 23:56:38 -0400] rev 39708
py3: byteify contrib/check-config.py The corresponding *.t still fails because of bytes (with a 'b' prefix) vs str printing, but no longer crashes. # skip-blame for b'' prefixing
Tue, 18 Sep 2018 23:47:21 -0400 tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com> [Tue, 18 Sep 2018 23:47:21 -0400] rev 39707
tests: quote PYTHON usage Python3 defaults to installing under "Program Files".
Tue, 18 Sep 2018 22:40:03 -0400 py3: add a missing b'' for Windows
Matt Harbison <matt_harbison@yahoo.com> [Tue, 18 Sep 2018 22:40:03 -0400] rev 39706
py3: add a missing b'' for Windows I tried ./contrib/byteify-strings.py, but there were way too many changes (and most looked wrong). This was hit with test-check-interfaces.py. # skip-blame for b'' prefixes
Mon, 03 Sep 2018 21:01:47 +0900 log: make changesetformatter pass in changectx to formatter
Yuya Nishihara <yuya@tcha.org> [Mon, 03 Sep 2018 21:01:47 +0900] rev 39705
log: make changesetformatter pass in changectx to formatter It wasn't necessary before, but user templates may have keywords that aren't filled in by the changesetformatter.
Mon, 03 Sep 2018 20:56:53 +0900 journal: use changesetformatter to properly nest list of commits in JSON
Yuya Nishihara <yuya@tcha.org> [Mon, 03 Sep 2018 20:56:53 +0900] rev 39704
journal: use changesetformatter to properly nest list of commits in JSON Before, two separate JSON documents were interleaved. I chose the field name "changesets" over the option name "commits", since each entry is called a "changeset" in log templates.
Mon, 03 Sep 2018 07:53:50 +0900 journal: do not pass in repolookuperror string to template (BC)
Yuya Nishihara <yuya@tcha.org> [Mon, 03 Sep 2018 07:53:50 +0900] rev 39703
journal: do not pass in repolookuperror string to template (BC) This doesn't look like data, but a warning message.
Mon, 03 Sep 2018 07:52:24 +0900 journal: inline formatted nodes and date into expression
Yuya Nishihara <yuya@tcha.org> [Mon, 03 Sep 2018 07:52:24 +0900] rev 39702
journal: inline formatted nodes and date into expression The variable name "str" was misleading since these values aren't always strings.
Mon, 03 Sep 2018 07:48:43 +0900 journal: unify template name for "nodes" (BC)
Yuya Nishihara <yuya@tcha.org> [Mon, 03 Sep 2018 07:48:43 +0900] rev 39701
journal: unify template name for "nodes" (BC) This is a part of the name unification. https://www.mercurial-scm.org/wiki/GenericTemplatingPlan#Dictionary .. bc:: ``{oldhashes}`` and ``{newhashes}`` in journal template are renamed to ``{oldnodes}`` and ``{newnodes}`` respectively.
Wed, 12 Sep 2018 15:59:26 -0700 localrepo: extract resolving of opener options to standalone functions
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 12 Sep 2018 15:59:26 -0700] rev 39700
localrepo: extract resolving of opener options to standalone functions Requirements and config options are converted into a dict which is available to the store vfs to consult. This is how storage options are communicated from the repo layer to the storage layer. Currently, we do that option resolution in a private method on the repo instance. And there is a single method doing that resolution. Opener options are logically specific to the storage backend they apply to. And, opener options may wish to influence how the repo object/type is constructed. So it makes sense to have more granular storage option resolution that occurs before the repo object is instantiated. This commit extracts the code for resolving opener options into new module-level functions. These functions are run before the repo instance is constructed. As part of the code move, we split the option resolution into generic and revlog-specific options. After this commit, we no longer add revlog-specific options to repos that don't have a revlog requirement. Some of these opener options and associated config options might make sense on alternate storage backends. We can always reuse config options and opener option names for other backends. But we shouldn't be passing opener options to storage backends that won't recognize them. I haven't done it here, but after this commit it should be possible for store backends to validate the set of opener options it receives. Because localrepository.openerreqs is no longer used after this commit, it has been removed. I'm not super thrilled about the code outside of localrepo that is adding requirements and updating opener options. We'll probably want to create a more formal API for that use case that constructs a new repo instance and poisons the old repo object. But this was a pre-existing issue and can be dealt with later. I have little doubt it will cause me troubles as I continue to refactor how repository objects are instantiated. .. api:: ``localrepository.openerreqs`` has been removed. Override ``localrepo.resolvestorevfsoptions()`` to add custom opener options. .. api:: ``localrepository._applyopenerreqs()`` has been removed. Use ``localrepo.resolvestorevfsoptions()`` to add custom opener options. Differential Revision: https://phab.mercurial-scm.org/D4576
Wed, 12 Sep 2018 15:17:47 -0700 localrepo: use boolean in opener options
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 12 Sep 2018 15:17:47 -0700] rev 39699
localrepo: use boolean in opener options Not sure why we're using an integer for a flag value here. I'm pretty sure nothing relies on values being 1. While we're here, convert to a dict comprehension. Differential Revision: https://phab.mercurial-scm.org/D4575
Wed, 12 Sep 2018 15:07:27 -0700 localrepo: move store() from store module
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 12 Sep 2018 15:07:27 -0700] rev 39698
localrepo: move store() from store module I want logic related to requirements handling to be in the localrepo module so it is all in one place. I would have loved to inline this logic. Unfortunately, statichttprepo also calls it. I didn't want to inline it twice. We could potentially refactor statichttppeer. But meh. Differential Revision: https://phab.mercurial-scm.org/D4574
Wed, 12 Sep 2018 15:05:51 -0700 localrepo: resolve store and cachevfs in makelocalrepository()
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 12 Sep 2018 15:05:51 -0700] rev 39697
localrepo: resolve store and cachevfs in makelocalrepository() This is mostly a code move and refactor. One change is that we now explicitly look for requirements indicating a share is being used rather than blindly try to read from .hg/sharedpath. Requirements *should* be all that is necessary to dictate high-level behavior and I'm not sure why the previous code was doing what it was. The previous code has been in place since 87d1fd40f57e (authored in 2009). And the commit immediately after that (971e38a9344b) introduced ``hg.share()`` and always wrote the ``shared`` requirement. And as far as I can tell, every revision of ``hg.share()`` since has written either the ``shared`` or ``relshared`` requirement. So I'm pretty sure we don't need to maintain BC by always looking for and honoring the ``.hg/sharedpath`` file even if a requirement isn't present. .. bc:: A repository will no longer use shared storage if it has a ``.hg/sharedpath`` file but no entry in ``.hg/requires`` saying it is shared. This change should not have any end-user impact, as all shared repos should have a ``.hg/requires`` file indicating this. Differential Revision: https://phab.mercurial-scm.org/D4573
Wed, 12 Sep 2018 13:10:45 -0700 localrepo: document and test bug around opening shared repos
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 12 Sep 2018 13:10:45 -0700] rev 39696
localrepo: document and test bug around opening shared repos As part of refactoring this code, I realized that we don't validate the requirements of a shared repository. This commit documents that next to the requirements validation code and adds a test demonstrating the buggy behavior. I'm not sure if I'll fix this. But it is definitely a bug that users could encounter, as LFS, narrow, and potentially other extensions dynamically add requirements on first use. One part of this I'm not sure about is how to handle loading the .hg/hgrc of the shared repo. We need to do that in order to load extensions. But we don't want that repo's hgrc to overwrite the current repo's. Differential Revision: https://phab.mercurial-scm.org/D4572
Wed, 12 Sep 2018 15:03:17 -0700 localrepo: move requirements reasonability testing to own function
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 12 Sep 2018 15:03:17 -0700] rev 39695
localrepo: move requirements reasonability testing to own function Just because we know how to handle each listed requirement doesn't mean that set of requirements is reasonable. This commit introduces an extension-wrappable function to validate that a set of requirements makes sense. We could combine this with ensurerequirementsrecognized(). But I think having a line between basic membership testing and compatibility checking is more powerful as it will help differentiate between missing support and buggy behavior. Differential Revision: https://phab.mercurial-scm.org/D4571
Wed, 12 Sep 2018 15:47:24 -0700 statichttprepo: use new functions for requirements validation
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 12 Sep 2018 15:47:24 -0700] rev 39694
statichttprepo: use new functions for requirements validation The new code in localrepo for requirements gathering and validation is more robust than scmutil.readrequires(). Let's port statichttprepo to it. Since scmutil.readrequires() is no longer used, it has been removed. It is possible extensions were monkeypatching this to supplement the set of supported requirements. But the proper way to do that is to register a featuresetupfuncs. I'm comfortable forcing the API break because featuresetupfuncs is more robust and has been supported for a while. .. api:: ``scmutil.readrequires()`` has been removed. Use ``localrepo.featuresetupfuncs`` to register new repository requirements. Use ``localrepo.ensurerequirementsrecognized()`` to validate them. Differential Revision: https://phab.mercurial-scm.org/D4570
Wed, 12 Sep 2018 14:54:17 -0700 localrepo: validate supported requirements in makelocalrepository()
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 12 Sep 2018 14:54:17 -0700] rev 39693
localrepo: validate supported requirements in makelocalrepository() This should be a glorified code move. I did take the opportunity to refactor things. We now have a separate function for gathering requirements and one for validating them. I also mode cosmetic changes to the code, such as not using abbreviations and using a set instead of list to model missing requirements. Differential Revision: https://phab.mercurial-scm.org/D4569
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 +3000 +10000 tip