Wed, 16 Sep 2020 18:09:32 +0530 mergestate: define NO_OP_ACTION in module scope instead of inside mergeresult
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 16 Sep 2020 18:09:32 +0530] rev 45525
mergestate: define NO_OP_ACTION in module scope instead of inside mergeresult This makes sure it isn't intended to be overridden by subclasses. Thanks to Yuya for the nice suggestion. Differential Revision: https://phab.mercurial-scm.org/D9025
Wed, 09 Sep 2020 16:49:19 +0530 mergestate: introduce a new ACTION_KEEP_NEW
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 09 Sep 2020 16:49:19 +0530] rev 45524
mergestate: introduce a new ACTION_KEEP_NEW `ACTION_KEEP` is overloaded and it's hard to figure out how we end up with this KEEP, what was the state of things. In a previous patch, we introduced `ACTION_KEEP_ABSENT` which represents files which are kept absent in the working directory. There is another special case where we keep the file when it's not present on both ancestor and remote side. We introduce a dedicated action for that. The goal is to use these information to make bid merge smarter. Differential Revision: https://phab.mercurial-scm.org/D9002
Wed, 23 Sep 2020 15:36:15 -0700 repoview: don't crash if mergestate points to non-existent node stable
Martin von Zweigbergk <martinvonz@google.com> [Wed, 23 Sep 2020 15:36:15 -0700] rev 45523
repoview: don't crash if mergestate points to non-existent node Differential Revision: https://phab.mercurial-scm.org/D9078
Wed, 23 Sep 2020 16:07:14 -0700 tests: demonstrate crash caused by pinning of non-existent mergestate node stable
Martin von Zweigbergk <martinvonz@google.com> [Wed, 23 Sep 2020 16:07:14 -0700] rev 45522
tests: demonstrate crash caused by pinning of non-existent mergestate node If the mergestate somehow contains a reference to a non-existent node, it causes most commands to crash since aaeccdb6e654 (repoview: pin revisions for `local` and `other` when a merge is active, 2020-09-04). This patch adds a test showing that. Differential Revision: https://phab.mercurial-scm.org/D9077
Mon, 21 Sep 2020 10:23:25 -0400 git: also convert timezone to int (issue6359)
Augie Fackler <augie@google.com> [Mon, 21 Sep 2020 10:23:25 -0400] rev 45521
git: also convert timezone to int (issue6359) Credit to moshez for testing this in the wild. Differential Revision: https://phab.mercurial-scm.org/D9062
Fri, 18 Sep 2020 16:26:37 -0700 chg: fallback to original hg if stdio fds are missing
Jun Wu <quark@fb.com> [Fri, 18 Sep 2020 16:26:37 -0700] rev 45520
chg: fallback to original hg if stdio fds are missing If stdio fds are missing (ex. fd 0 is not present), chg might open fds that take the numbers 0, and attachio would send the wrong fds to the client, which might cause unwanted behaviors. Avoid that by detecting the missing fds and falling back to the original hg. Differential Revision: https://phab.mercurial-scm.org/D9058
Fri, 18 Sep 2020 08:27:43 -0700 locking: remove support for inheriting locks in subprocess
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Sep 2020 08:27:43 -0700] rev 45519
locking: remove support for inheriting locks in subprocess This seems to have been added for merge driver, and since merge driver is now gone... Differential Revision: https://phab.mercurial-scm.org/D9053
Thu, 17 Sep 2020 22:34:36 -0700 mergedriver: delete it
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 22:34:36 -0700] rev 45518
mergedriver: delete it The merge driver code was added in late 2015. I think '406a654b::6f045b56 & user("sid0")' is a reasonable revset for finding the relevant commits, including preparation for it. The code is very poorly tested, which makes it very hard to maintain. It seems it's only used by FB and they don't use this code base anymore, so let's remove the code to make it easier for us to maintain our product. Differential Revision: https://phab.mercurial-scm.org/D9041
Sun, 06 Sep 2020 10:33:12 +0200 rust-cpython: switch logging facade from `simple_logger` to `env_logger`
Raphaël Gomès <rgomes@octobus.net> [Sun, 06 Sep 2020 10:33:12 +0200] rev 45517
rust-cpython: switch logging facade from `simple_logger` to `env_logger` `simple_logger` is just too simple. `env_logger` supports logging to `stderr`, and logging filtering, for example, which are becoming necessary now. The project is nicely active. Differential Revision: https://phab.mercurial-scm.org/D8990
Tue, 22 Sep 2020 09:06:09 -0400 git: pass `id` attribute of `pygit2.Tree` object
Connor Sheehan <sheehan@mozilla.com> [Tue, 22 Sep 2020 09:06:09 -0400] rev 45516
git: pass `id` attribute of `pygit2.Tree` object `pygit2`'s Repository object expects an instance of `Oid` to return the corresponding object, instead of the object itself. After this change and D9062, `hg commit -i` seems to work, unless it hits a case folding assertion (ie trying to add a file like `README.md`). Differential Revision: https://phab.mercurial-scm.org/D9068
Wed, 16 Sep 2020 12:13:46 -0700 branchmap: add a cache validation cache, avoid expensive re-hash on every use
Kyle Lippincott <spectral@google.com> [Wed, 16 Sep 2020 12:13:46 -0700] rev 45515
branchmap: add a cache validation cache, avoid expensive re-hash on every use In a pathological `hg log` case, we end up executing the branchmap validity checking twice per commit displayed. Or maybe we always do, and I just noticed because it's really slow in this repo for some reason. Before: ``` Time (mean ± σ): 9.816 s ± 0.071 s [User: 9.435 s, System: 0.392 s] Range (min … max): 9.709 s … 9.920 s ``` After: ``` Time (mean ± σ): 8.671 s ± 0.078 s [User: 8.309 s, System: 0.392 s] Range (min … max): 8.594 s … 8.816 s ``` Differential Revision: https://phab.mercurial-scm.org/D9023
Mon, 21 Sep 2020 15:05:38 -0400 merge with stable
Augie Fackler <augie@google.com> [Mon, 21 Sep 2020 15:05:38 -0400] rev 45514
merge with stable
Wed, 16 Sep 2020 19:32:53 +0200 run-test: allow relative path in `--blacklist` and `--whitelist` (issue6351)
Antoine cezar<acezar@chwitlabs.fr> [Wed, 16 Sep 2020 19:32:53 +0200] rev 45513
run-test: allow relative path in `--blacklist` and `--whitelist` (issue6351) When specifying a test with `--blacklist` or `--whitelist` with path relatives to the repository root (eg: `tests/test-check-commit.t`) the file is not taken into account. It only works when the name of the test is given. It would be better if `--blacklist` and `--whitelist` behaviors where compatible with `--test-list`. This patch allows to use relative path with `--blacklist` and `--whitelist` while staying compatible with the old behavior by checking the test relative path in addition to its name. Differential Revision: https://phab.mercurial-scm.org/D9024
Fri, 18 Sep 2020 15:10:14 -0700 rebase: stop clearing on-disk mergestate when running in memory
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Sep 2020 15:10:14 -0700] rev 45512
rebase: stop clearing on-disk mergestate when running in memory In-memory merge no longer uses on-disk mergestate since 19590b126764 (merge: use in-memory mergestate when using in-memory context, 2020-09-15). This patch removes the clearing from two places in the in-memory rebase code. I've verified that the one with a TODO was indeed fixed by the aforementioned commit. The other instance doesn't seem to have any test coverage, but I'm pretty confident it's also safe to remove. Differential Revision: https://phab.mercurial-scm.org/D9057
Fri, 18 Sep 2020 10:15:13 -0700 rebase: delete unused p1 argument to _concludenode()
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Sep 2020 10:15:13 -0700] rev 45511
rebase: delete unused p1 argument to _concludenode() Unused since a0192a03216d (rebase: remove now unnecessary logic to allow empty commit when branch changes, 2020-07-09). Differential Revision: https://phab.mercurial-scm.org/D9055
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.
(0) -30000 -10000 -3000 -1000 -300 -100 -60 +60 +100 +300 +1000 +3000 tip