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.
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -6 +6 +10 +30 +100 +300 +1000 +3000 tip