Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 07 Mar 2020 00:03:41 +0100] rev 44474
copies-tests: remove the final summary
The more we add tests, the less useful it is. So after discussion with Martin,
we decided to drop it.
Differential Revision: https://phab.mercurial-scm.org/D8257
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 03 Mar 2020 13:18:31 +0100] rev 44473
copies-tests: clarify the description of the EA/AE cases
The previous description of the merge was just wrong.
(It seems the result a non-updated copy-paste)
Differential Revision: https://phab.mercurial-scm.org/D8238
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 03 Mar 2020 09:27:31 +0100] rev 44472
copies-tests: update the analysis of the BD/DB cases
After thinking more about it, the current change in output between the two
merges is not due to an ambiguity, it is introduce by a bug in merge/commit
that record a wrong file history.
Fixing the bug should fix the output. In the meantime, we have a wrong behavior.
In practice the bug is not in the merge code (who does the right things), but in
the commit code (who get confused when recording the new file revision).
Differential Revision: https://phab.mercurial-scm.org/D8237
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 06 Mar 2020 11:02:02 +0100] rev 44471
copies-tests: swap two branch description
They were swapped and now match their intended block.
Differential Revision: https://phab.mercurial-scm.org/D8247
Augie Fackler <augie@google.com> [Fri, 06 Mar 2020 13:27:41 -0500] rev 44470
cleanup: run pyupgrade on our source tree to clean up varying things
Built with:
hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/**' | xargs pyupgrade --keep-percent-format --keep-extraneous-parens
and then blackened. pyupgrade comes from
https://github.com/asottile/pyupgrade with a patch to let me preserve
extraneous parens (which we use for marking strings that shouldn't be
translated), and lets us clean up a bunch of idioms that have cruftily
accumulated over the years.
# skip-blame no-op automated code cleanups
Differential Revision: https://phab.mercurial-scm.org/D8255
Manuel Jacob <me@manueljacob.de> [Fri, 06 Mar 2020 10:52:44 +0100] rev 44469
tests: avoid implicit conversion of str to unicode
On Python 2, str.encode('utf-8') implicitly converts the string to unicode and
then back to str.
Using _sys2bytes() ensures that opt is only encoded on Python 3, where opt is
unicode.
Although contrived, before this change, a UnicodeDecodeError could be triggered
on Python 2 when passing non-ascii values to --extra-config-opt.
Manuel Jacob <me@manueljacob.de> [Fri, 06 Mar 2020 09:50:57 +0100] rev 44468
tests: rename _bytespath() to _sys2bytes() and _strpath() to _sys2str()
The names were not general enough because e.g. _strpath() was used for
converting IP addresses.
Manuel Jacob <me@manueljacob.de> [Thu, 05 Mar 2020 18:19:21 +0100] rev 44467
tests: avoid implicit conversion of str to unicode
On Python 2, str.encode('ascii') implicitly converts the string to unicode and
then back to str.
Since the converted value is a path, _bytespath can be used instead.
Manuel Jacob <me@manueljacob.de> [Thu, 05 Mar 2020 18:10:19 +0100] rev 44466
tests: avoid implicit conversion of str to unicode
On Python 2, str.encode('ascii') implicitly converts the string to unicode and
then back to str.
Since the point of this expression is to convert a bool to a str, the '%r'
conversion specifier can be used instead in the format string.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 18 Feb 2020 19:11:13 +0100] rev 44465
nodemap: warm the persistent nodemap on disk with debugupdatecache
When appropriate, the nodemap cache file will be created.
Differential Revision: https://phab.mercurial-scm.org/D8173
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 29 Feb 2020 19:31:33 +0100] rev 44464
copies-tests: update to null after setup for output stability
This avoid having '@' moving around in graph output when the graph evolves.
after this change, graph evolution is still noisy, but less.
Differential Revision: https://phab.mercurial-scm.org/D8236
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 03 Mar 2020 08:55:27 +0100] rev 44463
copies-tests: remove extra log call at the end of the chain-merge test file
We do not actually need theses as the graph is displayed earlier anyway. I
think they are the remain of me trying to understand that case better.
Differential Revision: https://phab.mercurial-scm.org/D8235
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Mar 2020 08:37:08 -0800] rev 44462
commit: print debug message when clearing dirstate and wdir clean
This case is a little weird, so let's have a debug message.
Differential Revision: https://phab.mercurial-scm.org/D8231
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Mar 2020 10:46:31 -0800] rev 44461
merge with stable
Augie Fackler <augie@google.com> [Thu, 05 Mar 2020 10:52:51 -0500] rev 44460
merge with stable
Augie Fackler <augie@google.com> [Wed, 04 Mar 2020 14:21:23 -0500] rev 44459
commands: switch one call of check_at_most_one_arg to strings
This opts hasn't been through the byteskwargs mulcher, so we can just use
strings here instead of bytes. Fixes the test changes from D8204 on Python 3,
which was the only place this was a problem.
Differential Revision: https://phab.mercurial-scm.org/D8222
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Feb 2020 11:32:27 -0800] rev 44458
cleanup: remove redundant clearing of mergestate in rebase and shelve
`repo.commit()` now clears the merge state even if it ends up not
creating a commit because there were no changes to commit.
Differential Revision: https://phab.mercurial-scm.org/D8197
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Feb 2020 11:32:02 -0800] rev 44457
commit: clear resolved mergestate even if working copy is clean
If the mergestate has resolved conflicts and a commit is successfully
created (either because there are changes in the working copy or
because ui.allowemptycommit=yes), we will also clear the merge
state. However, if the working copy is clean (and
ui.allowemptycommit=no), we leave the mergestate there. The user may
notice it in `hg resolve -l` output (but not in `hg status -v`
output). It's not clear how the user should clear it, but probably via
`hg co -C .`. It's also quite likely that they won't even notice it
and it will get cleared by a later `hg commit` (of unrelated
changes).
This patch makes it so that `hg commit` also clears resolved merge
conflicts even if the command doesn't end up writing a commit because
the working copy was empty. That's probably a little weird (commands
that abort should generally avoid changing the repo), but it still
seems mostly harmless, and it reduces the risk of more bugs like
https://bz.mercurial-scm.org/show_bug.cgi?id=5494. I just ran into a
version of that bug in the Evolve extension and that's what triggered
this series.
Differential Revision: https://phab.mercurial-scm.org/D8196
Matt Harbison <matt_harbison@yahoo.com> [Wed, 04 Mar 2020 00:45:54 -0500] rev 44456
phabricator: avoid a stacktrace when command arguments are missing
Previously, the TypeError wasn't properly converted to a SignatureError when
improper arguments were supplied to the inner function, because the stack depth
is 2 inside the vcrcommand decorator. The `__name__` and `__doc__` attributes
need to be reassigned to the new wrapper so that the help summary is available.
Differential Revision: https://phab.mercurial-scm.org/D8209
Martin von Zweigbergk <martinvonz@google.com> [Fri, 24 Jan 2020 15:51:19 -0800] rev 44455
mq: don't tell user to commit merge that we already committed
Differential Revision: https://phab.mercurial-scm.org/D8000
Martin von Zweigbergk <martinvonz@google.com> [Fri, 24 Jan 2020 15:28:37 -0800] rev 44454
merge: make hg.merge() take a context instead of a node
Many callers already have a repo, so we might as well pass
that. `merge.update()` will look up the context object later. This
patch is part of making it so we pass around the context object all
the way down instead.
I also removed the `repo` argument since it can be retrieved from the
context.
Differential Revision: https://phab.mercurial-scm.org/D7999
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 17 Jan 2020 21:22:23 +0300] rev 44453
debugbackupbundle: introduce command to interact with strip backups
This vendors backups extension from hg-experimental.
Listing backups and having some utility to apply them is nice. I know we have
obsmarkers now, but this will help a lot of end users who still uses strip until
we get evolve out of experimental.
Differential Revision: https://phab.mercurial-scm.org/D7932
Matt Harbison <matt_harbison@yahoo.com> [Thu, 20 Feb 2020 10:56:40 -0500] rev 44452
phabricator: also check parent fctx for binary where it is checked for UTF-8
I don't know that this is necessary, but it seems obvious from the code checking
both the current and parent file for UTF-8 content that this was the intent.
Differential Revision: https://phab.mercurial-scm.org/D8221
Matt Harbison <matt_harbison@yahoo.com> [Thu, 20 Feb 2020 10:46:43 -0500] rev 44451
phabricator: don't infer the old `fctx` in `notutf8()`
This is used along with `fctx.isbinary()` to gate `addoldbinary()`, so it seems
like a good idea to provide the caller similar control over the current and
parent filecontext. Unlike `addoldbinary()`, it doesn't need both previous and
current contexts at the same time, so make the caller responsible for testing
both cases, as appropriate. I haven't worked out all of the problems around
marking files as binary for move/remove/copy, but this will definitely help with
`--no-stack` too.
It also turns out to have been doing too much- in the remove case, it tested not
just the removed file in the parent context (which is what gets passed in that
case), but also in the parent of the parent context (which should be
irrelevant). The previous code also required the `fctx.parents()` check to work
in the add (but without rename) case. Now the add and remove cases test only
what they need to. But now that it is written this way, the fact that only the
current `fctx` is checked to be binary in the case of modification or being
renamed seems wrong.
Differential Revision: https://phab.mercurial-scm.org/D8220
Matt Harbison <matt_harbison@yahoo.com> [Thu, 20 Feb 2020 12:42:07 -0500] rev 44450
phabricator: rename a variable to clarify that it is the parent filecontext
Differential Revision: https://phab.mercurial-scm.org/D8219
Matt Harbison <matt_harbison@yahoo.com> [Wed, 19 Feb 2020 13:33:58 -0500] rev 44449
phabricator: pass old `fctx` to `addoldbinary()` instead of inferring it
Currently, removed binaries aren't marked as binaries on the left side, which
sends the raw file view to a bad URL in the web interface. (See D8009) In order
to handle marking the file as binary in the removed case, both contexts need to
be provided by the caller, since there is no current fctx in the removed case.
Having an explicit old fctx will also be useful to support a `--no-stack` option
that rolls up the commit stack into a single review.
The bug isn't fixed with this change- there's a missing call to it in
`addremoved()` as well. But instead of spamming the list with a bunch of test
diffs, all of the missing binary issues will be fixed at once later.
Differential Revision: https://phab.mercurial-scm.org/D8218
Matt Harbison <matt_harbison@yahoo.com> [Wed, 04 Mar 2020 10:25:07 -0500] rev 44448
phabricator: make `hg phabread` work outside of a repository
This is similar to 16312ea45a8b and 2513f0f70a26- we don't need a repo, but will
load .hg/hgrc if inside one.
Differential Revision: https://phab.mercurial-scm.org/D8214
Matt Harbison <matt_harbison@yahoo.com> [Sun, 16 Feb 2020 15:06:20 -0500] rev 44447
phabricator: refactor `phabread` to write all patches at once
This will be necessary to create a first class `phabimport` command. That
command requires a transaction, and will import all named patches within a
single transaction. But if Phabricator queries also happen within the
transaction, that leaves open the chance that an exception is raised, the
transaction is abandoned, and the next command that is run will complain about
needing to run `hg recover`.
Differential Revision: https://phab.mercurial-scm.org/D8135
Matt Harbison <matt_harbison@yahoo.com> [Mon, 17 Feb 2020 13:14:44 -0500] rev 44446
phabricator: make `hg phabupdate` work outside of a repository
This is similar to 16312ea45a8b- we don't need a repo, but will load .hg/hgrc if
inside one.
Differential Revision: https://phab.mercurial-scm.org/D8208
Matt Harbison <matt_harbison@yahoo.com> [Mon, 17 Feb 2020 13:28:40 -0500] rev 44445
phabricator: pass ui instead of repo to `userphids()`
Also not a repository operation.
Differential Revision: https://phab.mercurial-scm.org/D8207