Wed, 11 Dec 2019 15:06:09 -0800 config: close file even if we fail to read it
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 15:06:09 -0800] rev 43916
config: close file even if we fail to read it If we get an exception from cfg.read(), we would not close the file before this patch. This patch uses a context manager to make sure we close it. Differential Revision: https://phab.mercurial-scm.org/D7626
Wed, 11 Dec 2019 15:33:07 -0800 config: catch intended exception when failing to parse config
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 15:33:07 -0800] rev 43915
config: catch intended exception when failing to parse config When a new config parser was introduced in fca54469480e (ui: introduce new config parser, 2009-04-23), the reading side would raise a ConfigError which was then caught in the ui code. Then, in 2123aad24d56 (error: add new ParseError for various parsing errors, 2010-06-04), a ParseError was raised instead, but the call site was not updated. Let's start catching that ParseError. We still don't print it in a friendly way, but that's not worse than before. Differential Revision: https://phab.mercurial-scm.org/D7625
Wed, 11 Dec 2019 09:39:14 -0800 rust-hg-path: implement more readable custom Debug for HgPath{,Buf}
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Dec 2019 09:39:14 -0800] rev 43914
rust-hg-path: implement more readable custom Debug for HgPath{,Buf} The default prints the vector of bytes as a list of integers. I considered instead getting rid of the Debug trait, but we use the Debug format in lots of derived Debug instances, so we probably do want to implement it. Differential Revision: https://phab.mercurial-scm.org/D7604
Mon, 16 Dec 2019 15:58:47 -0800 util: implement sortdict.insert()
Martin von Zweigbergk <martinvonz@google.com> [Mon, 16 Dec 2019 15:58:47 -0800] rev 43913
util: implement sortdict.insert() As flagged by pytype (reported via Matt Harbison, thanks). This was broken by bd0fd3ff9916 (util: rewrite sortdict using Python 2.7's OrderedDict, 2017-05-16). We actually call insert() on namespaces.py:100, but we clearly don't have test coverage of that an no users have reported it AFAIK. Differential Revision: https://phab.mercurial-scm.org/D7680
Mon, 16 Dec 2019 23:27:17 -0500 patch: make __repr__() return str
Matt Harbison <matt_harbison@yahoo.com> [Mon, 16 Dec 2019 23:27:17 -0500] rev 43912
patch: make __repr__() return str Caught by pytype: line 969, in __repr__: Function bytes.join was called with the wrong arguments [wrong-arg-types] Expected: (self, iterable: Iterable[bytes]) Actually passed: (self, iterable: Iterator[str]) Differential Revision: https://phab.mercurial-scm.org/D7682
Sun, 15 Dec 2019 23:46:10 -0500 pytype: suppress warnings about no 'open_binary' on importlib.resources
Matt Harbison <matt_harbison@yahoo.com> [Sun, 15 Dec 2019 23:46:10 -0500] rev 43911
pytype: suppress warnings about no 'open_binary' on importlib.resources Fixes these pytype warnings: line 43, in <module>: No attribute 'open_binary' on module 'importlib.resources' [module-attr] line 47, in open_resource: No attribute 'open_binary' on module 'importlib.resources' [module-attr] For some reason, I can't upgrade from 3.6.8 in my WSL environment. Differential Revision: https://phab.mercurial-scm.org/D7681
Mon, 16 Dec 2019 17:10:51 -0500 windows: if username(uid=None) is loaded, just use getpass
Augie Fackler <augie@google.com> [Mon, 16 Dec 2019 17:10:51 -0500] rev 43910
windows: if username(uid=None) is loaded, just use getpass This is at least consistent with what we do on other platforms in the base case. I don't know enough about Windows to fill in other cases that might exist here, but this at least should be a start. Differential Revision: https://phab.mercurial-scm.org/D7679
Fri, 13 Dec 2019 14:12:14 -0800 transplant: use check_incompatible_arguments()
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 14:12:14 -0800] rev 43909
transplant: use check_incompatible_arguments() Differential Revision: https://phab.mercurial-scm.org/D7663
Fri, 13 Dec 2019 14:31:51 -0800 bookmarks: use check_incompatible_arguments() for inactive+action
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Dec 2019 14:31:51 -0800] rev 43908
bookmarks: use check_incompatible_arguments() for inactive+action Differential Revision: https://phab.mercurial-scm.org/D7662
Thu, 12 Dec 2019 23:32:47 -0800 bookmarks: use cmdutil.check_incompatible_arguments() for action+rev
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 23:32:47 -0800] rev 43907
bookmarks: use cmdutil.check_incompatible_arguments() for action+rev Differential Revision: https://phab.mercurial-scm.org/D7648
Thu, 12 Dec 2019 23:31:17 -0800 bookmarks: use cmdutil.check_at_most_one_arg() for action
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 23:31:17 -0800] rev 43906
bookmarks: use cmdutil.check_at_most_one_arg() for action Differential Revision: https://phab.mercurial-scm.org/D7647
Thu, 12 Dec 2019 15:55:33 -0800 rebase: use cmdutil.check_at_most_one_arg() for action
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 15:55:33 -0800] rev 43905
rebase: use cmdutil.check_at_most_one_arg() for action Here we also needed to know what the action was (if any), so I've updated the helper to return any specified option. Differential Revision: https://phab.mercurial-scm.org/D7640
Thu, 12 Dec 2019 22:30:59 -0800 releasenotes: extract helper for checking for incompatible arguments
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 22:30:59 -0800] rev 43904
releasenotes: extract helper for checking for incompatible arguments This patch extracts a new check_incompatible_arguments() function similar to check_at_most_one_arg(). The difference is that the new function is for checking for arguments that are disallowed together with some other argument but not mutually exclusive among themselves. Differential Revision: https://phab.mercurial-scm.org/D7639
Thu, 12 Dec 2019 15:51:09 -0800 fix: use cmdutil.check_at_most_one_arg()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 15:51:09 -0800] rev 43903
fix: use cmdutil.check_at_most_one_arg() Differential Revision: https://phab.mercurial-scm.org/D7638
Tue, 17 Dec 2019 10:26:44 +0300 patchbomb: use cmdutil.check_at_most_one_arg()
Martin von Zweigbergk <martinvonz@google.com> [Tue, 17 Dec 2019 10:26:44 +0300] rev 43902
patchbomb: use cmdutil.check_at_most_one_arg() Differential Revision: https://phab.mercurial-scm.org/D7637
Thu, 12 Dec 2019 15:48:48 -0800 export: use cmdutil.check_at_most_one_arg()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 15:48:48 -0800] rev 43901
export: use cmdutil.check_at_most_one_arg() Differential Revision: https://phab.mercurial-scm.org/D7636
Thu, 12 Dec 2019 15:10:44 -0800 amend: use cmdutil.check_at_most_one_arg()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 15:10:44 -0800] rev 43900
amend: use cmdutil.check_at_most_one_arg() Differential Revision: https://phab.mercurial-scm.org/D7635
Thu, 12 Dec 2019 14:54:38 -0800 commit: use cmdutil.check_at_most_one_arg()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 14:54:38 -0800] rev 43899
commit: use cmdutil.check_at_most_one_arg() Differential Revision: https://phab.mercurial-scm.org/D7634
Thu, 12 Dec 2019 15:16:13 -0800 clone: extract helper for checking mutually exclusive args
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 15:16:13 -0800] rev 43898
clone: extract helper for checking mutually exclusive args We have some duplicated code for aborting if the user provided mutually exclusive arguments. Extensions surely have more such code. We also have duplicated translations and inconsistent output in this area. This patch introduces a simpler helper for checking if more than one option among a given set was given on the command line. I've made the clone code call the function to show that it works. The function has no good way of checking arguments with hyphens in them. I'll add that later if necessary. The function still won't be applicable in all cases, but I think it's still better than nothing. Differential Revision: https://phab.mercurial-scm.org/D7633
Fri, 13 Dec 2019 14:40:52 -0800 dirstate: when calling rebuild(), avoid some N^2 codepaths
Kyle Lippincott <spectral@google.com> [Fri, 13 Dec 2019 14:40:52 -0800] rev 43897
dirstate: when calling rebuild(), avoid some N^2 codepaths I had a user repo with 200k files in it. Calling `hg debugrebuilddirstate` took tens of minutes (I didn't wait for it). In that situation, changedfiles==allfiles, and both are lists. This meant that we had to run an average of 100k comparisons, for each of 200k files, just to check whether a file needed to have normallookup called (it always did), or drop. While it's probably not a huge issue, in my very awkward synthetic benchmark I wrote (not using a benchmark library or anything), I was seeing some slowdowns for small-changedfiles and very-large-allfiles invocations, with an inflection somewhere around 10 items in changedfiles (regardless of the size of allfiles); above 10 items in changedfiles, the new code appears to always be faster. For the case of 50k files in changedfiles and the same items in allfiles, I'm seeing differences of 15s of just running comparisons vs. 0.003793s. I haven't bothered to run a comparison of 200k items in changedfiles and allfiles. :) Differential Revision: https://phab.mercurial-scm.org/D7665
Mon, 16 Dec 2019 11:28:14 +0100 rust-warnings: fix warnings in tests
Raphaël Gomès <rgomes@octobus.net> [Mon, 16 Dec 2019 11:28:14 +0100] rev 43896
rust-warnings: fix warnings in tests It turns out that I also missed those warnings inside tests. This should be the last of them. One day we will get rid of this interface anyway. Differential Revision: https://phab.mercurial-scm.org/D7678
Mon, 16 Dec 2019 12:41:06 +0100 relnotes: mention the merging of index and nodemap
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 16 Dec 2019 12:41:06 +0100] rev 43895
relnotes: mention the merging of index and nodemap
Tue, 10 Dec 2019 17:07:09 -0500 crecord: remove toggleamend
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Tue, 10 Dec 2019 17:07:09 -0500] rev 43894
crecord: remove toggleamend Previous commit removed its only calling site.
Tue, 10 Dec 2019 17:02:09 -0500 crecord: repurpose "a" key to toggle all selections (BC)
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Tue, 10 Dec 2019 17:02:09 -0500] rev 43893
crecord: repurpose "a" key to toggle all selections (BC) I really don't like "a". I keep accidentally hitting it when I actually want "A", and then I'm suddenly in a state I don't want to be in. There's a big wall of text telling me that I've turned amend mode on or off (which one was I orginally in?), and this seems very useless. If I wanted to amend or not, I would have chosen that from the command-line, not change my mind after I've already started picking hunks apart. Furthermore, for most uses of the hunk selector (revert, uncommit, shelve/unshelve), this amend toggle doesn't make sense. It seems much better to repurpose this key to be a "weaker" version of "A". It toggles all selections. This is pretty harmless if hit accidentally, (can just hit "a" again to toggle everything and undo it), and has immediate visual feedback that something happened: all the x's and blank spaces get switched around. And unlike with amend, the current flipped state is also immediately visible without having to read a wall of text. I'm calling this a BC, however, because somewhere, someone out there has probably really fallen in love with the old use of "a" and will get angry that we took it away.
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -24 +24 +50 +100 +300 +1000 +3000 tip