Fri, 18 Sep 2020 10:04:02 -0700 rebase: fix an inconsistent hyphenation in a debug message
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Sep 2020 10:04:02 -0700] rev 45510
rebase: fix an inconsistent hyphenation in a debug message We used "rebasing on disk" but "rebasing in-memory". I believe the former is correct, so I used that. Differential Revision: https://phab.mercurial-scm.org/D9054
Fri, 18 Sep 2020 12:20:28 +0200 strip: with --keep, consider all revs "removed" from the wcp (issue6270) stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 18 Sep 2020 12:20:28 +0200] rev 45509
strip: with --keep, consider all revs "removed" from the wcp (issue6270) The current code was blink to change from other branches when stripping merges that are ancestors of the working copy parents.
Fri, 18 Sep 2020 12:10:12 +0200 test-strip: display more information highlight buggy behavior stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 18 Sep 2020 12:10:12 +0200] rev 45508
test-strip: display more information highlight buggy behavior When using `hg strip --keep` on a set of changeset that contains a merge, the set of file considered when rebuilding the dirstate is missing files updated by changeset that are not directly inside the `new-parent::old-parent` range. We start with updating the test with new output highlighting the issue. This issue was spotted because that dirstate inconsistency made the test flaky. The new command make the test less flaky (but still wrong).
Tue, 15 Sep 2020 15:03:07 +0200 changing-files: implement equality checking
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 15 Sep 2020 15:03:07 +0200] rev 45507
changing-files: implement equality checking This makes debugging simpler.
Thu, 17 Sep 2020 11:21:13 +0200 changing-files: document the various sets
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 17 Sep 2020 11:21:13 +0200] rev 45506
changing-files: document the various sets The content of some sets (eg: added, removed) is not always obvious so we document them.
Fri, 18 Sep 2020 10:48:43 -0400 merge with stable
Augie Fackler <augie@google.com> [Fri, 18 Sep 2020 10:48:43 -0400] rev 45505
merge with stable
Fri, 18 Sep 2020 20:19:52 +0900 share: do not write working-copy requirements twice
Yuya Nishihara <yuya@tcha.org> [Fri, 18 Sep 2020 20:19:52 +0900] rev 45504
share: do not write working-copy requirements twice Follows up d252f51ab032. Maybe it is a copy-paste error.
Sun, 13 Sep 2020 15:59:23 +0900 py3: fix formatting of LookupError for workingctx stable
Yuya Nishihara <yuya@tcha.org> [Sun, 13 Sep 2020 15:59:23 +0900] rev 45503
py3: fix formatting of LookupError for workingctx Spotted while writing broken tests for "hg grep -fr'wdir()'". basectx._fileinfo() raises ManifestLookupError(self._node, ..), but _node of the workingctx is None for historical reasons.
Thu, 17 Sep 2020 22:45:51 -0700 phabricator: fix loadhgrc() override broken by D8656
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 22:45:51 -0700] rev 45502
phabricator: fix loadhgrc() override broken by D8656 This fixes some failing `test-check*` tests (at least `test-check-code.t` was broken). Differential Revision: https://phab.mercurial-scm.org/D9044
Thu, 17 Sep 2020 23:09:47 -0700 mergestate: move commit() from base class to on-disk subclass
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 23:09:47 -0700] rev 45501
mergestate: move commit() from base class to on-disk subclass The commit message doesn't do anything in the in-memory case, and it's `_makerecords()` is also not needed in that case, so let's move it down to the on-disk subclass (i.e. the `mergestate` class). Sorry I missed this earlier. Differential Revision: https://phab.mercurial-scm.org/D9043
Thu, 17 Sep 2020 23:12:48 -0700 mergestate: make in-memory mergestate not clear on-disk mergestate on reset()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 23:12:48 -0700] rev 45500
mergestate: make in-memory mergestate not clear on-disk mergestate on reset() Oops, I thought I had remove the `rmtree()` call earlier. Maybe I accidentally got it back in a histedit or something. Differential Revision: https://phab.mercurial-scm.org/D9042
Tue, 15 Sep 2020 16:10:16 -0700 merge: use in-memory mergestate when using in-memory context
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Sep 2020 16:10:16 -0700] rev 45499
merge: use in-memory mergestate when using in-memory context This is my version of Augie's D8568. It makes it so we don't touch the mergestate on disk when using an in-memory context. The reason that I want this is not the same as the reason that Augie write his patch (though I agree with that reason too). My hope is to make in-memory rebase not fall back to on-disk rebase when there are conflict. I plan to do that by adding a `overlayworkingctx.reflect_in_workingcopy()`. The idea is that that will update the working copy, the dirstate and the mergestate as necessary. Differential Revision: https://phab.mercurial-scm.org/D9040
Tue, 15 Sep 2020 11:17:24 -0700 mergestate: extract a base class to be shared by future memmergestate
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Sep 2020 11:17:24 -0700] rev 45498
mergestate: extract a base class to be shared by future memmergestate This extracts a new base class from `mergestate` and leaves all the vfs-touching code in `mergestate`. Differential Revision: https://phab.mercurial-scm.org/D9039
Tue, 15 Sep 2020 11:33:26 -0700 mergestate: extract overridable methods for making/restoring file backups
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Sep 2020 11:33:26 -0700] rev 45497
mergestate: extract overridable methods for making/restoring file backups In-memory merge currently still uses on-disk mergestate. That's mostly harmless (I don't think I've seen any problem it's actually caused). It's still a little weird. I'm planning to add an in-memory mergestate, which will be used with `overlayworkingctx`. This patch prepares for that by extracting that logic, so it's easier to change per subclass. Differential Revision: https://phab.mercurial-scm.org/D9038
Wed, 16 Sep 2020 13:39:26 -0700 mergestate: initialize all properties in __init__()
Martin von Zweigbergk <martinvonz@google.com> [Wed, 16 Sep 2020 13:39:26 -0700] rev 45496
mergestate: initialize all properties in __init__() This is hopefully not very controverial. I found the initialization before this patch unorthodox. It wasn't clear which properties the object was supposed to have. Differential Revision: https://phab.mercurial-scm.org/D9037
Thu, 17 Sep 2020 19:33:55 -0700 mergestate: remove unnecessary clearing of `localctx` and `otherctx`
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 19:33:55 -0700] rev 45495
mergestate: remove unnecessary clearing of `localctx` and `otherctx` As noted in the previous commit, there are no callers that (re-)use the instance after calling `reset()`. There are also no callers that call `_read()` after doing anything with the instance (it's only called right after an instance is created). If reviewers feel that this is too risky, I can extract and reuse the poisoning code that indygreg once added for poisining repo instances. Differential Revision: https://phab.mercurial-scm.org/D9036
Wed, 16 Sep 2020 13:25:49 -0700 mergestate: move most of of reset() into start()
Martin von Zweigbergk <martinvonz@google.com> [Wed, 16 Sep 2020 13:25:49 -0700] rev 45494
mergestate: move most of of reset() into start() `ms.reset()` has somehow become a combination of two different things: 1. A constructor-like function creating an empty instance 2. A call to `shutil.rmtree()` to clear the mergestate. It seems that all callers now care only about the latter (since we changed one caller to use the new `ms.start()` method instead). Let's move the code for the former into `start()`, since that's the only place it's needed. Differential Revision: https://phab.mercurial-scm.org/D9035
Thu, 17 Sep 2020 09:23:21 -0700 mergestate: make clean() only be about creating a clean mergestate
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 09:23:21 -0700] rev 45493
mergestate: make clean() only be about creating a clean mergestate This is similar to the previous patch, but moves the separation one step further out, to `merge.py`. Differential Revision: https://phab.mercurial-scm.org/D9034
Wed, 16 Sep 2020 10:09:37 -0700 mergestate: split up reset() for its two use cases
Martin von Zweigbergk <martinvonz@google.com> [Wed, 16 Sep 2020 10:09:37 -0700] rev 45492
mergestate: split up reset() for its two use cases We only have one place that calls `ms.reset()` with any arguments. That place is `mergestate.clean()`. The callers that call the function with no arguments seem to all just want delete the mergestate -- none of them look at the instance after calling `reset()`. Let's separate out the two different use cases to make the code clearer. I'll clean up further soon. Differential Revision: https://phab.mercurial-scm.org/D9033
Tue, 15 Sep 2020 23:19:14 -0700 mergestate: simplify reset(), knowing that `other` and `node` go together
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Sep 2020 23:19:14 -0700] rev 45491
mergestate: simplify reset(), knowing that `other` and `node` go together There's only one caller of `reset()` that passes any arguments at all, and that originates from `merge.py:1371`. That code always passes values for both `node` and `other`. Differential Revision: https://phab.mercurial-scm.org/D9032
Tue, 15 Sep 2020 22:40:26 -0700 mergestate: make some callers not pass pointless node argument
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Sep 2020 22:40:26 -0700] rev 45490
mergestate: make some callers not pass pointless node argument The node argument is set on the created `mergestate` instance, but these callers don't even look at that instance. Differential Revision: https://phab.mercurial-scm.org/D9031
Thu, 17 Sep 2020 09:56:05 -0700 py3: don't risk passing a None value to error.ManifestLookupError()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 09:56:05 -0700] rev 45489
py3: don't risk passing a None value to error.ManifestLookupError() This makes the test case added in 20dd2a259b0f (test-grep: add tests for --follow with/without --diff and/or paths, 2020-09-11) pass on Python 3. Differential Revision: https://phab.mercurial-scm.org/D9030
Thu, 03 Sep 2020 13:25:29 +0530 merge: move initial handling of mergeactions near to later one
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 03 Sep 2020 13:25:29 +0530] rev 45488
merge: move initial handling of mergeactions near to later one We build `mergeactions` in the beginning and use it in end. Let's build it just before where it will be used. Helps making code much easier to understand. Differential Revision: https://phab.mercurial-scm.org/D8983
Thu, 25 Jun 2020 13:16:55 +0530 upgrade: support running upgrade if repository has share-safe requirement
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 25 Jun 2020 13:16:55 +0530] rev 45487
upgrade: support running upgrade if repository has share-safe requirement This helps us in testing changing requirements of source repository and checking that the shared repository works. Differential Revision: https://phab.mercurial-scm.org/D8660
Thu, 17 Sep 2020 18:49:57 -0700 config: add `--shared` flag to edit config file of shared source
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 17 Sep 2020 18:49:57 -0700] rev 45486
config: add `--shared` flag to edit config file of shared source With `format.exp-share-safe` enabled, we now read the `.hg/hgrc` of the shared source also. This patch adds `--shared` flag to `hg config` command which can be used to edit that shared source config file. It only works if the repository is shared one and is shared using the safe method. Differential Revision: https://phab.mercurial-scm.org/D8659
Thu, 02 Jul 2020 16:23:36 +0530 localrepo: load the share source .hg/hgrc also in share-safe mode (API)
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 02 Jul 2020 16:23:36 +0530] rev 45485
localrepo: load the share source .hg/hgrc also in share-safe mode (API) The second part of the Share Safe Plan is to share source repo config also. This patch adds logic to load the source repo .hg/hgrc if we are in share safe mode. On unshare, we copy and prepend source config to current repo so that config which was shared is persisted. A test is added to show that now if we enable a hook on the source repo, that also runs on the shared repositories. API change as a new optional argument sharedvfs added to localrepo.loadhgrc() Differential Revision: https://phab.mercurial-scm.org/D8656
Fri, 07 Aug 2020 17:42:15 +0530 helptext: document exp-sharesafe in internals/requirements.txt
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 07 Aug 2020 17:42:15 +0530] rev 45484
helptext: document exp-sharesafe in internals/requirements.txt `exp-sharesafe` is a new requirement and we should document it. Differential Revision: https://phab.mercurial-scm.org/D8914
Tue, 14 Apr 2020 21:07:09 +0530 share: introduce config option to store requires in .hg/store
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 14 Apr 2020 21:07:09 +0530] rev 45483
share: introduce config option to store requires in .hg/store This introduces a config option which enabled stores the requirements on a repository in store instead. When enabled, `.hg/requires` will contain the `share-safe` requirement which marks that the requirements are present in the store. This is done so that repository requirements can be shared with shares made using `hg share` command. After this patch, `hg share` checks whether the source repository has share-safe requirement, if yes, it does not copy the requirements. Test for the new functionality is added and a test case in exitsing share tests is also added. Differential Revision: https://phab.mercurial-scm.org/D8633
Fri, 07 Aug 2020 16:11:19 +0530 scmutil: introduce filterrequirements() to split reqs into wc and store ones
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 07 Aug 2020 16:11:19 +0530] rev 45482
scmutil: introduce filterrequirements() to split reqs into wc and store ones In upcoming patches where we try to implement requirements in store, we will need a mechanism to split all requirements on some basis and decide which one goes to `.hg/requires` and which one goes to `.hg/store/requires`. This patch introduce a separate function for that. Filtering logic for now is put under an `if False:`. In upcoming patches it will be removed. Differential Revision: https://phab.mercurial-scm.org/D8913
Thu, 17 Sep 2020 18:28:53 -0700 remotefilelog: acquire lock before writing requirements on clone
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 17 Sep 2020 18:28:53 -0700] rev 45481
remotefilelog: acquire lock before writing requirements on clone Performing a shallow clone in remotefilelog does not acquire lock. This leads to following warning when we try to write some requirements in store: ``` --- /home/gps/src/hg-committed/tests/test-remotefilelog-share.t +++ /home/gps/src/hg-committed/tests/test-remotefilelog-share.t#safe.err @@ -28,6 +28,7 @@ $ hgcloneshallow ssh://user@dummy/master source --noupdate -q + devel-warn: write with no lock: "requires" at: /home/gps/src/hg-committed/mercurial/scmutil.py:1505 (writerequires) $ hg share source dest updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved ``` Let's lock before writing the requirements file. Another solution which I can think of is not warn about missing lock when writing to requires file in store. Differential Revision: https://phab.mercurial-scm.org/D8952
Thu, 10 Sep 2020 14:23:12 +0900 grep: make -frREV follow history from the specified revision (BC)
Yuya Nishihara <yuya@tcha.org> [Thu, 10 Sep 2020 14:23:12 +0900] rev 45480
grep: make -frREV follow history from the specified revision (BC) This is close to what "log -frREV" will do, and is backported from 8b4b9ee6001a, "log: make -fr show complete history from the given revs" except for the "del opts['follow']" bit. I'm planning to rewrite cmdutil.walkchangerevs() to share the core logic with logcmdutil, and this is the first step towards that. There are still many broken tests, but the fundamental behavior should be fixed by this patch. .. bc:: `hg grep -fr REV` now follows history from the specified `REV`, works in the same way as `hg log -fr REV`. The previous behavior was to limit the search space to `REV` while following the history.
Fri, 11 Sep 2020 18:33:41 +0900 cmdutil: make walkchangerevs() gracefully handle wdir parents
Yuya Nishihara <yuya@tcha.org> [Fri, 11 Sep 2020 18:33:41 +0900] rev 45479
cmdutil: make walkchangerevs() gracefully handle wdir parents This code will be completely rewritten, but test-grep.t would fail without fixing it.
Thu, 10 Sep 2020 13:30:34 +0900 grep: fix --follow with no --diff nor --rev to not fall back to plain grep
Yuya Nishihara <yuya@tcha.org> [Thu, 10 Sep 2020 13:30:34 +0900] rev 45478
grep: fix --follow with no --diff nor --rev to not fall back to plain grep Before, "grep --follow" would only print matches in the working directory. Since --follow is the option to specify the search space, it should disable the plain (i.e. wdir) grep.
Fri, 11 Sep 2020 12:39:45 +0900 test-grep: add tests for --follow with/without --diff and/or paths
Yuya Nishihara <yuya@tcha.org> [Fri, 11 Sep 2020 12:39:45 +0900] rev 45477
test-grep: add tests for --follow with/without --diff and/or paths This tests the behavior of cmdutil.walkchangerevs(). I'm going to rewrite cmdutil.walkchangerevs() to leverage the "log -f" logic, but the code coverage looked quite small. And the history traversal of "grep -f" goes wrong in various ways.
Thu, 10 Sep 2020 13:10:53 +0900 grep: clarify that --all works exactly the same way as --diff
Yuya Nishihara <yuya@tcha.org> [Thu, 10 Sep 2020 13:10:53 +0900] rev 45476
grep: clarify that --all works exactly the same way as --diff 7fbb5d76c555 "grep: add --diff flag" says as such, but the help strings have diverged since, and it's getting fuzzier what this --all will do.
Thu, 17 Sep 2020 15:34:13 +0200 churn: add an usage example in docstring
"Stephane" <stephane@yaal.fr> [Thu, 17 Sep 2020 15:34:13 +0200] rev 45475
churn: add an usage example in docstring
Thu, 17 Sep 2020 15:47:19 +0530 tests: run test-check-py3-compat only in pure python mode
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 17 Sep 2020 15:47:19 +0530] rev 45474
tests: run test-check-py3-compat only in pure python mode This test was added few years ago to detect syntax and import related warnings and kickstart the python-3 porting efforts. It tries to parse the ast and import the module. When using in strict modes like `HGMODULEPOLICY=rust` or `HGMODULEPOLICY=c`, the test fails. Let's run the test only on pure python mode. We now have full test suite being run with python 3 and some people even use hg with python 3 in production (like me).
Sat, 12 Sep 2020 07:23:47 +0900 log: make -frREV PATH detect missing files before falling back to slow path
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Sep 2020 07:23:47 +0900] rev 45473
log: make -frREV PATH detect missing files before falling back to slow path If -rREV isn't specified, "log --follow" would abort on nonexistent paths. Let's implement this behavior for "-frREV" case as we have ctx.hasdir() now. Otherwise "log -frREV PATH" would silently fall back to slow path and files wouldn't be followed across renames. The loop is quadratic (as before), but the size of the startctxs and match.files() should be small in general. Some tests are marked as BROKEN since file renames aren't tracked in the slow path. This is a known limitation of the current history traversal function.
Fri, 11 Sep 2020 15:13:35 +0900 log: fix -fr'wdir()' PATH to follow newly added file
Yuya Nishihara <yuya@tcha.org> [Fri, 11 Sep 2020 15:13:35 +0900] rev 45472
log: fix -fr'wdir()' PATH to follow newly added file Testing filelog doesn't make sense in this case because the file existence is tested against the specified changectxs. If the filelog is empty and if startctxs != [wctx], 'f not in c' should be triggered.
Fri, 11 Sep 2020 15:08:58 +0900 log: reorganize if-else and for loop in logcmdutil._makematcher()
Yuya Nishihara <yuya@tcha.org> [Fri, 11 Sep 2020 15:08:58 +0900] rev 45471
log: reorganize if-else and for loop in logcmdutil._makematcher() The test conditions are branchy depending on --follow and --rev options, so it should be better to switch first by --follow --rev. Note that revs is not empty so "if follow and startctxs" can be replaced with "if follow and opts.get(b'rev')".
Wed, 26 Aug 2020 16:37:23 +0530 merge: update commitinfo from all mergeresults during bid merge
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 26 Aug 2020 16:37:23 +0530] rev 45470
merge: update commitinfo from all mergeresults during bid merge During bid merge, it's not clear which commitinfo should be stored and which one should not. This depends on which side the bid merge chooses for a file. For this we will need to refactor bid merge code and commitinfo handling. For now, we just blindly updates info since we hardly have any users of commitinfo and this will help us in testing and clearing out further path. Differential Revision: https://phab.mercurial-scm.org/D8965
Mon, 24 Aug 2020 17:22:28 +0530 merge: add missing ACTION_KEEP when both remote and ancestor are not present
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 24 Aug 2020 17:22:28 +0530] rev 45469
merge: add missing ACTION_KEEP when both remote and ancestor are not present Previous patch may lead to confusion that the related criss-cross merge is consistent when done from any of the parents. However this is not true and we were missing setting an ACTION_KEEP. This patch now exposes that bid-merge favors ACTION_KEEP always and the result of merge is different when started from different parents. This change also effects a test case above where bid merge was wrongly picking `r` because it was missing keep related information from one of the ancestor. After this test, we are back in a state in the criss-cross merge tests where the result depends on which parent we are merging from. Differential Revision: https://phab.mercurial-scm.org/D8941
Mon, 24 Aug 2020 15:20:09 +0530 merge: store ACTION_KEEP_ABSENT when we are keeping the file absent locally
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 24 Aug 2020 15:20:09 +0530] rev 45468
merge: store ACTION_KEEP_ABSENT when we are keeping the file absent locally If a file is not present on the local side, and it's unchanged between other merge parent and ancestor, we don't use any action, neither we had a if-else branch for that condition. This leads to bid-merge missing that there is a such action possible which can be performed. As test changes demonstrate, we now choose the locally deleted side instead of choosing the remote one consistently. This is also wrong behavior which is resulted because of missing possible action. It will be fixed in next patch. This whole logic is not acurrate as we should prompt user on what to do when this kind of criss-cross merge is in play. Differential Revision: https://phab.mercurial-scm.org/D8940
Tue, 01 Sep 2020 17:08:26 +0530 merge: add `ACTION_KEEP_ABSENT` to represent files we want to keep absent
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 01 Sep 2020 17:08:26 +0530] rev 45467
merge: add `ACTION_KEEP_ABSENT` to represent files we want to keep absent There are files which were deleted/not present in working copy parent but were present on other side of merge. On merge, we might decide to keep them deleted. We want to track such cases more closely, rather all kind of cases which results from some kind of merging logic. We do have `ACTION_KEEP` but having a dedicated action for the absent case is more cleaner. Initially I named the action as `ACTION_KEEP_DELETED` but later realized that file can be not-present because of other reasons than deletion like rename, hence decided to use more generic name `ACTION_KEEP_ABSENT`. Differential Revision: https://phab.mercurial-scm.org/D8974
Mon, 14 Sep 2020 13:51:39 +0530 mergeresult: introduce dedicated tuple for no-op actions
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 14 Sep 2020 13:51:39 +0530] rev 45466
mergeresult: introduce dedicated tuple for no-op actions This will help us in adding more no-op actions in next patch while keeping the code cleaner.
Fri, 19 Jun 2020 13:27:46 +0200 tests: add criss cross merging tests whose behavior need to be fixed
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 19 Jun 2020 13:27:46 +0200] rev 45465
tests: add criss cross merging tests whose behavior need to be fixed Merging two changesets can mark a file as removed post merge. However, in some cases, a user might not want to remove that file and they revert the removal back and commit the merge. All this works perfectly well. However, when we do criss-cross merges with such merge where user explicitly choose to revert the removal with one where another user choose the removal, we does not get any conflict. The intent here is conflicting and merge should result in conflicts. One user merged and want to keep the file while other user merged and want to remove the file. Merging those merges should result in conflicts. This patch adds test cases for these cases. Differential Revision: https://phab.mercurial-scm.org/D8939
Fri, 11 Sep 2020 15:52:06 -0700 repo: avoid copying/updating a dict on every `repo.__getitem__`
Kyle Lippincott <spectral@google.com> [Fri, 11 Sep 2020 15:52:06 -0700] rev 45464
repo: avoid copying/updating a dict on every `repo.__getitem__` This has some mild performance benefits. I'm looking into a pathological case where one of our `hg log` invocations takes several seconds, and according to hyperfine this reduces the wall time of the entire operation (running in chg) from: ``` Time (mean ± σ): 7.390 s ± 0.106 s [User: 7.058 s, System: 0.271 s] Range (min … max): 7.300 s … 7.625 s ``` to: ``` Time (mean ± σ): 7.046 s ± 0.091 s [User: 6.714 s, System: 0.279 s] Range (min … max): 6.916 s … 7.169 s ``` Note: the log command is slow due to an issue in our custom stuff executing `repo[<arg>]` 298,800 times. This performance improvement is likely not noticeable during normal operation, but I don't feel like it's making the code more difficult to understand, and every small bit helps. Differential Revision: https://phab.mercurial-scm.org/D9022
Thu, 23 Jul 2020 20:23:44 +0200 obsstore: refactor v1 logic to fix 32 byte hash support
Joerg Sonnenberger <joerg@bec.de> [Thu, 23 Jul 2020 20:23:44 +0200] rev 45463
obsstore: refactor v1 logic to fix 32 byte hash support Refactor the v1 logic to determine the node parsing based on the flag. Move the predecessor out of the fixed part and handle it like the other nodes, removing most of the duplicated code for parsing 20/32 bytes hashes. Differential Revision: https://phab.mercurial-scm.org/D8801
Mon, 14 Sep 2020 11:32:24 -0400 fsmonitor: increase the threshold before we recommend it, when using rust
Valentin Gatien-Baron <vgatien-baron@janestreet.com> [Mon, 14 Sep 2020 11:32:24 -0400] rev 45462
fsmonitor: increase the threshold before we recommend it, when using rust 50k files works just fine with the rust status, and it's annoying to get told "consider using fsmonitor" when we have another solution to the status speed. 400k files was not chosen in any rigorous way. I know 200k files is fine. Twice as many files should still be fine. Differential Revision: https://phab.mercurial-scm.org/D9021
Fri, 19 Jun 2020 06:15:06 +0200 copy-tracing: test case where a merge reverted a file deletion
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 19 Jun 2020 06:15:06 +0200] rev 45461
copy-tracing: test case where a merge reverted a file deletion This case is currently broken for commit centric copy tracing. So we add an official case for it with a note about it being broken. Fixing it will requires multiples change in code related to merge, commit and copy tracing, so we introduce it beforehand for simplicity. Also, I have been sitting on this test for 3 months so I would rather have it upstream.
Fri, 19 Jun 2020 06:04:48 +0200 copy-tracing: test case where we go across a changed/deleted merge
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 19 Jun 2020 06:04:48 +0200] rev 45460
copy-tracing: test case where we go across a changed/deleted merge This case is currently broken in the commit centric case. So we add an official case for it with a note about it being broken. Fixing it will requires multiples change in code related to merge, commit and copy tracing, so we introduce it beforehand for simplicity. Also, I have been sitting on this test for 3 months so I would rather have it upstream.
Wed, 26 Aug 2020 17:20:53 +0530 merge: show list of bids for each file in bid-merge in ui.debug()
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 26 Aug 2020 17:20:53 +0530] rev 45459
merge: show list of bids for each file in bid-merge in ui.debug() Earlier, we were showing the list of bids only when we were ambiguously picking. However, the cases where we unambiguously picked a side may not always be correct and need to be fixed. Having list of bids for all files will be helpful in debugging. Differential Revision: https://phab.mercurial-scm.org/D8966
Mon, 14 Sep 2020 19:39:51 +0900 merge with stable
Yuya Nishihara <yuya@tcha.org> [Mon, 14 Sep 2020 19:39:51 +0900] rev 45458
merge with stable
Sun, 13 Sep 2020 17:52:24 +0900 cmdutil: reimplement finddate() without using walkchangerevs()
Yuya Nishihara <yuya@tcha.org> [Sun, 13 Sep 2020 17:52:24 +0900] rev 45457
cmdutil: reimplement finddate() without using walkchangerevs() It's simpler and slightly faster maybe because a fewer Python ops would run. Unscientific benchmark: $ python -m timeit \ -s 'from mercurial import hg, ui, cmdutil; repo = hg.repository(ui.ui())' \ 'cmdutil.finddate(repo.ui, repo, "<2008-01-01")' (orig) 10 loops, best of 3: 1.45 sec per loop (new) 10 loops, best of 3: 1.25 sec per loop Now "hg churn" and "hg grep" are the only users of walkchangerevs(), which I want to refactor and fix bugs.
Sun, 13 Sep 2020 18:14:51 +0900 test-simple-update: add test for -d DATE option
Yuya Nishihara <yuya@tcha.org> [Sun, 13 Sep 2020 18:14:51 +0900] rev 45456
test-simple-update: add test for -d DATE option I couldn't find any tests for cmdutil.finddate() except for the abort case.
Sun, 13 Sep 2020 17:46:48 +0900 largefiles: walk history in ascending order while downloading all lfiles
Yuya Nishihara <yuya@tcha.org> [Sun, 13 Sep 2020 17:46:48 +0900] rev 45455
largefiles: walk history in ascending order while downloading all lfiles I don't think the order matters. Maybe it's purely because of the use of walkchangerevs(), which was originally designed for "hg log" command. Surprisingly, the number of objects fetched in test-largefiles.t has changed. According to the --verbose output, the order of the following fetches flipped and the latter got deduplicated. getting large3:eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store getting sub/large4:eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
Sun, 13 Sep 2020 17:43:19 +0900 largefiles: replace use of walkchangerevs() with simple revset query
Yuya Nishihara <yuya@tcha.org> [Sun, 13 Sep 2020 17:43:19 +0900] rev 45454
largefiles: replace use of walkchangerevs() with simple revset query Since it does nothing in prepare(), what we're doing is just walking revisions matching ".hglf" in reverse order.
Fri, 11 Sep 2020 10:47:17 +0900 largefiles: remove unused 'rev' parameter from downloadlfiles()
Yuya Nishihara <yuya@tcha.org> [Fri, 11 Sep 2020 10:47:17 +0900] rev 45453
largefiles: remove unused 'rev' parameter from downloadlfiles() It's no longer used since 83ead8cb0ff2 "largefiles: implement pull --all-largefiles as a special case of --lfrev."
Sat, 12 Sep 2020 11:18:12 -0700 resourceutil: document when we expect to take the importlib.resouces code path
Martin von Zweigbergk <martinvonz@google.com> [Sat, 12 Sep 2020 11:18:12 -0700] rev 45452
resourceutil: document when we expect to take the importlib.resouces code path Differential Revision: https://phab.mercurial-scm.org/D9018
Thu, 10 Sep 2020 22:00:00 -0700 templater: fix reading of templates in frozen binaries with py3 < 3.7
Martin von Zweigbergk <martinvonz@google.com> [Thu, 10 Sep 2020 22:00:00 -0700] rev 45451
templater: fix reading of templates in frozen binaries with py3 < 3.7 When using a frozen binary with py3 < 3.7, there's no `importlib.resources` module, so we use the code path that reads the resources from the file system. That code path expects bytes for package name and resource name. Differential Revision: https://phab.mercurial-scm.org/D9008
Fri, 11 Sep 2020 09:35:49 -0700 histedit: cache description line
Martin von Zweigbergk <martinvonz@google.com> [Fri, 11 Sep 2020 09:35:49 -0700] rev 45450
histedit: cache description line Navigating the curses-based histedit interface can be pretty slow because it redraws everything whenever you make a change. This patch simply replaces `@property` by `@util.propertycache` on the `histeditrule.desc()` function so it's not re-calculated every time the screen needs to be re-rendered. I timed it on an example of 30 simple commits, where I moved the top commit down 25 steps and then up 25 steps after. Before this patch, that (the whole `hg histedit` invocation) took 11.6 s of CPU and after this patch it took 0.8 s). Differential Revision: https://phab.mercurial-scm.org/D9016
Fri, 11 Sep 2020 09:55:08 -0700 tests: make emacs test less strict
Martin von Zweigbergk <martinvonz@google.com> [Fri, 11 Sep 2020 09:55:08 -0700] rev 45449
tests: make emacs test less strict It was failing like this for me: ``` @@ -2,7 +2,7 @@ $ emacs -q -no-site-file -batch -l $TESTDIR/../contrib/hg-test-mode.el \ > -f ert-run-tests-batch-and-exit Running 1 tests (*) (glob) - passed 1/1 hg-test-mode--compilation-mode-support + passed 1/1 hg-test-mode--compilation-mode-support (0.045732 sec) - Ran 1 tests, 1 results as expected (*) (glob) + Ran 1 tests, 1 results as expected, 0 unexpected (2020-09-11 16:49:56+0000, 0.046034 sec) ``` Differential Revision: https://phab.mercurial-scm.org/D9017
Thu, 10 Sep 2020 13:12:34 -0700 graphlog: use '%' only if there are *unresolved* conflicts
Martin von Zweigbergk <martinvonz@google.com> [Thu, 10 Sep 2020 13:12:34 -0700] rev 45448
graphlog: use '%' only if there are *unresolved* conflicts In 14d0e89520a2, I made graphlog use '%' for the "other" context when there's an existing merge state. However, that has confused many people because it shows up even if all conflicts are already resolved, which makes it show up even after e.g. `hg update -m` with automatically resolved conflicts. This patch makes it so we show the '%' only if there still unresolved conflicts. This patch replaces my earlier attempt in D8930, where I decided to automatically clear the mergestate if there are no remaining conflicts. That had the problem that it wouldn't let the user re-resolve the conflicts using `hg resolve`. Note that an in-progress "proper" merge (one that will result in a commit with two parents, such as after `hg merge`) will already have two dirstate parents before the commit happens. That means that both sides of the merge will get drawn as '@' in the graph, since "is dirstate parent" takes precedence over "is involved in merge conflict". Differential Revision: https://phab.mercurial-scm.org/D9007
Wed, 26 Aug 2020 17:24:22 +0530 merge: show number of ancestors in bid merge debug notes
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 26 Aug 2020 17:24:22 +0530] rev 45447
merge: show number of ancestors in bid merge debug notes A good number of times, we don't generate an action for a file in manifestmerge() which can result in bid merge doing the wrong thing. Mentioning the number of ancestors from which we are bidding will help spot such cases where we are not returning an action. Differential Revision: https://phab.mercurial-scm.org/D8967
(0) -30000 -10000 -3000 -1000 -300 -100 -64 +64 +100 +300 +1000 +3000 tip