Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 16:15:22 -0700] rev 39846
localrepo: add missing join()
Differential Revision: https://phab.mercurial-scm.org/D4705
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 11:38:05 -0700] rev 39845
revlog: use proper version comparison during verify
Verify appears to want to compare the changelog's revlog version
number with the version number of filelogs and error if they are
different. But what it was actually doing was comparing the full
32-bit header integer, which contains 2 shorts: 1 for the revlog
version number and 1 for feature flags.
This commit tweaks the verification code so it only looks at the
version number component of the header and emits a warning if they
differ.
The new code is more robust because it accounts for future revlog
version numbers without them needing to be special cased.
Differential Revision: https://phab.mercurial-scm.org/D4704
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 11:22:56 -0700] rev 39844
filelog: stop proxying checksize() (API)
This was only used by verify code. And the check using it is now
implemented as part of verifyintegrity(). The method is unused
and is revlog-centric, which means it isn't appropriate for the file
storage interface. So remove it.
Differential Revision: https://phab.mercurial-scm.org/D4703
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 11:20:02 -0700] rev 39843
filelog: remove version attribute (API)
This was only used by verify code. The check it was used for is now
implemented as part of the verifyintegrity() implementation. The
attribute is now unused, is revlog-specific, and isn't appropriate
to be exposing on the file storage interface. So drop it.
Differential Revision: https://phab.mercurial-scm.org/D4702
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 19 Sep 2018 11:17:28 -0700] rev 39842
verify: start to abstract file verification
Currently, the file storage interface has a handful of attributes
that are exclusively or near-exclusively used by repo verification
code. In order to support verification on non-revlog/alternate
storage backends, we'll need to abstract verification so it can
be performed in a storage-agnostic way.
This commit starts that process.
We establish a new verifyintegrity() method on revlogs and expose
it to the file storage interface. Most of verify.verifier.checklog()
has been ported to this new method.
We need a way to represent verification problems. So we invent an
interface to represent a verification problem, invent a revlog type
to implement that interface, and use it.
The arguments to verifyintegrity() will almost certainly change in
the future, once more functionality is ported from the verify code.
And the "revlogv1" version check is very hacky. (The code in verify
is actually buggy because it is comparing the full 32-bit header
integer instead of just the revlog version short. I'll likely fix
this in a subsequent commit.)
Differential Revision: https://phab.mercurial-scm.org/D4701
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 24 Sep 2018 08:58:57 -0700] rev 39841
unionrepo: remove _constructmanifest()
It is unused after a previous refactor. Spotted in D4641.
Differential Revision: https://phab.mercurial-scm.org/D4700
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 26 Sep 2018 08:46:56 -0700] rev 39840
merge with stable
Martin von Zweigbergk <martinvonz@google.com> [Tue, 25 Sep 2018 08:53:20 -0700] rev 39839
encoding: remove unnecessary lambdas from _encodingfixers
They have been unnecessary since
1a3a08b5d4d5 (encoding: remove
workaround for locale.getpreferredencoding(), 2017-05-13). Also rename
the variable since "fixer" sounds like a function.
Differential Revision: https://phab.mercurial-scm.org/D4743
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 25 Sep 2018 18:59:04 -0700] rev 39838
py3: cast exception to bytes
In order to appease Python 3.
Differential Revision: https://phab.mercurial-scm.org/D4733
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 25 Sep 2018 09:11:56 -0700] rev 39837
py3: cast exception to bytes
This was raising a TypeError on Python 3 and preventing most (all?)
wireprotov2 commands from working.
Differential Revision: https://phab.mercurial-scm.org/D4731
Matt Harbison <matt_harbison@yahoo.com> [Tue, 25 Sep 2018 23:25:36 -0400] rev 39836
py3: remove a couple of superfluous calls to pycompat.rapply()
These places can only be strings.
Matt Harbison <matt_harbison@yahoo.com> [Tue, 25 Sep 2018 22:11:17 -0400] rev 39835
py3: byteify an inline python test extension
# skip-blame for b'' prefixing
Matt Harbison <matt_harbison@yahoo.com> [Tue, 25 Sep 2018 21:39:42 -0400] rev 39834
py3: conditionalize access to socketserver.ForkingMixIn
This is no longer exported on platforms that don't support forking, as of 3.6.
https://github.com/python/cpython/commit/
aadff9bea61a2fc9f4cf0f213f0ee50fc54d6574
Matt Harbison <matt_harbison@yahoo.com> [Tue, 25 Sep 2018 22:46:18 -0400] rev 39833
convert: fix a file descriptor leak
test-check-code flagged this after I changed this line for something unrelated.
Yuya Nishihara <yuya@tcha.org> [Wed, 26 Sep 2018 20:33:09 +0900] rev 39832
merge with stable
Yuya Nishihara <yuya@tcha.org> [Tue, 25 Sep 2018 22:19:40 +0900] rev 39831
revlog: catch more specific exception in shortest()
Since revlog._partialmatch() catches RevlogError coming from cext and
re-raises AmbiguousPrefixLookupError, catching RevlogError here seems
less correct.
Differential Revision: https://phab.mercurial-scm.org/D4735
Matt Harbison <matt_harbison@yahoo.com> [Mon, 24 Sep 2018 22:32:30 -0400] rev 39830
py3: update missing module list in test-check-py3-compat.t for Windows
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 24 Sep 2018 20:31:42 -0700] rev 39829
py3: add b'' prefixes to wire protocol test
Otherwise the CBOR encoder fails on Python 3 due to lacking support
for encoding str/unicode.
# skip-blame just some b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D4734
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 24 Sep 2018 20:17:42 -0700] rev 39828
py3: use pycompat.strkwargs()
Otherwise we get an error attempting to dispatch a command with
arguments because we're passing a dict with bytes keys.
Differential Revision: https://phab.mercurial-scm.org/D4732
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 24 Sep 2018 20:10:01 -0700] rev 39827
py3: ensure _start_response() is called with system string
This was preventing HTTP 500's from being sent in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D4730
Matt Harbison <matt_harbison@yahoo.com> [Sun, 23 Sep 2018 00:47:04 -0400] rev 39826
py3: convert arguments, cwd and env to native strings when spawning subprocess
This keeps Windows happy.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 21 Sep 2018 21:14:27 -0400] rev 39825
py3: apply byteskwargs to contrib/perf
Matt Harbison <matt_harbison@yahoo.com> [Fri, 21 Sep 2018 20:28:00 -0400] rev 39824
py3: un-byteify strings around os.system() and os.devnull in contrib/perf
Matt Harbison <matt_harbison@yahoo.com> [Fri, 21 Sep 2018 20:16:13 -0400] rev 39823
py3: work around the lack of sys.maxint in contrib/perf
Matt Harbison <matt_harbison@yahoo.com> [Fri, 21 Sep 2018 20:13:14 -0400] rev 39822
py3: switch contrib/perf from xrange to pycompat.xrange
Matt Harbison <matt_harbison@yahoo.com> [Fri, 21 Sep 2018 20:10:36 -0400] rev 39821
py3: handle sysstr conversion around get/set attr in contrib/perf
Matt Harbison <matt_harbison@yahoo.com> [Fri, 21 Sep 2018 20:03:07 -0400] rev 39820
py3: proxy posixfile objects to re-add a useful 'name' attribute on Windows
This file object is used in the vfs layer, so there are many errors like this:
...
File "mercurial\localrepo.py", line 2569, in savecommitmessage
return self.pathto(fp.name[len(self.root) + 1:])
TypeError: 'int' object is not subscriptable
It looks like the 'name' value is actually the fileno() value, and the
documentation says the name parameter to PyFile_FromFd() is ignored. [1] I
tried just assigning the attribute after osutil.posixfile() returns, but that
crashes saying that it's read-only.
[1] https://docs.python.org/3.6/c-api/file.html
Matt Harbison <matt_harbison@yahoo.com> [Sun, 23 Sep 2018 22:36:44 -0400] rev 39819
py3: don't use os.getcwdb() on Windows to avoid DeprecationWarnings
See also
ac32685011a3.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 21 Sep 2018 19:48:23 -0400] rev 39818
py3: rename pycompat.getcwd() to encoding.getcwd() (API)
We need to avoid os.getcwdb() on Windows to avoid DeprecationWarnings, and we
need encoding.strtolocal() to encode the result of os.getcwd().
Augie Fackler <augie@google.com> [Mon, 24 Sep 2018 22:46:22 -0400] rev 39817
py3: whitelist two more passing tests
Caught by the ratchet, but initially only the non-legacy path of
test-clone-uncompressed.t was passing. That required the preceding
patch.
Differential Revision: https://phab.mercurial-scm.org/D4729