Thu, 15 Oct 2020 22:36:17 -0700 serve: leverage cmdutil.check_incompatible_arguments()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 15 Oct 2020 22:36:17 -0700] rev 45744
serve: leverage cmdutil.check_incompatible_arguments() Differential Revision: https://phab.mercurial-scm.org/D9222
Thu, 15 Oct 2020 22:36:08 -0700 revert: leverage cmdutil.check_incompatible_arguments()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 15 Oct 2020 22:36:08 -0700] rev 45743
revert: leverage cmdutil.check_incompatible_arguments() Differential Revision: https://phab.mercurial-scm.org/D9221
Thu, 15 Oct 2020 22:23:45 -0700 incoming: leverage cmdutil.check_incompatible_arguments()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 15 Oct 2020 22:23:45 -0700] rev 45742
incoming: leverage cmdutil.check_incompatible_arguments() Differential Revision: https://phab.mercurial-scm.org/D9220
Thu, 15 Oct 2020 22:23:35 -0700 grep: levarage cmdutil.check_incompatible_arguments()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 15 Oct 2020 22:23:35 -0700] rev 45741
grep: levarage cmdutil.check_incompatible_arguments() Differential Revision: https://phab.mercurial-scm.org/D9219
Thu, 15 Oct 2020 21:48:43 -0700 import: leverage cmdutil.check_incompatible_arguments()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 15 Oct 2020 21:48:43 -0700] rev 45740
import: leverage cmdutil.check_incompatible_arguments() Differential Revision: https://phab.mercurial-scm.org/D9217
Thu, 15 Oct 2020 21:44:03 -0700 backout: leverage cmdutil.check_incompatible_arguments()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 15 Oct 2020 21:44:03 -0700] rev 45739
backout: leverage cmdutil.check_incompatible_arguments() Differential Revision: https://phab.mercurial-scm.org/D9216
Mon, 12 Oct 2020 12:52:45 -0700 transaction: use ProgrammingError for when an committed transaction is used
Martin von Zweigbergk <martinvonz@google.com> [Mon, 12 Oct 2020 12:52:45 -0700] rev 45738
transaction: use ProgrammingError for when an committed transaction is used It seems to me that ProgrammingError is the right type of error here. Differential Revision: https://phab.mercurial-scm.org/D9215
Mon, 05 Oct 2020 17:18:39 -0400 hook: ignore EPIPE when flushing stdout/stderr
Mitchell Plamann <mplamann@janestreet.com> [Mon, 05 Oct 2020 17:18:39 -0400] rev 45737
hook: ignore EPIPE when flushing stdout/stderr This fixes the bug described in the parent commit. test-transaction-rollback-on-sigpipe.t is updated to show the new behavior. Differential Revision: https://phab.mercurial-scm.org/D9152
Mon, 05 Oct 2020 13:23:16 -0400 test: add test-transaction-rollback-on-sigpipe.t demonstrating py3 regression
Mitchell Plamann <mplamann@janestreet.com> [Mon, 05 Oct 2020 13:23:16 -0400] rev 45736
test: add test-transaction-rollback-on-sigpipe.t demonstrating py3 regression When an hg push is interrupted with C-c, the remote [hg serve] command receives SIGPIPE. If a pretxnchangegroup hook fails, the remote hg then tries to rollback the transaction. It begins by printing "transaction abort!\n". This returns EPIPE, but ui.py ignores that error. In python3 (but not python2), this "transaction abort!\n" message stays in a buffer, so future flushes of stderr will try to print the message again, and so those flushes will also hit EPIPE. This test demonstrates such a case where this EPIPE causes the transaction rollback to fail, leaving behind an abandoned transaction. Differential Revision: https://phab.mercurial-scm.org/D9151
Tue, 13 Oct 2020 05:14:37 +0200 upgrade: allow sidedata upgrade to modify revision flag
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Oct 2020 05:14:37 +0200] rev 45735
upgrade: allow sidedata upgrade to modify revision flag In the process, we fix the lack of HAS_COPIES_INFO flag on upgrade, and test the results. Differential Revision: https://phab.mercurial-scm.org/D9199
Tue, 13 Oct 2020 03:30:49 +0200 sidedata: return enough data to set the proper flag in the future
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Oct 2020 03:30:49 +0200] rev 45734
sidedata: return enough data to set the proper flag in the future If the revision has information relevant to copy tracing, we need to set a dedicated flag in revlog. Currently the upgrade process is failing to do so. Before we teach the upgrade process about flags, we make the information available where we will needs it. Differential Revision: https://phab.mercurial-scm.org/D9198
Tue, 13 Oct 2020 02:49:03 +0200 test: move upgrade run and check earlier in test-copies-chain-merge
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Oct 2020 02:49:03 +0200] rev 45733
test: move upgrade run and check earlier in test-copies-chain-merge We are about to introduce an explicit case for copy tracing after a upgrade. So I am moving the code around beforehand for clarity. Differential Revision: https://phab.mercurial-scm.org/D9196
Tue, 13 Oct 2020 02:45:24 +0200 copies: split creation of the graph and actual checking again
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Oct 2020 02:45:24 +0200] rev 45732
copies: split creation of the graph and actual checking again The re-install the old split. It will be necessary to test that the upgrade process produced a functionally identical result. It will be useful to detect case where the metadata we look at identical, but some other items we did not checked are missing. (spoiler: we will find some bug) Differential Revision: https://phab.mercurial-scm.org/D9195
Thu, 15 Oct 2020 10:28:27 -0700 copy: clarify in help text that `hg co --forget` takes a *destination* file
Martin von Zweigbergk <martinvonz@google.com> [Thu, 15 Oct 2020 10:28:27 -0700] rev 45731
copy: clarify in help text that `hg co --forget` takes a *destination* file We had a user who tried to pass a source file. The command then fails with `<file>: not unmarking as copy - file is not marked as copied`, so at least it's not just silent, but let's be a little clearer in the documentation. Differential Revision: https://phab.mercurial-scm.org/D9214
Thu, 15 Oct 2020 15:57:31 +0200 test: check server error output in `test-pull-bundle.t`
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 15 Oct 2020 15:57:31 +0200] rev 45730
test: check server error output in `test-pull-bundle.t` This is useful to debug test failure when they happens. Differential Revision: https://phab.mercurial-scm.org/D9213
Tue, 06 Oct 2020 01:51:56 +0200 unbundle: free temporary objects after use
Joerg Sonnenberger <joerg@bec.de> [Tue, 06 Oct 2020 01:51:56 +0200] rev 45729
unbundle: free temporary objects after use This reduces peak RSS for larger unbundle operations by ~30 Bytes per changeset on AMD64. This can't be a direct delete for Python 2.7, so reset the object instead and leave a comment. The efilesset object can't be deleted as it is referenced by the local onchangelog function and Python 2.7 rejects a delete on the existance of a nested scope. Differential Revision: https://phab.mercurial-scm.org/D9153
Tue, 13 Oct 2020 03:23:17 +0200 changing-files: add a shorthand property to check for copy relevant info
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 13 Oct 2020 03:23:17 +0200] rev 45728
changing-files: add a shorthand property to check for copy relevant info We are going to reuse this change in more place, so we factor it out first. Differential Revision: https://phab.mercurial-scm.org/D9197
Wed, 14 Oct 2020 17:51:56 +0200 pycompat: add an entry for unnamedtmpfile
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 14 Oct 2020 17:51:56 +0200] rev 45727
pycompat: add an entry for unnamedtmpfile I am going to use unnamed temporary files to pass arbitrarily large input data to worker creating bundles. To do so, I need a unified API that work on py2 and py3. Differential Revision: https://phab.mercurial-scm.org/D9211
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
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 +3000 tip