Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 19 Apr 2021 11:22:24 +0200] rev 47087
test-copies: simplify some conditional output
Now that all computation using sidedata give the same result, we can
simplify conditional
Differential Revision: https://phab.mercurial-scm.org/D10346
Raphaël Gomès <rgomes@octobus.net> [Mon, 19 Apr 2021 11:22:24 +0200] rev 47086
sidedata: move documentation about sidedata helpers to sidedata module
Differential Revision: https://phab.mercurial-scm.org/D10361
Raphaël Gomès <rgomes@octobus.net> [Mon, 19 Apr 2021 11:22:24 +0200] rev 47085
sidedata: move sidedata-related utils to the dedicated module
Differential Revision: https://phab.mercurial-scm.org/D10360
Raphaël Gomès <rgomes@octobus.net> [Mon, 19 Apr 2021 11:22:24 +0200] rev 47084
sidedata: replace sidedata upgrade mechanism with the new one
Note: this is split into a separate change (like some other patches in this
series) because it's not easy to have all patches work 100% and this seemed
easier for reviewers.
When cloning or upgrading a repo, we may need to compute (or remove) sidedata.
This is the same mechanism that is used in exchange, so we re-use the new
system to simplify the code and fix the remaining issues (correctly dropping
flags and handling partial removal, etc.).
This also highlighted an issue with `test-copies-in-changeset.t` that kept
sidedata categories that are not relevant anymore. They should probably be
dropped entirely, but that would be for another patch.
Differential Revision: https://phab.mercurial-scm.org/D10359
Raphaël Gomès <rgomes@octobus.net> [Mon, 19 Apr 2021 11:22:21 +0200] rev 47083
sidedata: add a way of replacing an existing sidedata computer
This will be useful in a future patch to replace a sequential computer with
a parallel computer. We only allow for explicit replacement, to force the users
to think about overriding computers.
Differential Revision: https://phab.mercurial-scm.org/D10358
Raphaël Gomès <rgomes@octobus.net> [Thu, 08 Apr 2021 16:30:10 +0200] rev 47082
bundle2: remove restriction around sidedata
We are now capable of generating the missing sidedata on-the-fly.
Differential Revision: https://phab.mercurial-scm.org/D10345
Matt Harbison <matt_harbison@yahoo.com> [Mon, 12 Apr 2021 20:58:19 -0400] rev 47081
heptapod-ci: enable pytype checking
The trigger is manual for now, until we get a better idea about stability,
resource usage, etc.
Differential Revision: https://phab.mercurial-scm.org/D10462
Matt Harbison <matt_harbison@yahoo.com> [Thu, 06 May 2021 18:40:23 -0400] rev 47080
hghave: fix the definition of `python3` to work on Windows
Both py2 and py3 executables are named `python.exe`, and may or may not be on
PATH. So use the dispatcher executable that comes with py3 to fetch the version
of the latest py3 executable. This allows at least one relnotes test to run on
Windows.
Differential Revision: https://phab.mercurial-scm.org/D10694
Matt Harbison <matt_harbison@yahoo.com> [Wed, 12 May 2021 12:41:52 -0400] rev 47079
util: avoid echoing the password to the console on Windows py3 (
issue6446)
The `getpass.getpass()` implementation on Windows first checks if `sys.stdin`
and `sys.__stdin__` are the same object. It's not on py3 because the former is
replaced in dispatch.py with something that doesn't normalize '\n' to '\r\n'.
When they aren't the same object, it simply calls `sys.stdin.readline()` instead
of the mscvrt functions that read the input characters before they are echoed.
This simply copies the `getpass.win_getpass()` implementation without the stdin
check, and byteifies around the edges. I'm not sure if there's a reasonable
replacement for the check that we could implement. When echoing input into the
hg command, the `ui.interactive()` check causes `ui.getpass()` to bail before
getting here. If the proper config switches are used to bypass that and call
this, the process stalls until '\n' is input into the console. So there could
be a deadlock here when run by another command if the wrong config settings are
applied.
Differential Revision: https://phab.mercurial-scm.org/D10708
Raphaël Gomès <rgomes@octobus.net> [Thu, 08 Apr 2021 16:55:17 +0200] rev 47078
sidedata: enable sidedata computers to optionally rewrite flags
Sidedata computers may want to influence the flags of the revision they touch.
For example, the computer for changelog-based copytracing can add a flag to
signify that this revision might affect copytracing, inversely removing said
flag if the information is no longer applicable.
See inline documentation in `storageutil` for more details.
Differential Revision: https://phab.mercurial-scm.org/D10344
Raphaël Gomès <rgomes@octobus.net> [Sat, 10 Apr 2021 11:27:40 +0200] rev 47077
cg4: introduce protocol flag to signify the presence of sidedata
We need a way of signaling whether the current revision has sidedata or not,
and re-using the revision flags would waste potential revlog flags and mix two
normally independent layers.
In this change, we add a single byte at the start of the ch4 delta header to
set potential protocol flags. We also reclaim the revlog flag for sidedata,
since it is no longer used, in its place now lives the (also experimental)
copytracing flag.
When generating deltas, apply the `CG_FLAG_SIDEDATA` flag if there is sidedata.
When applying the deltas, if said flag is present, the next chunk contains the
sidedata.
Differential Revision: https://phab.mercurial-scm.org/D10343
Raphaël Gomès <rgomes@octobus.net> [Thu, 08 Apr 2021 16:34:11 +0200] rev 47076
changegroup: don't limit cgv4 to revlogv2 repos
To help the transition from revlogv1 to revlogv2, we need to be able to enable
cgv4 for revlogv1 repos, so that revlogv2 clients can handle adding/removing
sidedata over the wire.
Differential Revision: https://phab.mercurial-scm.org/D10342
Raphaël Gomès <rgomes@octobus.net> [Thu, 08 Apr 2021 16:39:39 +0200] rev 47075
sidedata: gate sidedata functionality to revlogv2 in more places
Since revlogv1 is not capable of storing sidedata, we prevent sidedata
mechanisms around the revlog layer from doing anything. We however keep the
ones that allow a revlogv1 repo to generate sidedata on-the-fly on a push, the
pull case simply does not add the sidedata to the revlog.
Differential Revision: https://phab.mercurial-scm.org/D10341
Raphaël Gomès <rgomes@octobus.net> [Tue, 30 Mar 2021 17:03:02 +0200] rev 47074
sidedata: register copies sidedata computer regardless of the revlog version
Repositories should not gate their sidedata computers based on any requirement,
only their wanted sidedata. A repository might need to generate sidedata wanted
by the peer that it itself does not want.
Differential Revision: https://phab.mercurial-scm.org/D10340
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 08 Apr 2021 19:00:21 +0200] rev 47073
revlog: replace the old `revlog_kind` approach with the new `target` one
The new `target` attribute supersedes the previous one.
Differential Revision: https://phab.mercurial-scm.org/D10353
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 06 Apr 2021 05:20:24 +0200] rev 47072
revlog: introduce an explicit tracking of what the revlog is about
Since the dawn of time, people have been forced to rely to lossy introspection
of the index filename to determine what the purpose and role of the revlog they
encounter is. This is hacky, error prone, inflexible, abstraction-leaky,
<insert-your-own-complaints-here>.
In
f63299ee7e4d Raphaël introduced a new attribute to track this information:
`revlog_kind`. However it is initialized in an odd place and various instances
end up not having it set. In addition is only tracking some of the information
we end up having to introspect in various pieces of code.
So we add a new attribute that holds more data and is more strictly enforced.
This work is done in collaboration with Raphaël.
The `revlog_kind` one will be removed/adapted in the next changeset. We expect
to be able to clean up various existing piece of code and to simplify coming
work around the newer revlog format.
Differential Revision: https://phab.mercurial-scm.org/D10352
Martin von Zweigbergk <martinvonz@google.com> [Tue, 04 May 2021 08:54:28 -0700] rev 47071
config: add --source option to include source of value
Showing the source of each config option is quite useful and not
something the user should have to reach for the `--debug` flag for.
I updates documentation and tests, except for one place in
`test-hgrc.t` where I thought the test might have been intended to
also test that `--debug` results in `ui.quiet` etc being test.
Differential Revision: https://phab.mercurial-scm.org/D10668
Martin von Zweigbergk <martinvonz@google.com> [Tue, 04 May 2021 10:49:32 -0700] rev 47070
rewriteutil: say how many commits would become orphan if commit is rewritten
This copies the message from the evolve extension, but modifies it a
bit to work with the grammar (in particular with the use of "change
branch of" as `action`). I don't know why it doesn't use the same
`_formatrevs()` as for public commmits.
Differential Revision: https://phab.mercurial-scm.org/D10671
Martin von Zweigbergk <martinvonz@google.com> [Tue, 04 May 2021 10:16:34 -0700] rev 47069
rewriteutil: give examples of public changesets that can't be rewritten
This patch copies the feature from the evolve extension.
Differential Revision: https://phab.mercurial-scm.org/D10670
Nate Skulic <nate.skulic@gmail.com> [Mon, 10 May 2021 00:54:08 +0000] rev 47068
convert: update p4 for Python 3
Differential Revision: https://phab.mercurial-scm.org/D10703
Matt Harbison <matt_harbison@yahoo.com> [Sun, 02 May 2021 16:56:20 -0400] rev 47067
tests: change the fixer commands to use the buffer attribute on stdio objects
Otherwise `\r` was getting injected into the fixed lines and throwing off the
commit hashes on Windows when the fixer is invoked with py3.
Differential Revision: https://phab.mercurial-scm.org/D10637
Matt Harbison <matt_harbison@yahoo.com> [Sat, 01 May 2021 16:13:53 -0400] rev 47066
tests: stabilize test-persistent-nodemap.t on Windows
Several issues here:
- Hooks can't invoke shell scripts on Windows, so use `sh` to launch
- `dd` in MSYS only recognizes `status=noxfer`
- The `PATH` updating triggered a massive slowdown, but is no longer needed
I have no idea why, but removing the `PATH` update substantially increased the
speed of the test. It was running finishing at ~4:30 with `--debug` and ~14:50
without it, but now completes in ~2:20 on my Windows laptop.
Differential Revision: https://phab.mercurial-scm.org/D10636
Matt Harbison <matt_harbison@yahoo.com> [Sun, 02 May 2021 19:54:08 -0400] rev 47065
tests: invoke some shell scripts through the shell interpreter for Windows
Otherwise, Windows was prompting what program to use to open the file (or just
opening it if there was a file association configured).
Differential Revision: https://phab.mercurial-scm.org/D10635
Matt Harbison <matt_harbison@yahoo.com> [Sat, 01 May 2021 13:04:56 -0400] rev 47064
tests: run python script through quoted interpreter instead of directly
This helps Windows when python is installed to %PROGRAMFILES%.
Differential Revision: https://phab.mercurial-scm.org/D10634
Matt Harbison <matt_harbison@yahoo.com> [Sat, 01 May 2021 00:41:43 -0400] rev 47063
tests: ensure `$PYTHON` is quoted for Windows
Global installs of python3 go into "Program Files", and tons of tests fail with
mysterious errors if this isn't quoted. Most of this is a followup to
0826d684a1b5, but a some of these were existing issues. Shebang lines are
ignored because quoting breaks direct execution- these will need to be launched
indirectly with the quoted `$PYTHON` command.
Differential Revision: https://phab.mercurial-scm.org/D10633
Kyle Lippincott <spectral@google.com> [Fri, 30 Apr 2021 16:13:02 -0700] rev 47062
black: make codebase compatible with black v21.4b2 and v20.8b1
I don't know what exact version of black made it care about these whitespace
differences, but this is the version I got when I just installed it with
`pip3 install black`.
I'm intentionally not increasing the version of black required, as I don't want
to force everyone to upgrade their version of black, and these fixes are
backwards compatible with black v20.8b1. If there are more issues in the future
and this becomes a maintenance burden I may do so in a future change.
Tested with both versions of black (I got the older version via
`pip3 install black==20.8b1`)
Differential Revision: https://phab.mercurial-scm.org/D10539
Augie Fackler <augie@google.com> [Tue, 04 May 2021 13:28:42 -0400] rev 47061
debugcommands: fix some plural-agreements I noticed
Differential Revision: https://phab.mercurial-scm.org/D10669
Augie Fackler <augie@google.com> [Mon, 03 May 2021 15:14:09 -0400] rev 47060
merge: with stable
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 May 2021 22:53:02 +0530] rev 47059
Added signature for changeset
067f2c53fb24
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 May 2021 22:52:56 +0530] rev 47058
Added tag 5.8 for changeset
067f2c53fb24
Raphaël Gomès <rgomes@octobus.net> [Mon, 03 May 2021 18:55:19 +0200] rev 47057
branching: merge stable into default
Matt Harbison <matt_harbison@yahoo.com> [Sat, 01 May 2021 00:28:39 -0400] rev 47056
phabricator: adapt to the new `urlutil.url()` API
This avoids a bunch of deprecation warnings in the tests.
Differential Revision: https://phab.mercurial-scm.org/D10541
Matt Harbison <matt_harbison@yahoo.com> [Fri, 30 Apr 2021 17:36:09 -0400] rev 47055
extensions: ignore exceptions from an extension's `getversion()` method
This method is usually called when there's a stacktrace being generated, or with
`hg version -v`. Raising another exception risks mangling the bug report info.
I hit this issue when trying to add the method to the keyring extension to
report the version of the extension and the underlying module, and ran into
demandimport issues prior to py3.8. It seems like a wise thing to do anyway,
though unfortunately there's no convenient `ui` object around to issue a
warning. Use 'unknown' to signal that it tried to report a version and failed,
unlike the default case of printing nothing.
Differential Revision: https://phab.mercurial-scm.org/D10540
Matt Harbison <matt_harbison@yahoo.com> [Wed, 28 Apr 2021 17:05:32 -0400] rev 47054
git: ensure all dirstate state values are bytes
I'm not sure how this particular git status occurs, but after the fallout of
issue 6510 and getting into the issue 6511 state where `git status` shows the
files as modified in both the "to be committed" and "not staged" lists,
`hg diff` was crashing in `workingctx.__contains__()`.
Differential Revision: https://phab.mercurial-scm.org/D10532
Matt Harbison <matt_harbison@yahoo.com> [Wed, 28 Apr 2021 10:29:45 -0400] rev 47053
tests: synchronize the git and Mercurial username
The problem with the default name of "test" set by the test runner is the
stringutil methods are unable to split out separate user and email addresses
that git wants. This means the username is recorded in git as "test <test>".
Amending a commit with that user ends up trying to use "<test>" as the person
field for the new commit, and the git library complains about the angle
brackets. We should probably abort with a clearer message any time this bad
form is used with the git extension.
One of the commit dates is tweaked to recreate the ambiguous hash prefix from
before.
Differential Revision: https://phab.mercurial-scm.org/D10531
Matt Harbison <matt_harbison@yahoo.com> [Tue, 27 Apr 2021 19:38:19 -0400] rev 47052
git: initialize `extra` to have at least the branch name for nullid
Otherwise, this crashes trying to convert to local encoding:
...
File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 333, in _show
branch = ctx.branch()
File "/mnt/c/Users/Matt/hg/mercurial/context.py", line 675, in branch
return encoding.tolocal(self._changeset.extra.get(b"branch"))
File "/mnt/c/Users/Matt/hg/mercurial/encoding.py", line 181, in tolocal
if isasciistr(s):
TypeError: a bytes-like object is required, not 'NoneType'
This was originally reported to the thg bug tracker.
https://foss.heptapod.net/mercurial/tortoisehg/thg/-/issues/5629
Differential Revision: https://phab.mercurial-scm.org/D10528
Matt Harbison <matt_harbison@yahoo.com> [Tue, 27 Apr 2021 18:39:59 -0400] rev 47051
git: consistently use str for parents when rebuilding the index database
The tests show no changes, but when these values are overwritten shortly after
when a git commit object is available, that uses str. It seems better to use
that for consistency.
It does materially affect the database though, because the old value stored was
`X'3030..3030'` and is now '00..00' when the changelog table is dumped in
sqlite3. There is one query that specifies the parents, but it passes the non
null hashes as str, so it worked as expected. That likely explains the lack of
test changes.
Differential Revision: https://phab.mercurial-scm.org/D10527
Matt Harbison <matt_harbison@yahoo.com> [Tue, 27 Apr 2021 17:54:08 -0400] rev 47050
git: pass the correct type to the sqlite3 query for baselog.hasnode()
It looks like this function is mostly used in exchange (which isn't supported
now) and histedit (which crashes). But I did verify in a REPL that passing
bytes to `db.execute()` fails to find the row, whereas passing str works.
Differential Revision: https://phab.mercurial-scm.org/D10526
Matt Harbison <matt_harbison@yahoo.com> [Tue, 27 Apr 2021 17:11:55 -0400] rev 47049
git: use the correct type for stopping changelog.revs()
The `tip` function returns a binary node, but the database is expecting an int.
Differential Revision: https://phab.mercurial-scm.org/D10525
Matt Harbison <matt_harbison@yahoo.com> [Tue, 27 Apr 2021 16:58:59 -0400] rev 47048
git: use the proper filenode for deleted files in changelog.changelogrevision
Inline printing shows it still doesn't find the removed file in the test, but it
is at least a str instead of bytes like the immediate query before it that does
find files. Looking at the database, it doesn't look like the remove was
recorded. Additionally, `hg log -r 'removes("re:.*")'` stacktraces.
Differential Revision: https://phab.mercurial-scm.org/D10524
Matt Harbison <matt_harbison@yahoo.com> [Tue, 27 Apr 2021 12:59:17 -0400] rev 47047
tests: add coverage for git.changelog.headrevs(...)
Differential Revision: https://phab.mercurial-scm.org/D10523
Matt Harbison <matt_harbison@yahoo.com> [Tue, 27 Apr 2021 12:31:30 -0400] rev 47046
git: make changelog.tiprev() return int instead of tuple (
issue6510)
Differential Revision: https://phab.mercurial-scm.org/D10522
Matt Harbison <matt_harbison@yahoo.com> [Tue, 27 Apr 2021 00:26:12 -0400] rev 47045
git: fix partial node matching
Looks like everything is meant to be a str here.
Differential Revision: https://phab.mercurial-scm.org/D10521
Matt Harbison <matt_harbison@yahoo.com> [Tue, 27 Apr 2021 00:23:05 -0400] rev 47044
tests: stabilize test-git-interop.t for some versions of git
Not sure why this differs on my system, but it's likely due to running 2.17.1 on
Ubuntu 18.04.
Differential Revision: https://phab.mercurial-scm.org/D10520
Joerg Sonnenberger <joerg@bec.de> [Fri, 30 Apr 2021 02:11:58 +0200] rev 47043
manifests: push down expected node length into the parser
This strictly enforces the node length in the manifest lines according
to what the repository expects. One test case moves large hash testing
into the non-treemanifest part as treemanifests don't provide an
interface for overriding just the node length for now.
Differential Revision: https://phab.mercurial-scm.org/D10533
Joerg Sonnenberger <joerg@bec.de> [Fri, 30 Apr 2021 03:19:45 +0200] rev 47042
core: don't hard-code node length
Differential Revision: https://phab.mercurial-scm.org/D10536
Joerg Sonnenberger <joerg@bec.de> [Fri, 30 Apr 2021 03:09:16 +0200] rev 47041
core: don't hard-code hex node lengths
Differential Revision: https://phab.mercurial-scm.org/D10535
Joerg Sonnenberger <joerg@bec.de> [Fri, 30 Apr 2021 02:25:10 +0200] rev 47040
tests: bump default timeout to 360s
A number of tests hit or almost hit the default limit even on modern
hardware. While the tests are ideally split into smaller pieces, that's
non-trivial work. HyperThreading and similar technologies can trigger
this often, even without any other load on the machine.
Differential Revision: https://phab.mercurial-scm.org/D10534