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.
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.
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.
"Stephane" <stephane@yaal.fr> [Thu, 17 Sep 2020 15:34:13 +0200] rev 45475
churn: add an usage example in docstring
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).
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.
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.
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')".
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
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