Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 06 Nov 2019 16:53:01 +0100] rev 43459
py3: keep "keypressed" a native str in crecord
This will help in the next changeset by avoiding a decode step. Also,
the actual bytes conversion seems superfluous since values coming from
curses's getkey() will be a native string. As a consequence, we open the
"testcommands" file (used in test-interactive-curses.t) in text mode.
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 06 Nov 2019 17:12:13 +0100] rev 43458
py3: compare response of crecord's confirmationwindow with str
confirmationwindow() returns a native string, as a result of calling
chr() on getch(). On Python 3, response.lower().startswith(b"y") leads
to a TypeError.
This fixes a crash when typing "r" in the curses interface of
interactive commit.
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 07 Nov 2019 08:58:26 +0100] rev 43457
py3: compare http server's command with a native string
The "command" attribute is an str, so comparing with a bytes would not
work on Python 3. This might solve issues in test-lfs-serve-access.t
that happens sometimes (especially in CI):
--- /hgwork/src/tests/test-lfs-serve-access.t
+++ /hgwork/src/tests/test-lfs-serve-access.t.err
@@ -163,11 +163,13 @@
$ cat $TESTTMP/access.log $TESTTMP/errors.log
$LOCALIP - - [$LOGDATE$] "POST /missing/objects/batch HTTP/1.1" 404 - (glob)
+ $LOCALIP - - [05/Nov/2019 16:32:34] "{"objects": [{"oid": "
f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e", "size": 20}], "operation": "download"}" HTTPStatus.BAD_REQUEST -
$LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=capabilities HTTP/1.1" 200 - (glob)
$LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
$LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Arev-branch-cache%250Astream%253Dv2&cg=1&common=
0000000000000000000000000000000000000000&heads=
525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
$LOCALIP - - [$LOGDATE$] "POST /subdir/mount/point/.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
$LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point/.hg/lfs/objects/
f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e HTTP/1.1" 200 - (glob)
+ $LOCALIP - - [05/Nov/2019 16:32:34] code 400, message Bad request version ('"download"}')
Blobs that already exist in the usercache are linked into the repo store, even
though the client doesn't send the blob.
@@ -195,6 +197,7 @@
server2/.hg/store/lfs/objects/f0/
3217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e
$ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
$ cat $TESTTMP/errors.log
+ $LOCALIP - - [05/Nov/2019 16:32:34] code 400, message Bad request version ('"download"}')
$ cat >> $TESTTMP/lfsstoreerror.py <<EOF
> import errno
(from https://ci.hg.gregoryszorc.com/job-info/hg-committed-
ca3dca416f8d5863ca6f5a4a6a6bb835dcd5feeb-debian10-cpython-3.7-0)
Raphaël Gomès <rgomes@octobus.net> [Wed, 06 Nov 2019 13:46:16 +0100] rev 43456
rust-status: remove dead code
The `walk_explicit` function is only called when using a prefix matcher, which
the Rust code does not yet support. This function will return in a future
patch, probably with a different signature for performance reasons.
With it, the `files` argument and its interface code can be removed for now.
Differential Revision: https://phab.mercurial-scm.org/D7253
Matt Harbison <matt_harbison@yahoo.com> [Tue, 05 Nov 2019 18:32:00 -0500] rev 43455
hghave: disallow symlinks on Windows
Symlinks on Windows require either a special priviledge, or enabling Developer
Mode. It's probably the latter that is enabled on the new CI machine. But
since Mercurial itself is saying no to symlinks on Windows, the tests for
symlinks shouldn't be attempted. This should fix a lot of the noise in the py3
tests.
Differential Revision: https://phab.mercurial-scm.org/D7233
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 15:00:44 -0800] rev 43454
repoview: avoid wrapping changelog if there's nothing to filter
This simplifies the code a bit by moving the optimizaton for no
filtered revisions to one place. I assume it also makes working with
repos without obsmarkers a little faster, but it doesn't seem
significant.
Differential Revision: https://phab.mercurial-scm.org/D7248
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:33:02 -0800] rev 43453
repoview: move changelog.flags() override to filteredchangelog
Differential Revision: https://phab.mercurial-scm.org/D7247
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:31:50 -0800] rev 43452
repoview: move changelog.parentrevs() override to filteredchangelog
Differential Revision: https://phab.mercurial-scm.org/D7246
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:23:32 -0800] rev 43451
repoview: move changelog.linkrev() override to filteredchangelog
Differential Revision: https://phab.mercurial-scm.org/D7245
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:22:25 -0800] rev 43450
repoview: move changelog.node() override to filteredchangelog
Differential Revision: https://phab.mercurial-scm.org/D7244
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:21:47 -0800] rev 43449
repoview: move changelog.rev() override to filteredchangelog
Differential Revision: https://phab.mercurial-scm.org/D7243
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:17:58 -0800] rev 43448
repoview: move changelog.strip() override to filteredchangelog
Differential Revision: https://phab.mercurial-scm.org/D7242
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:16:46 -0800] rev 43447
repoview: move changelog.headrevs() override to filteredchangelog
Differential Revision: https://phab.mercurial-scm.org/D7241
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:14:45 -0800] rev 43446
repoview: move changelog.revs() override to filteredchangelog
Differential Revision: https://phab.mercurial-scm.org/D7240
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:12:10 -0800] rev 43445
repoview: move changelog.__iter__() override to filteredchangelog
Differential Revision: https://phab.mercurial-scm.org/D7239
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:11:30 -0800] rev 43444
repoview: move changelog.__contains__() override to filteredchangelog
Differential Revision: https://phab.mercurial-scm.org/D7238
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:07:08 -0800] rev 43443
repoview: move changelog.tiprev() override to filteredchangelog
Differential Revision: https://phab.mercurial-scm.org/D7237
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:06:11 -0800] rev 43442
repoview: wrap changelog class when filtering
The class doesn't yet do anything. I'll move the filter-aware
overrides from the changelog class over one by one to this class in
coming patches. That will leave the changelog class simpler and will
centralize more of the filtering logic to repoview. I could not
measure any performance difference.
Differential Revision: https://phab.mercurial-scm.org/D7236
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:00:46 -0800] rev 43441
repoview: extract a function for wrapping changelog
I would like to clean up the changelog class by moving out knowledge
of filtering. The filtering will instead be done in a class that wraps
the changelog. This patch prepares for that.
Differential Revision: https://phab.mercurial-scm.org/D7235
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 14:42:08 -0800] rev 43440
revlog: move tiprev() from changelog up to revlog
This makes the changelog override simpler and it seems more
consistent.
Differential Revision: https://phab.mercurial-scm.org/D7250
Matt Harbison <matt_harbison@yahoo.com> [Tue, 05 Nov 2019 18:25:13 -0500] rev 43439
tests: fix a few `(no-windows !)` conditionals that are really `(symlink !)`
The CI for py3 is assuming that symlinks are possible (they are when running as
Administrator or when Developer Mode is enabled), and these popped up.
Differential Revision: https://phab.mercurial-scm.org/D7232
Raphaël Gomès <rgomes@octobus.net> [Tue, 29 Oct 2019 17:16:28 +0100] rev 43438
rust-matchers: add `Matcher` trait and implement `AlwaysMatcher`
In our quest of a faster Mercurial, we have arrived at the point where we need
to implement the matchers in Rust.
This RFC mainly for the `Matcher` trait to see if the changes proposed feel
fine to people with more experience on the matter. While the `AlwaysMatcher`
implementation is here as a trivial example, it should be the first step
towards matchers use in Rust as it is currently the only supported one.
Notable changes:
- `exact` is renamed to `exact_match`
- enums for `visit*` methods with `Recursive` instead of `'all'`, etc.
- a new `roots`, separate from `file_set`
- no `bad`, `explicitdir` or `traversedir` functions as they can be passed
to the high functions instead of the matchers
Thanks to Martin for suggesting the last two (most important) changes and for
reaching out to help a few weeks ago.
Differential Revision: https://phab.mercurial-scm.org/D7178
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 13:19:24 -0800] rev 43437
merge with stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 04 Nov 2019 00:16:44 +0100] rev 43436
perf: add a way to benchmark `dirstate.status`
Getting more details about time spend in this specific internal bit is
meaningful.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 24 Oct 2019 11:12:17 -0700] rev 43435
largefiles: delete obsolete and unused repo.push()
The function was removed from localrepo in
4d52e6eb98ea (locarepo:
remove the `push` method (API), 2014-09-25).
Differential Revision: https://phab.mercurial-scm.org/D7174
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Tue, 22 Oct 2019 10:01:48 -0400] rev 43434
censor: document that some commands simply ignore censored data
I can't see a benefit for hg grep to ever error out early when it
encounters censored data.
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Tue, 22 Oct 2019 09:56:40 -0400] rev 43433
grep: warn on censored revisions instead of erroring out
We need most of the grep logic to go through in case we encounter a
censored revision, so we just return a None body for a censored node,
and we stop just short of trying to record matches with the contents
of that censored body. The other parts such as recording that the
censored file has been considered at this revision needs to go into
the proper dicts.
I have also gotten weary of all the abbreviations, so while I did a
small refactor to move the file-data-getting operation into a common
function, I also expanded the abbreviations of the relevant variables
within this little function. Hopefully some day this helps someone
figure out what all the abbreviations mean.
Although the censoring docs currently state that some commands error
out or are ignored depending on the `censor.policy` config, I cannot
see a benefit for grep to ever stop dead in its tracks when a censored
revision is encountered. I will also amend the docs to indicate that
some commands, such as grep, unconditionally ignore censored
revisions.
Yuya Nishihara <yuya@tcha.org> [Tue, 15 Oct 2019 22:44:55 +0900] rev 43432
py3: enable legacy fs encoding to fix filename compatibility on Windows
This patch is untested. I just followed the instruction:
https://docs.python.org/3/whatsnew/3.6.html#pep-529-change-windows-filesystem-encoding-to-utf-8
Yuya Nishihara <yuya@tcha.org> [Sat, 19 Oct 2019 14:30:19 +0900] rev 43431
rust-cpython: run cargo fmt
Yuya Nishihara <yuya@tcha.org> [Sat, 05 Oct 2019 09:33:01 -0400] rev 43430
rust-cpython: remove useless PyResult<> from leak_immutable()
The caller should know if the shared data is mutably borrowed or not.
Yuya Nishihara <yuya@tcha.org> [Sat, 05 Oct 2019 09:01:25 -0400] rev 43429
rust-cpython: remove useless PyRefMut wrapper
Yuya Nishihara <yuya@tcha.org> [Sat, 05 Oct 2019 08:59:09 -0400] rev 43428
rust-cpython: drop manual management of mutably_borrowed
RefCell::borrow() should guarantee there's no mutable borrow.
As a follow up, maybe PySharedState can be a pure data structure + function.
Most ref-sharing business has already been moved to PySharedRef* and PyLeaked*.
Yuya Nishihara <yuya@tcha.org> [Sat, 05 Oct 2019 08:56:15 -0400] rev 43427
rust-cpython: leverage RefCell::borrow() to guarantee there's no mutable ref
Since the underlying value can't be mutably borrowed by PyLeaked, we don't
have to manage yet another mutably-borrowed state. We can just rely on the
RefCell implementation.
Maybe we can add try_leak_immutable(), but this patch doesn't in order to
keep the patch series not too long.
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Oct 2019 20:48:30 +0900] rev 43426
rust-cpython: remove useless Option<$leaked> from py_shared_iterator
We no longer need to carefully drop the iterator when it's consumed. Mutation
is allowed even if the iterator exists.
There's a minor behavior change: next(iter) may return/raise something other
than StopIteration if it's called after the iterator has been fully consumed,
and if the Rust object isn't a FusedIterator.
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Oct 2019 20:26:38 +0900] rev 43425
rust-cpython: allow mutation unless leaked reference is borrowed
In other words, mutation is allowed while a Python iterator holding PyLeaked
exists. The iterator will be invalidated instead.
We still need a borrow_count to prevent mutation while leaked data is
dereferenced in Rust world, but most leak_count business is superseded by
the generation counter.
decrease_leak_count(py, true) will be removed soon.
Yuya Nishihara <yuya@tcha.org> [Sat, 05 Oct 2019 08:27:57 -0400] rev 43424
rust-cpython: add generation counter to leaked reference
This counter increments on borrow_mut() to invalidate existing leaked
references. This is modeled after the iterator invalidation in Python.
The other checks will be adjusted by the subsequent patches.
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Oct 2019 19:26:23 +0900] rev 43423
rust-cpython: add stub wrapper that'll prevent leaked data from being mutated
In order to allow mutation of PySharedRefCell value while PyLeaked reference
exists, we need yet another "borrow" scope where mutation is prohibited.
try_borrow<'a> and try_borrow_mut<'a> defines the "borrow" scope <'a>. The
subsequent patches will implement leak counter based on this scope.
PyLeakedRef<T> and PyLeakedRefMut<T> could be unified to PyLeakedRef<&T>
and PyLeakedRef<&mut T> respectively, but I didn't do that since it seemed
a bit weird that deref_mut() would return a mutable reference to an immutable
reference.
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Oct 2019 19:10:51 +0900] rev 43422
rust-cpython: rename PyLeakedRef to PyLeaked
This series will make PyLeaked* behave more like a Python iterator, which
means mutation of the owner object will be allowed and the leaked reference
(i.e. the iterator) will be invalidated instead.
I'll add PyLeakedRef/PyLeakedRefMut structs which will represent a "borrowed"
state, and prevent the underlying value from being mutably borrowed while the
leaked reference is in use:
let shared = self.inner_shared(py);
let leaked = shared.leak_immutable();
{
let leaked_ref: PyLeakedRef<_> = leaked.borrow(py);
shared.borrow_mut(); // panics since the underlying value is borrowed
}
shared.borrow_mut(); // allowed
The relation between PyLeaked* structs is quite similar to RefCell/Ref/RefMut,
but the implementation can't be reused because the borrowing state will have
to be shared across objects having no lifetime relation.
PyLeaked isn't named as PyLeakedCell since it isn't actually a cell in that
leaked.borrow_mut() will require &mut self.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Nov 2019 08:42:42 -0800] rev 43421
py3: don't use bytes with vars() or __dict__
Inspired by D7227. These were all the remaining instances I could
find.
Differential Revision: https://phab.mercurial-scm.org/D7230
Augie Fackler <raf@durin42.com> [Tue, 05 Nov 2019 12:10:38 -0500] rev 43420
Added signature for changeset
ca3dca416f8d
Augie Fackler <raf@durin42.com> [Tue, 05 Nov 2019 12:10:38 -0500] rev 43419
Added tag 5.2 for changeset
ca3dca416f8d
Yuya Nishihara <yuya@tcha.org> [Tue, 05 Nov 2019 21:35:19 +0900] rev 43418
py3: add inline comment about encoding issue of str(Abort())
Yuya Nishihara <yuya@tcha.org> [Tue, 05 Nov 2019 21:29:40 +0900] rev 43417
py3: do not reimplement Abort.__str__() on Python 2
It isn't necessary on Python 2, and the default implementation should be
better than our BaseException_str() clone.
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Nov 2019 20:57:31 -0800] rev 43416
tests: write out file using bytes I/O
The encoding of sys.stdout varies between Python versions. So
using a one-liner to write a file from a Unicode string is not
deterministic.
This commit writes out the file using bytes I/O to ensure we
have exactly the bytes we want in the file.
This change fixes a test failure in Python 3.5/3.6.
Differential Revision: https://phab.mercurial-scm.org/D7226
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Nov 2019 20:46:19 -0800] rev 43415
import-checker: open all source files as utf-8
Before, we opened in text mode and used the default encoding
to interpret the bytes within.
This caused problems interpreting some byte sequences in some
files.
This commit changes things to always open files as UTF-8, which
makes the error go away.
test-check-module-imports.t now passes on Python 3.5 and 3.6
with this change.
Differential Revision: https://phab.mercurial-scm.org/D7225
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Nov 2019 21:17:34 -0800] rev 43414
localrepo: use str for lookup in vars()
vars() returns a dict of str. So always use a native str for
the key lookup.
Differential Revision: https://phab.mercurial-scm.org/D7227
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Nov 2019 23:44:10 -0800] rev 43413
automation: install python3-venv Debian package
Debian's python install has a crippled venv by default, as it is
lacking ensurepip. When you try to run `python3 -m venv` it tells
you to install `python3-venv`. So this commit does that in our
automation environment so we can fully test installing Mercurial
using venv+pip with the system Python.
Differential Revision: https://phab.mercurial-scm.org/D7229
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Nov 2019 23:42:18 -0800] rev 43412
tests: look for ensurepip before using venv
Debian appears to cripple the venv module by default by
removing the associated ensurepip functionality. (The module
isn't present at all.) This caused test-install.t to fail when
using the Debian python3 unless the python3-venv package was
installed.
This commit introduces a new hghave requirement for detecting
ensurepip and makes the Python 3 install variant conditional on
its presence. This should make test-install.t pass when
using an incomplete Debian Python.
Differential Revision: https://phab.mercurial-scm.org/D7228
Matt Harbison <matt_harbison@yahoo.com> [Thu, 17 Oct 2019 16:46:13 -0400] rev 43411
automation: avoid '~' in the temp directory on Windows
If a long-ish username is used, the environment variable ends up with a '~' to
be 8.3 path compatible. That in turn causes a handful of tests (mostly ssh
related) to add quotes around $TESTMP.
I have no AWS experience, so I have no idea if this is the proper way to do it.
But I've hit this problem locally, and redirecting the directory is a
workaround. I don't recall if the directory is created on demand by the test
harness, but presumably if this is configured before the machine boots, Windows
will do it for us.
Differential Revision: https://phab.mercurial-scm.org/D7130
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Nov 2019 20:33:38 -0800] rev 43410
tests: use venv on Python 3
This test was failing in some Python 3 environments because
`$PYTHON -m virtualenv` was somehow resulting in Python 2
being used. Why, I'm not sure.
Python 3 includes virtualenv in the standard library as the
`venv` module.
This commit changes test-install.t to use `$PYTHON -m venv` on
Python 3 and `$PYTHON -m virtualenv` on Python 2 (if available).
I chose to make some test output duplicated because we can't
have nested conditionals and there is no easy way to express
ORing of hghave checks.
Differential Revision: https://phab.mercurial-scm.org/D7224
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Nov 2019 20:10:51 -0800] rev 43409
tests: remove HGALLOWPYTHON3 reference
This variable was removed from setup.py in
c3e10f705a6c.
Differential Revision: https://phab.mercurial-scm.org/D7223
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Nov 2019 20:21:31 -0800] rev 43408
run-tests: use byte strings for inserted output
We were inserting str on Python 3 which resulted in mixed
str/bytes types on the list. This would later blow up when
trying to write str to the .err file opened in bytes mode.
Differential Revision: https://phab.mercurial-scm.org/D7222
Ian Moody <moz-ian@perix.co.uk> [Mon, 04 Nov 2019 19:19:36 +0000] rev 43407
contrib: require Python 3.7 for byteify-strings.py
bb509f39d387 made an error, it's actually 3.7 that introduced token.COMMENT.
Differential Revision: https://phab.mercurial-scm.org/D7220
Augie Fackler <augie@google.com> [Mon, 04 Nov 2019 12:20:11 -0500] rev 43406
hghave: fix bytes/string issue on Python 3
Mathias De Mare <mathias.de_mare@nokia.com> [Mon, 04 Nov 2019 07:56:53 +0100] rev 43405
packaging: add support for CentOS 8
The resulting executable has not been tested in detail yet.
I ran 'hg version' and 'hg clone', which worked fine
(except for extensions acting up due to Python 3).
Differential Revision: https://phab.mercurial-scm.org/D7216
Mathias De Mare <mathias.de_mare@nokia.com> [Mon, 04 Nov 2019 07:40:32 +0100] rev 43404
packaging: allow choosing python version depending on centos version
Differential Revision: https://phab.mercurial-scm.org/D7217
Ian Moody <moz-ian@perix.co.uk> [Mon, 04 Nov 2019 19:05:44 +0000] rev 43403
fsmonitor: use stringutil.forcebytestr() instead of str() on an exception
Similar to
5fa8ac91190e / D7206, should get test-install.t passing on py3.
Differential Revision: https://phab.mercurial-scm.org/D7218
Denis Laxalde <denis@laxalde.org> [Mon, 04 Nov 2019 16:13:01 +0100] rev 43402
py3: add a __str__ method to Abort
This improves the rendering of some exceptions by avoiding raw
bytestrings, especially when using --traceback option.
Denis Laxalde <denis@laxalde.org> [Mon, 04 Nov 2019 16:04:09 +0100] rev 43401
py3: add Python 3 exception output to test-lfs-serve-access.t
Similar to
a973a75e92bf or
3e9c6cef949b.
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 31 Oct 2019 19:54:58 -0700] rev 43400
automation: install black
This should unblock us from running the code formatting test in
our automated environment.
Differential Revision: https://phab.mercurial-scm.org/D7197
Ian Moody <moz-ian@perix.co.uk> [Sat, 02 Nov 2019 22:21:25 +0000] rev 43399
py3: use %d to format an int
Avoids a TypeError under py3. Fortunately this is very much an edge case since
it requires the user to have deliberately created a local tag of the form
'D\d+' that isn't truthful.
Differential Revision: https://phab.mercurial-scm.org/D7215
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 15:02:35 -0700] rev 43398
fsmonitor: normalize exception types to bytes
Unavailable.msg should now always be bytes.
We also rename Unavailable.__str__ to __bytes__ as it always
returns bytes. We make __str__ a simple wrapper that decodes that
result to str.
There's probably some excessive strutil.forcebytestr() in
fsmonitor/__init__.py now. But at least the exceptions around
type coercion should now be gone.
Differential Revision: https://phab.mercurial-scm.org/D7214
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 14:55:45 -0700] rev 43397
fsmonitor: normalize clock value to bytes
We normalize the value returned by watchman because
we perform a number of compares with this value in code.
So the easiest path forward is to normalize to bytes so we
don't have to update many call sites.
With this commit, the fsmonitor extension appears to be working
with Python 3! Although there are still some failures in edge
cases...
Differential Revision: https://phab.mercurial-scm.org/D7213
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 14:27:55 -0700] rev 43396
fsmonitor: use next() instead of .next()
This is needed for Python 3 compatibility.
Differential Revision: https://phab.mercurial-scm.org/D7212
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 14:26:06 -0700] rev 43395
fsmonitor: normalize Watchman paths to bytes
Otherwise it will be a str on Python 3 and operations below
which operate in the bytes domain will fail.
Differential Revision: https://phab.mercurial-scm.org/D7211
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 14:17:48 -0700] rev 43394
fsmonitor: handle unicode keys in tuples
In Python 3, keys in the bset tuple are typically str, not
bytes. PyBytes_AsString() would return NULL. But we weren't
checking the return value and this would lead to a segfault.
This commit makes the code type and Python version aware. The
Python version specific code is to allow us to utilize a
modern API for converting str -> char* without having to
allocate an extra PyObject.
FWIW I wanted to assume that keys were always str. However,
there appear to be some bytes keys in some cases. I haven't
debugged this further.
Differential Revision: https://phab.mercurial-scm.org/D7210
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 13:39:23 -0700] rev 43393
fsmonitor: make _hashignore compatible with Python 3
The Hasher wants a bytes but we were feeding it a str. Let's
use our repr() implementation to return bytes.
In addition, the hexdigest() would return a str, which would be
compared against a bytes and would always fail. Normalize to
bytes so the compare works.
Differential Revision: https://phab.mercurial-scm.org/D7209
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 13:34:40 -0700] rev 43392
fsmonitor: normalize hostname to bytes
Without this, we get a str/bytes mismatching when using %
formatting a few lines below.
Differential Revision: https://phab.mercurial-scm.org/D7208
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 13:30:23 -0700] rev 43391
fsmonitor: access repo.root
There is no repo._root. It looks like fsmonitor has
been busted since this access was introduced in
ab1900323b1 in July 2019!
Differential Revision: https://phab.mercurial-scm.org/D7207
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 13:08:20 -0700] rev 43390
fsmonitor: coerce watchman exception to bytes
Without this, we get errors due to passing str to a function
which expects bytes.
Differential Revision: https://phab.mercurial-scm.org/D7206
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 13:04:47 -0700] rev 43389
fsmonitor: fix str/bytes mismatch when accessing watchman version
There were 2 bugs here. First, keys in the tuple are always
str. Second, we needed to normalize the value to bytes to
prevent a str/bytes mismatch on Python 3.
With this commit, `hg debuginstall` with fsmonitor enabled now
works on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D7205
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 12:54:47 -0700] rev 43388
fsmonitor: reapply
b1f62cd39b5c
The recent revendoring of pywatchman undid this changeset.
Let's reapply it.
This commit was generated by running `hg graft -f
b1f62cd39b5c`.
It applied cleanly.
Differential Revision: https://phab.mercurial-scm.org/D7204
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 12:52:58 -0700] rev 43387
fsmonitor: reapply
dd35abc409ee
The recent revendoring of pywatchman undid this bug fix.
Let's reapply it.
Differential Revision: https://phab.mercurial-scm.org/D7203
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 12:51:28 -0700] rev 43386
fsmonitor: remove pywatchman from exclusion rule
The recently vendored pywatchman code base is now formatted
with black. We can now remove pywatchman from our black
exclusion rule.
Differential Revision: https://phab.mercurial-scm.org/D7202
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 12:42:23 -0700] rev 43385
fsmonitor: refresh pywatchman with upstream
This commit vendors pywatchman commit
259dc66dc9591f9b7ce76d0275bb1065f390c9b1
from upstream without modifications. The previously vendored pywatchman
from changeset
16f4b341288d was from Git commit c77452.
This commit effectively undoes the following Mercurial changesets:
*
dd35abc409ee fsmonitor: correct an error message
*
b1f62cd39b5c fsmonitor: layer on another hack in bser.c for os.stat()
compat (
issue5811)
*
c31ce080eb75 py3: convert arguments, cwd and env to native strings when
spawning subprocess
*
876494fd967d cleanup: delete lots of unused local variables
*
57264906a996 watchman: add the possibility to set the exact watchman
binary location
The newly-vendored code has support for specifying the binary location,
so
57264906a996 does not need applied. But we do need to modify our
code to specify a proper argument name.
876494fd967d is not important, so it will be ignored.
c31ce080eb75 globally changed the code base to always pass
str to subprocess. But pywatchman's code is Python 3 clean, so
we don't need to do this.
This leaves
dd35abc409ee and
b1f62cd39b5c, which will be re-applied in
subsequent commits.
Differential Revision: https://phab.mercurial-scm.org/D7201
Denis Laxalde <denis@laxalde.org> [Mon, 04 Nov 2019 10:09:08 +0100] rev 43384
py3: encode strings before setting rev summary in gnuarch converter
Denis Laxalde <denis@laxalde.org> [Mon, 04 Nov 2019 09:56:10 +0100] rev 43383
py3: use raw string to query EmailMessage in gnuarch converter
Denis Laxalde <denis@laxalde.org> [Mon, 04 Nov 2019 09:52:13 +0100] rev 43382
py3: use mail.parsebytes() in gnuarch catlog parser
We drop 'catlogparser' attribute now unused.
Denis Laxalde <denis@laxalde.org> [Mon, 04 Nov 2019 09:35:10 +0100] rev 43381
tests: handle Message-Id line wrapping in test-notify-changegroup.t
This fixes this test on Python 3 with a long hostname. See changeset
4128ffba4431 for details.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 12:09:35 -0700] rev 43380
py3: define and use json.loads polyfill
Python 3.5's json.loads() requires a str. Only Python 3.6+
supports passing a bytes or bytearray.
This commit implements a json.loads() polyfill on Python 3.5
so that we can use bytes. The added function to detect encodings
comes verbatim from Python 3.7.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 11:48:38 -0700] rev 43379
contrib: require Python 3.6 for byteify-strings.py
This script makes use of `token.COMMENT`, which apparently
isn't present until Python 3.6. So make the script and its
test conditional on Python 3.6.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 11:42:46 -0700] rev 43378
demandimportpy3: only use lazy extension loader on Python 3.6+
There was an inline comment denoting a bug in the lazy extension
loader on Python 3.5 which prevents it from working there. But the
code was not conditional on the Python version.
The result of this was a myriad of failures on Python 3.5 due to
getattr() and friends not working on lazy extension modules.
By making extension modules non-lazy on Python 3.5, we reduce the
number of test failures from 48 to 22 on that Python version.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Nov 2019 15:33:39 -0700] rev 43377
ui: flush before prompting for input with readline
I was using `hg absorb` with Python 3 and noticed that the
prompt was appearing without any output about what would be
done. After I answered the prompt, the output was printed
to stdout.
This appears to be a buffering difference between Python 2
and Python 3.
To work around it, this commit adds an explicit flush() before
calling the raw input function when readline is used.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 01 Nov 2019 21:46:34 -0700] rev 43376
histedit: restore hex nodeids to be 12 digits long
I accidentally switched from 12 digits to 40 digits while making the
code py3-compatible. Thanks to Yuya for noticing.
Differential Revision: https://phab.mercurial-scm.org/D7200
Martin von Zweigbergk <martinvonz@google.com> [Tue, 29 Oct 2019 10:54:08 -0700] rev 43375
tests: fix typo "includfe"
Differential Revision: https://phab.mercurial-scm.org/D7180
Emmanuel Leblond <emmanuel.leblond@gmail.com> [Fri, 01 Nov 2019 11:02:47 -0700] rev 43374
py3: fix fsmonitor's _watchmantofsencoding exception message encoding
Differential Revision: https://phab.mercurial-scm.org/D7190
Martin von Zweigbergk <martinvonz@google.com> [Thu, 31 Oct 2019 15:03:12 -0700] rev 43373
py3: use native strings as keys into **opts in chistedit
Now you should be able to successfully confirm your histedit plan (at
least in the case I tried). Even continuing after conflicts and
finishing the histedit worked.
Differential Revision: https://phab.mercurial-scm.org/D7186
Martin von Zweigbergk <martinvonz@google.com> [Thu, 31 Oct 2019 15:00:49 -0700] rev 43372
py3: open chistedit file in binary mode using vfs
We write bytes to the file, so it should be open in binary
mode. Opening it via the vfs takes care of that for us.
Now you'll get yet a different traceback if you try to confirm you
histedit plan.
Differential Revision: https://phab.mercurial-scm.org/D7185
Martin von Zweigbergk <martinvonz@google.com> [Thu, 31 Oct 2019 15:02:48 -0700] rev 43371
py3: avoid another b''.format() in chistedit
Now you'll get a different traceback if you try to confirm you
histedit plan.
Differential Revision: https://phab.mercurial-scm.org/D7184
Martin von Zweigbergk <martinvonz@google.com> [Thu, 31 Oct 2019 15:02:03 -0700] rev 43370
py3: render message about conflicts in chistedit code
Now you can also reorder commits that (potentially) conflict. Just
don't try to confirm the changes yet (because then it crashes).
Differential Revision: https://phab.mercurial-scm.org/D7183
Martin von Zweigbergk <martinvonz@google.com> [Thu, 31 Oct 2019 14:46:17 -0700] rev 43369
py3: handle keypresses in chistedit
Now you can navigate and change the action for a commit. You can also
reorder commits, as long as that doesn't result in a conflict (then it
crashes).
Differential Revision: https://phab.mercurial-scm.org/D7182
Martin von Zweigbergk <martinvonz@google.com> [Thu, 31 Oct 2019 14:25:51 -0700] rev 43368
py3: make chistedit render
Now you can see the list of commits, but it crashes when you press a
key.
Differential Revision: https://phab.mercurial-scm.org/D7181
Emmanuel Leblond <emmanuel.leblond@gmail.com> [Fri, 01 Nov 2019 17:23:02 +0100] rev 43367
py3: fix exception display encoding in contrib/simplemerge.py
Differential Revision: https://phab.mercurial-scm.org/D7191
Emmanuel Leblond <emmanuel.leblond@gmail.com> [Fri, 01 Nov 2019 17:31:47 +0100] rev 43366
py3: fix exception message check in test-linerange.py's testOutOfRange
Differential Revision: https://phab.mercurial-scm.org/D7192
Emmanuel Leblond <emmanuel.leblond@gmail.com> [Fri, 01 Nov 2019 17:35:36 +0100] rev 43365
py3: fix exception message encoding in scmutil.py's simplekeyvaluefile.read
Differential Revision: https://phab.mercurial-scm.org/D7193
Emmanuel Leblond <emmanuel.leblond@gmail.com> [Fri, 01 Nov 2019 17:38:07 +0100] rev 43364
py3: fix crecord.py's editpatchwitheditor exception message encoding
Differential Revision: https://phab.mercurial-scm.org/D7194
Emmanuel Leblond <emmanuel.leblond@gmail.com> [Fri, 01 Nov 2019 17:39:17 +0100] rev 43363
py3: fix exception message encoding in infinitepush
Differential Revision: https://phab.mercurial-scm.org/D7195
Emmanuel Leblond <emmanuel.leblond@gmail.com> [Fri, 01 Nov 2019 10:57:31 -0700] rev 43362
py3: fix fsmonitor's _handleunavailable exception message encoding
Differential Revision: https://phab.mercurial-scm.org/D7196
Mads Kiilerich <mads@kiilerich.com> [Fri, 01 Nov 2019 14:54:08 +0100] rev 43361
packaging: update built-in Fedora support to Fedora 31
This is now quite easy ...
Mads Kiilerich <mads@kiilerich.com> [Fri, 01 Nov 2019 13:51:44 +0100] rev 43360
packaging: refactor "fedora29" target to a single more generic "fedora" target
Fedora moves fast in version numbers, and often with Mercurial packaging being
backwards compatible. Also, most people use the system package. There is thus
much work and tech debt and little value in providing explicit built-in support
for several versions. Thus, only aim for providing built-in support for latest
Fedora version, and make it easy to update.
Mads Kiilerich <mads@kiilerich.com> [Fri, 01 Nov 2019 15:29:14 +0100] rev 43359
packaging: make dockerrpm fedora target more generic
Fedora moves fast in version numbers, and often with Mercurial packaging being
backwards compatible. Thus, only aim for providing built-in support for latest
Fedora version, and make it easy to update.
With this refactoring, 'dockerrpm fedora31' also works.
'dockerrpm fedora' will use the 'fedora:latest' Docker image.
Mads Kiilerich <mads@kiilerich.com> [Fri, 01 Nov 2019 12:59:22 +0100] rev 43358
packaging: use "python3" for fedora29 ... and as buildrpm default
Change the buidrpm default. The CentOS targets explicitly use "python", and
changing the default will only influence Fedora 29.
A Python 3 package needs python3 dependencies, so pythonexe (and pythonver) is
used for specifying dependencies. Other OS versions will keep using "python" as
before ... or potentially change to explicit "python2". Fedora 29 packages can
thus also still be built for Python 2 - just not in the docker image that is
updated for Python 3.
Mads Kiilerich <mads@kiilerich.com> [Fri, 01 Nov 2019 12:47:38 +0100] rev 43357
packaging: use "--python python" for centos7 to avoid explicit "python2"
This is a partial backout of
92a51a45d44c.
We will need to be able to control whether package dependencies are python2 or
python3. Generally (at least in recent Fedora), the package prefix match the
name of the python executable ... but CentOS 7 doesn't use the python2 prefix
in package name or alias for python-docutils yet, so just keep centos7 in the
unversioned "python" world.
Change the new (unused) buildrpm "--python3" option (introduced in
a6dcac6454c1) to "--python python3" to get a more generic method for explicit
control over whether we use python, python2 or python3.
Mads Kiilerich <mads@kiilerich.com> [Fri, 01 Nov 2019 12:34:08 +0100] rev 43356
packaging: fix docker-centos5 - use pythonexe and set to "python" as before
Fix
92a51a45d44c .
Mads Kiilerich <mads@kiilerich.com> [Fri, 01 Nov 2019 12:18:17 +0100] rev 43355
packaging: move dockerrpm output directory creation to dockerrpm
Avoid having to compute the directory in two places in different environments.
Mads Kiilerich <mads@kiilerich.com> [Thu, 31 Oct 2019 11:53:11 +0100] rev 43354
packaging: drop "support" for unsupported Fedora versions
Fedora 31 has just been released, and Fedora 29 will be EOL in a month. Don't
spend any time thinking about dead stuff.
Augie Fackler <augie@google.com> [Wed, 30 Oct 2019 16:39:18 -0400] rev 43353
mail: black wants to add this blank line
I can't figure out how this got overlooked on previous runs, but here
we are. It looks like the culprit change is already public?
Augie Fackler <augie@google.com> [Wed, 30 Oct 2019 16:29:45 -0400] rev 43352
hghave: verify we have a black that is new enough for our format
We require what is currently the absolute latest black, so let's be paranoid.
Augie Fackler <augie@google.com> [Wed, 30 Oct 2019 16:17:39 -0400] rev 43351
contrib: fix up example fix configuration for our move to released black
Ian Moody <moz-ian@perix.co.uk> [Wed, 23 Oct 2019 22:24:14 +0100] rev 43350
phabricator: use True primitive instead of b'true' for phabupdate actions
Something I'd missed in the creatediff port. This didn't matter before with
the old PHP form style wireformat, but breaks with the new arcanist format.
Differential Revision: https://phab.mercurial-scm.org/D7152
Ian Moody <moz-ian@perix.co.uk> [Wed, 23 Oct 2019 15:07:56 +0100] rev 43349
setup: allow py3 install without env vars
5.2 is the first release of Mercurial where py3 support is expected to be
widely used, therefore we should allow installing it without hoop-jumping.
Differential Revision: https://phab.mercurial-scm.org/D7151
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 29 Oct 2019 11:07:25 +0100] rev 43348
formatting: drop `grey`, our custom black version
Now that the official black has all we want, we can drop this.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 29 Oct 2019 10:43:47 +0100] rev 43347
formatting: using black to check for formatting
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 29 Oct 2019 10:41:30 +0100] rev 43346
formatting: run black version 19.10b0 on the codebase
The latest version of black is out and contains the change we needed. So we can
start using it now.
note: `test-check-format.t` will complains about this changes because it still
use `grey` and need to be migrated to `black`. See next changesets for this.
Mads Kiilerich <mads@kiilerich.com> [Sun, 27 Oct 2019 20:16:59 +0100] rev 43345
packaging: fix buildrpm whitespace
Mads Kiilerich <mads@kiilerich.com> [Sun, 27 Oct 2019 20:16:38 +0100] rev 43344
packaging: drop outdated buildrpm "tested on" comment
Packaging usually works on other versions too, and it is not efficient to
maintain the list in repo. It is already out of sync with the Makefile targets.
Mads Kiilerich <mads@kiilerich.com> [Mon, 28 Oct 2019 00:29:42 +0100] rev 43343
packaging: also include hgweb.wsgi in rpms
Mads Kiilerich <mads@kiilerich.com> [Sun, 27 Oct 2019 21:28:26 +0100] rev 43342
packaging: introduce Python3 support as buildrpm --python3
Just overrule the HGPYTHON3 warning.
Mads Kiilerich <mads@kiilerich.com> [Sun, 27 Oct 2019 21:40:21 +0100] rev 43341
packaging: be explicit about Python version in rpm spec
Fedora 31 has Python3 at /usr/bin/python ... but expect everybody to not just
find python in $PATH but be explicit about whether they want python2 or
python3. mercurial.spec just used 'python' and would fail when it unknowingly
used Python 3 and ended up with Mercurial setup.py reporting "Python 3.7
detected." and talking about the HGPYTHON3 environment variable.
For now, just be explicit about using system python2 as python executable when
building rpms.
Mads Kiilerich <mads@kiilerich.com> [Sun, 27 Oct 2019 20:17:33 +0100] rev 43340
packaging: make python snippets in rpm building python3 compatible
Fedora 31 has Python3 at /usr/bin/python, and buildrpm would fail on snippets
that use python2 syntax. Instead of forcing python2, just accept for the future
while staying backwards compatible.