Wed, 14 Oct 2020 21:47:14 +0200 pycompat: update comment about unnamedtempfile
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Oct 2020 21:47:14 +0200] rev 45726
pycompat: update comment about unnamedtempfile I found the comment clearer. I end up having to think about this for `TemporaryFile` and I update that one in the process. Differential Revision: https://phab.mercurial-scm.org/D9210
Tue, 08 Sep 2020 18:16:24 +0900 revset: add diff(pattern) predicate for "grep --diff"
Yuya Nishihara <yuya@tcha.org> [Tue, 08 Sep 2020 18:16:24 +0900] rev 45725
revset: add diff(pattern) predicate for "grep --diff" I find this is useful in GUI log viewer since the tool only needs to support "log -rREV" command. This is basic implementation. Windowed search is not implemented since it wouldn't work pretty well with the smartset API. And filename matcher is not supported because the syntax isn't determined. My idea is to add handling of diff(pattern, file(..)) and diff(pattern, follow(..)), which will then be evolved to a full revset+matcher combinator support: x & diff(pattern, y & z) ===== y & z builds (revs(y) & revs(z), matcher(y) & matcher(z)) pair, and narrows the search space of diff() ==================== diff() returns matched (revs, matcher) pair ======================== revs and matcher will be combined respectively by &-operator, and the matcher will optionally be used to filter "hg log -p" output The predicate name "diff()" wouldn't be great, but grep() is already used. Another options I can think of are "grepdiff()" and "containsdiff()". Naming suggestions are welcome.
Mon, 05 Oct 2020 20:40:39 +0900 stringutil: add function to compile stringmatcher pattern into regexp
Yuya Nishihara <yuya@tcha.org> [Mon, 05 Oct 2020 20:40:39 +0900] rev 45724
stringutil: add function to compile stringmatcher pattern into regexp Prepares for adding a revset predicate for "grep --diff". The grep logic needs a regexp object instead of a match function.
Wed, 14 Oct 2020 22:10:48 +0900 py3: fix stringmatcher() to byte-stringify exception message
Yuya Nishihara <yuya@tcha.org> [Wed, 14 Oct 2020 22:10:48 +0900] rev 45723
py3: fix stringmatcher() to byte-stringify exception message Spotted while writing regexp variant of stringmatcher().
Mon, 05 Oct 2020 20:53:34 +0900 stringutil: extract helper function that splits stringmatcher() pattern
Yuya Nishihara <yuya@tcha.org> [Mon, 05 Oct 2020 20:53:34 +0900] rev 45722
stringutil: extract helper function that splits stringmatcher() pattern
Wed, 09 Sep 2020 17:17:38 +0900 grep: extract main search loop as searcher method
Yuya Nishihara <yuya@tcha.org> [Wed, 09 Sep 2020 17:17:38 +0900] rev 45721
grep: extract main search loop as searcher method Still displayer part is in commands.grep(), the core grep logic is now reusable. I'll revisit the displayer stuff later since it will be another long series.
Sun, 04 Oct 2020 13:17:57 +0900 scmutil: move walkchangerevs() from cmdutil
Yuya Nishihara <yuya@tcha.org> [Sun, 04 Oct 2020 13:17:57 +0900] rev 45720
scmutil: move walkchangerevs() from cmdutil It's no longer a command-level function, but a pure helper to walk revisions in a windowed way. This change will help eliminate reverse dependency of revset.py -> grep.py -> cmdutil.py in future patches.
Wed, 09 Sep 2020 17:04:44 +0900 grep: extract public function to register file to be skipped
Yuya Nishihara <yuya@tcha.org> [Wed, 09 Sep 2020 17:04:44 +0900] rev 45719
grep: extract public function to register file to be skipped The main grep loop will be extracted to a searcher method, but this skipping condition depends on the result of display() function.
Tue, 13 Oct 2020 16:44:57 -0400 posix: avoid a leaked file descriptor in a unix domain socket exception case
Matt Harbison <matt_harbison@yahoo.com> [Tue, 13 Oct 2020 16:44:57 -0400] rev 45718
posix: avoid a leaked file descriptor in a unix domain socket exception case Differential Revision: https://phab.mercurial-scm.org/D9206
Tue, 13 Oct 2020 16:41:01 -0400 posix: use context managers in a couple of places
Matt Harbison <matt_harbison@yahoo.com> [Tue, 13 Oct 2020 16:41:01 -0400] rev 45717
posix: use context managers in a couple of places Differential Revision: https://phab.mercurial-scm.org/D9205
Wed, 14 Oct 2020 14:43:39 -0700 record: when backing up, avoid generating very long filenames
Kyle Lippincott <spectral@google.com> [Wed, 14 Oct 2020 14:43:39 -0700] rev 45716
record: when backing up, avoid generating very long filenames If the original file's path is longer than the individual filename maximum length (256 on Linux, I believe?), then this mechanism of "replace slashes with underscores" causes an error. Now, we'll produce just the "basename" of the file, plus some stuff to ensure it's unique. This can be potentially confusing for users if there's a file with the same name in multiple directories, but I suspect that this is better than just breaking. Example: `<reporoot>/a/long/path/to/somefile.txt` used to be backed up as `<reporoot>/.hg/record-backups/a_long_path_to_somefile.txt.abcdefgh`, it will now be backed up as `<reporoot>/.hg/record-backups/somefile.txt.abcdefgh` We could do the naive thing (what we were doing before) and have it to doing something with either subdirectories (`<backuproot>/a/long/path/to/somefile.txt.abcdefgh` or minimize #dirs with `<backuproot>/a_long_path/to_somefile.txt.abcdefgh`), prefix-truncated paths (such as `<backuproot>/__ath_to_somefile.txt.abcdefgh`, where that `__` elides enough to get us under 255 chars (counting the +9 we need to add!)), or hash-of-dirname (`<backuproot>/<sha1sum_of_dirname>/somefile.txt.abcdefgh`), but ultimately every option felt over engineered and that it would be more likely to cause problems than it would be to solve any, especially if it was conditional on directory length. Differential Revision: https://phab.mercurial-scm.org/D9207
Sat, 10 Oct 2020 12:43:04 +0530 mergestate: add `allextras()` to get all extras
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 10 Oct 2020 12:43:04 +0530] rev 45715
mergestate: add `allextras()` to get all extras `extras()` can only be used for getting extra for a file. However at couple of places in code, we wanted to iterate over all the extras stored with the mergestate and they were accessing the private `_stateextras`. We add a new function for this. Differential Revision: https://phab.mercurial-scm.org/D9190
Tue, 06 Oct 2020 19:11:34 +0530 mergestate: document `o` merge record state in _mergestate_base docs
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 06 Oct 2020 19:11:34 +0530] rev 45714
mergestate: document `o` merge record state in _mergestate_base docs _mergestate_base documentation serves as a nice documentation for mergestate. This also documents known merge records and known merge record states. I missed adding `o` state to it when I introduced it. Let's add it now. Differential Revision: https://phab.mercurial-scm.org/D9156
Fri, 09 Oct 2020 00:33:50 -0400 fix: update commit hash references in the new commits
Matt Harbison <matt_harbison@yahoo.com> [Fri, 09 Oct 2020 00:33:50 -0400] rev 45713
fix: update commit hash references in the new commits Differential Revision: https://phab.mercurial-scm.org/D9183
Fri, 09 Oct 2020 00:14:07 -0400 absorb: update commit hash references in the new commits
Matt Harbison <matt_harbison@yahoo.com> [Fri, 09 Oct 2020 00:14:07 -0400] rev 45712
absorb: update commit hash references in the new commits Differential Revision: https://phab.mercurial-scm.org/D9182
Thu, 08 Oct 2020 23:33:04 -0400 rewriteutil: handle dropped commits when updating description hashes
Matt Harbison <matt_harbison@yahoo.com> [Thu, 08 Oct 2020 23:33:04 -0400] rev 45711
rewriteutil: handle dropped commits when updating description hashes In looking to leverage this with the absorb extension, the old -> new mapping there allows the new value to be None. We could filter that out and not pass it to this method, but it seems worth a message to the user. (I wonder if these should be an info or warning, because it's unlikely people are using `-v` regularly.) Differential Revision: https://phab.mercurial-scm.org/D9181
Fri, 09 Oct 2020 10:20:53 +0200 dirstate-tree: move a conditional in an explicit boolean
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 09 Oct 2020 10:20:53 +0200] rev 45710
dirstate-tree: move a conditional in an explicit boolean This will help readability a bit and make the next change simpler to read. Differential Revision: https://phab.mercurial-scm.org/D9202
Thu, 08 Oct 2020 18:50:46 +0200 rust: cleanup some white space in a dock
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 08 Oct 2020 18:50:46 +0200] rev 45709
rust: cleanup some white space in a dock They seems to have sneaked there somehow. Differential Revision: https://phab.mercurial-scm.org/D9201
Sat, 10 Oct 2020 13:19:25 +0530 commit: pass ChangingFiles object as argument to _process_files
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 10 Oct 2020 13:19:25 +0530] rev 45708
commit: pass ChangingFiles object as argument to _process_files Instead of returning it, we pass it as an argument. This makes the whole if-else in `_prepare_files` a bit simpler. Else each if-else branch was creating the object. Differential Revision: https://phab.mercurial-scm.org/D9194
Sat, 10 Oct 2020 13:15:20 +0530 commit: pass mergestate into `_process_files` instead of re-reading it
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 10 Oct 2020 13:15:20 +0530] rev 45707
commit: pass mergestate into `_process_files` instead of re-reading it Differential Revision: https://phab.mercurial-scm.org/D9193
Sat, 10 Oct 2020 13:12:11 +0530 commit: move salvaged calculation a bit earlier in the function
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 10 Oct 2020 13:12:11 +0530] rev 45706
commit: move salvaged calculation a bit earlier in the function This helps us initialize mergestate before and now we can pass it into `_process_files()` instead of re-reading it there. Differential Revision: https://phab.mercurial-scm.org/D9192
Sat, 10 Oct 2020 12:53:35 +0530 commit: refactor salvage calculation to a different function
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 10 Oct 2020 12:53:35 +0530] rev 45705
commit: refactor salvage calculation to a different function Differential Revision: https://phab.mercurial-scm.org/D9191
Thu, 08 Oct 2020 09:54:38 -0700 tests: run test-copies-chain-merge.t also with copies in changesets
Martin von Zweigbergk <martinvonz@google.com> [Thu, 08 Oct 2020 09:54:38 -0700] rev 45704
tests: run test-copies-chain-merge.t also with copies in changesets We have these tests already and it seems like a waste to not run them in the changesets case. The biggest differences stem from `hg log --follow` not working with copies stored in the changeset extras. Differential Revision: https://phab.mercurial-scm.org/D9173
Thu, 08 Oct 2020 08:12:47 -0700 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com> [Thu, 08 Oct 2020 08:12:47 -0700] rev 45703
tests: add test of copies suggested by Pierre-Yves on D9159 Differential Revision: https://phab.mercurial-scm.org/D9171
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -24 +24 +50 +100 +300 +1000 +3000 tip