Rodrigo Damazio <rdamazio@google.com> [Sun, 06 Oct 2019 03:30:00 -0400] rev 43181
help: adding a help category to narrow and remotefilelog commands
Differential Revision: https://phab.mercurial-scm.org/D6998
Yuya Nishihara <yuya@tcha.org> [Sun, 15 Sep 2019 17:02:31 +0900] rev 43180
rust-cpython: drop self.borrow_mut() in favor of PySharedRef wrapper
Yuya Nishihara <yuya@tcha.org> [Sun, 15 Sep 2019 16:59:50 +0900] rev 43179
rust-cpython: drop self.leak_immutable() in favor of PySharedRef wrapper
Yuya Nishihara <yuya@tcha.org> [Sun, 15 Sep 2019 16:50:48 +0900] rev 43178
rust-cpython: add safe wrapper representing shared data borrowed from PyObject
PySharedRef is a tempoary wrapper around PySharedRefCell. It provides safe
functions for each shared data. $shared_accessor implements a safe method
to construct PySharedRefCell.
This allows us to add more than once PySharedRefCell to a Python object.
Yuya Nishihara <yuya@tcha.org> [Sun, 08 Sep 2019 20:26:55 +0900] rev 43177
rust-cpython: move $leaked struct out of macro
It wasn't easy to hack the $leaked struct since errors in macro would
generate lots of compile errors. Let's make it a plain struct so we can
easily extend it.
PyLeakedRef keeps a more generic PyObject instead of the $name struct
since it no longer has to call any specific methods implemented by
the $name class. $leaked parameter in py_shared_iterator!() is kept
for future change.
Yuya Nishihara <yuya@tcha.org> [Sun, 15 Sep 2019 16:04:45 +0900] rev 43176
rust-cpython: store leaked reference to PySharedState in $leaked struct
I want to move it out of the macro, and allow multiple sharable objects
per PyObject.
Yuya Nishihara <yuya@tcha.org> [Tue, 17 Sep 2019 07:59:25 +0900] rev 43175
rust-cpython: mark PySharedState as Sync so &'PySharedState can be Send
The goal is to store &'static PySharedState in $leaked struct, which allows
us to move the $leaked struct out of the macro. Currently, it depends on
inner.$data_member(py), which can't be generalized.
PySharedState is Sync because any mutation or read operation is synchronized
by the Python GIL, py: Python<'a>, which should guarantee that &'PySharedState
can be sent to another thread.
Yuya Nishihara <yuya@tcha.org> [Sat, 14 Sep 2019 23:17:19 +0900] rev 43174
rust-cpython: move borrow_mut() to PySharedRefCell
PySharedRefCell() will host almost all py_shared public functions. This change
is the first step.
borrow_mut() can be safely implemented since PySharedRefCell knows its inner
object is managed by its own py_shared_state.
Yuya Nishihara <yuya@tcha.org> [Sat, 14 Sep 2019 23:01:51 +0900] rev 43173
rust-cpython: move py_shared_state to PySharedRefCell object
The goal of this series is to encapsulate more "py_shared" thingy and
reduce the size of the macro, which is hard to debug.
Since py_shared_state manages the borrowing state of the object owned by
PySharedRefCell, this change makes more sense. If a PyObject has more than
one data to be leaked into Python world, each PySharedState should incref
the parent PyObject, and keep track of the corresponding borrowing state.
Denis Laxalde <denis@laxalde.org> [Thu, 10 Oct 2019 21:37:12 +0200] rev 43172
py3: decode username and password before SMTP login
smtplib.SMTP.login() requires str on Python 3.
For 'password', we only need to decode when value comes from config as
getpass() returns the correct type already.
Denis Laxalde <denis@laxalde.org> [Thu, 10 Oct 2019 21:30:44 +0200] rev 43171
py3: use socket.makefile() instead of dropped smtplib.SSLFakeFile
The latter (undocumented internal) class got removed in Python 3.3. Use
socket.makefile() as suggested:
https://docs.python.org/3/whatsnew/3.3.html#porting-python-code
Denis Laxalde <denis@laxalde.org> [Thu, 10 Oct 2019 21:05:34 +0200] rev 43170
py3: call SMTP.docmd() with an str
Otherwise, this always returns (502, '5.5.2 Error: command not
recognized').
Denis Laxalde <denis@laxalde.org> [Thu, 10 Oct 2019 21:00:13 +0200] rev 43169
py3: call SMTP.has_extn() with an str
Passing a bytes on Python 3 always returns False, thus starttls is not
properly detected.
Denis Laxalde <denis@laxalde.org> [Thu, 10 Oct 2019 20:27:34 +0200] rev 43168
py3: fix sorting of obsolete markers when building bundle
Last item of marker tuple (parents) is either None or tuple. Comparison
thus fails on Python 3 with:
TypeError: '<' not supported between instances of 'tuple' and 'NoneType'
Fixing this by coercing None to the empty tuple when sorting markers in
exchange._getbundleobsmarkerpart().
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 10 Oct 2019 04:34:58 +0200] rev 43167
sidedata: rename the configuration option to `exp-use-side-data`
We don't want setup configured to use the final version that would end using the
experimental one while using and older version.
Differential Revision: https://phab.mercurial-scm.org/D7040
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 16:02:47 +0200] rev 43166
py3: drop ui.flush() during interactive patch filtering
With previous changeset fixing line buffering on stdout, this is no
longer needed.
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 16:00:02 +0200] rev 43165
py3: keep stdout as defined by pycompat in procutil
According to https://docs.python.org/3/library/functions.html#open, it's
not possible to use 1 as buffering argument value in binary mode. This
is probably why line buffering does not work well in python3.
On the other hand, sys.stdout.buffer appears to be line-buffered already
on python3. So by not replacing it, there should be no behavior change.
This fixes buffering issue in "hg email" (confirmation prompt shown
before information to be confirmed).
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 07 Oct 2019 21:21:16 -0400] rev 43164
notify: cast hash to bytes
This is needed to avoid a str/bytes mismatch when interpolating a
line or 2 later.
Differential Revision: https://phab.mercurial-scm.org/D7021
Kyle Lippincott <spectral@google.com> [Sat, 05 Oct 2019 13:39:35 -0700] rev 43163
push: support config option to require revs be specified when running push
Differential Revision: https://phab.mercurial-scm.org/D6989
Georges Racinet <georges.racinet@octobus.net> [Thu, 10 Oct 2019 11:33:33 +0200] rev 43162
py3-discovery: using plain str in stats dict
rust-cpython converts automatically from Rust strings to
the appropriate `str` for the target Python version.
Insisting on discovery stats dict keys to be bytes hence breaks
the process (this is spotted by test-setdiscovery.t).
Now that byteify-strings has been run on the entire
codebase, and the import transformer is not there any more,
the simplest fix is to make the keys plain str again.
Another possible fix would be to forcefully convert to bytes in
rust-cpython code, but that feels less natural, and would probably
have to be reverted down the road.
Differential Revision: https://phab.mercurial-scm.org/D7039
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 10 Oct 2019 04:48:31 +0200] rev 43161
perf: fix `perfhelper-mergecopies` report of #changesets
Same as `perfhelper-pathcopies`. The previous computation `<base>::<target>` was
wrong, what we actually need is `::<target> - ::<base>`.
This is now fixed.
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 02 Oct 2019 18:39:20 -0400] rev 43160
perf: fix `perfhelper-pathcopies` report of #changesets
The previous computation `<base>::<target>` was wrong, what we actually need is
`::<target> - ::<base>`.
This is now fixed
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 12:22:15 +0200] rev 43159
py3: use integer division in curseschunkselector.printstring()
This fixes a crash when scrolling in curses UI when refresh() is called
when a float value (namely 'self.firstlineofpadtoprint', taking its
value indirectly from 'self.linesprintedtopadsofar').
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 12:20:23 +0200] rev 43158
crecord: drop duplicated set of firstlineofpadtoprint attribute
The attribute is already set a couple of lines above, in
curseschunkselector.__init__().
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 10:53:13 +0200] rev 43157
patchbomb: use mail.Generator alias for py2/py3 compat
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 10:48:57 +0200] rev 43156
py3: use email.generator.BytesGenerator in patch.split()
This fixes test-import.t on python3.
We add Generator alias in mail module to handle python2/python3
compatibility.
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 10 Oct 2019 10:03:01 +0200] rev 43155
py3: only flush before prompting during interactive patch filtering
Follows up on
c9093ae8d6c4. It's enough to flush just before each
prompt.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 28 Aug 2019 17:45:18 -0700] rev 43154
py3: add a missing b'' prefix in test extension for chg
Differential Revision: https://phab.mercurial-scm.org/D7038
Augie Fackler <augie@google.com> [Wed, 09 Oct 2019 20:49:58 -0700] rev 43153
fuzz: new target to fuzz jsonescapeu8fast
This code just feels complicated enough we should go ahead and give it
a dedicated fuzzer: we've found bugs in similar things before.
Differential Revision: https://phab.mercurial-scm.org/D7034
Augie Fackler <augie@google.com> [Wed, 09 Oct 2019 20:49:39 -0700] rev 43152
fuzz: new fuzzer for fncache-related functions
Not all of these are strictly fncache-related, but they all have th
same signature and similar-enough behavior that we may as well fuzz
them together. No obvious bugs for once, but these felt like they were
just complicated enough to cover.
Differential Revision: https://phab.mercurial-scm.org/D7033
Augie Fackler <augie@google.com> [Wed, 09 Oct 2019 20:49:23 -0700] rev 43151
fuzz: exercise a little more revlog code
Differential Revision: https://phab.mercurial-scm.org/D7032
Augie Fackler <augie@google.com> [Wed, 09 Oct 2019 20:48:12 -0700] rev 43150
fuzz: new fuzzer for dirs.c
This found a six-year-old bug immediately, and then I put it through a
few CPU-days of time before sending it.
Differential Revision: https://phab.mercurial-scm.org/D7031
Augie Fackler <augie@google.com> [Tue, 08 Oct 2019 16:18:15 -0400] rev 43149
dirs: fix trivial over-read of input data
This code, introduced in
8c0a7eeda06d, was intentionally over-reading
an input string to avoid getting a shared string object for a one-byte
input. Unfortunately with an empty input (like in the case of a fuzzer
getting started) this was a trivial over-read and triggered an
AddressSanitizer failure.
I went out of my way to make sure the code still does the
copy-avoidance tricks. I don't think this change will cost us much
performance since the one-character strings should be cached
aggressively anyway.
Differential Revision: https://phab.mercurial-scm.org/D7030
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:52 -0400] rev 43148
sidedatacopies: deal with upgrading and downgrading to that format
This is quite useful to test this on real life data.
Differential Revision: https://phab.mercurial-scm.org/D6955
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43147
sidedatacopies: move various copies related function to the copies modules
We will need to access these logic form the copies module. So we move them from
their higher level module to the lower level `copies` module. We cannot use them
from their top level module as it would create cycles.
Differential Revision: https://phab.mercurial-scm.org/D6954
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 09 Oct 2019 22:59:38 +0200] rev 43146
sidedatacopies: read rename information from sidedata
Repository using the new format now use changeset centric algorithm and read the
copies information from the changelog sidedata.
Differential Revision: https://phab.mercurial-scm.org/D6953
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 10 Oct 2019 00:06:41 +0200] rev 43145
changelog: make copies related function return None or a valid value
With the previous code, existing but empty value were not "decoded", leading to
the method returning one of `None`, some valid value (`list` or `dict`) or
`b''`.
On a general basis, not explicitly checking for None is a source of bugs.
Having a clean return types will help the side-data copies code in future
changesets.
Differential Revision: https://phab.mercurial-scm.org/D7037
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 10 Oct 2019 00:01:40 +0200] rev 43144
test: fix zstd related output in pure tests
Differential Revision: https://phab.mercurial-scm.org/D7036
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43143
sidedatacopies: get and store sidedata in the changelogrevision object
The object provide a simple way to access changelog entry, we need it to also
bear the sidedata value.
Since the sidedata are retrieved at the same time as the revision, we can do
that without extra cost.
Differential Revision: https://phab.mercurial-scm.org/D6951
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43142
sidedatacopies: write copies information in sidedata when applicable
If the format of the repository indicate it stores copies information into
changeset's sidedata, then we actually write that information into sidedata at
commit time. It will be put to use in later changesets.
Currently, we store all field unconditionally, but that is likely to change in
the future for the sake of efficiency.
Differential Revision: https://phab.mercurial-scm.org/D6950
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43141
sidedatacopies: introduce a sidedata testcase for test-copies-in-changeset.t
For now it is equivalent to the filelog case, but introducing this early helps
make the comings changesets clearer.
Differential Revision: https://phab.mercurial-scm.org/D6949
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43140
sidedatacopies: introduce a sidedata testcase for test-copies-unrelated.t
For now it is equivalent to the filelog case, but introducing this early helps
make the comings changesets clearer.
Differential Revision: https://phab.mercurial-scm.org/D6948
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43139
sidedatacopies: introduce a sidedata testcase for test-copies.t
For now it is equivalent to the filelog case, but introducing this early helps
make the comings changesets clearer.
Differential Revision: https://phab.mercurial-scm.org/D6947
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43138
sidedatacopies: teach upgrade about the new requirement
The `debugformat` and `debugupgraderepo` command now detect the requirement.
(upgrade to and from are not currently possible).
Differential Revision: https://phab.mercurial-scm.org/D6946
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43137
sidedatacopies: add a new requirement for storing copies into sidedata
The end goal is to have changesets centric sidedata information stored into
changelog sidedata. This make it possible to use the changeset based copy
tracing algorithm on any repository without affecting hashes.
The actual implementation is coming. The feature is marked as experimental
(do not use in production) until we stabilise details about the format.
Differential Revision: https://phab.mercurial-scm.org/D6945
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43136
debugsidedata: small doc improvement
The command has a mode to actually show the sidedata, but it wasn't documented.
Differential Revision: https://phab.mercurial-scm.org/D6944
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43135
upgrade: allow for `sidedata` removal
If the side-date feature is removed, we need to drop them.
Differential Revision: https://phab.mercurial-scm.org/D6943
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 06 Oct 2019 23:36:51 -0400] rev 43134
upgrade: allow upgrade to repository using sidedata
Repository can now be migrated to support sidedata. More requirements and
migration will be needed to actual side-data usage. This is a step in that
direction.
To test the feature, we leverage the test extension. It make sure the `update`
part of the side-data migration actually works.
Differential Revision: https://phab.mercurial-scm.org/D6942