FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sun, 13 Aug 2017 15:20:16 +0900] rev 33838
i18n: ignore doctest part to avoid warning at "make update-pot"
hggettext assumes that backslashes in docstring are always doubled in
original source code, in order to find the location of original
docstring out certainly.
This assumption almost always works as expected. But doctest easily
breaks it, because many of backslashes in doctests aren't doubled.
This mismatching causes "unknown offset in ..." warning at "make
update-pot".
To avoid such warning, this patch ignores doctest part of docstring
before finding the location of original docstring out.
BTW, at this patch, only person() in templatefilters.py has doctest
part, which causes "unknown offset ..." warning.
Therefore, just making backslashes in that doctest doubled can avoid
such warning, too. But forcing doctest writers to double backslashes
in doctest isn't reasonable, IMHO.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 02 Aug 2017 01:15:07 +0900] rev 33837
largefiles: fix help text to avoid warning at "make update-pot"
This change helps hggettext to find out help text in original source,
because it assumes that backslash ('\') is doubled in docstring.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 02 Aug 2017 01:03:20 +0900] rev 33836
i18n: make hggettext use original docstring to compute offset
Before this patch, hggettext uses __doc__ of each functions to compute
offset of document text.
But __doc__ of many functions is already modified by decorators in
registrar (e.g. @templatekeyword adds ":NAME: " prefix to it), and
hggettext can not find it out in original source.
This causes many "unknown offset in ..." warning at "make update-pot",
and leaving them might cause overlooking serious problems.
This patch makes hggettext use original docstring, which decorators in
registrar save into _origdoc, to compute offset.
Even after this patch, there are still a few "unknown offset in ..."
warning at "make update-pot" for specific reasons. These will be fixed
later one by one.
Matthieu Laneuville <matthieu.laneuville@octobus.net> [Fri, 11 Aug 2017 14:21:49 +0200] rev 33835
run-tests: also color the summary messages (skipped, failed...)
Filip Filmar <filmil@gmail.com> [Sun, 13 Aug 2017 00:17:13 -0700] rev 33834
crecord: fixes the formatting of the select status in the status line
The status line in the crecord has the "space" status field which has variable
length depending on the length of the status label in the language of choice.
In English, the status labels are "space: deselect" and "space:select". The
"deselect" label is 2 glyphs longer. This makes the terminal output jump
around if the terminal width is just right so that the shorter label makes
the status line 1 line long, and the longer label makes it 2 lines long.
This patch formats the selected status into a fixed-width field. The field
width is the maximum of the lengths of the two possible labels, to account for
differing translations and label lengths. This should make the label behavior
uniform across localizations.
There does not seem to be a test for crecord, so I verified the change manually
with a local build of 'hg'.
Yuya Nishihara <yuya@tcha.org> [Mon, 14 Aug 2017 13:35:26 +0900] rev 33833
cext: move PyInt macros to charencode.c properly
Python3 build was broken at e9996bd7203f.
Yuya Nishihara <yuya@tcha.org> [Mon, 14 Aug 2017 15:50:40 +0900] rev 33832
py3: change encoding.localstr to a subclass of bytes, not str
Yuya Nishihara <yuya@tcha.org> [Sun, 13 Aug 2017 11:10:35 +0900] rev 33831
bundle2: relax the condition to update transaction.hookargs
This is just a micro optimization. If hookargs is empty, nothing should be
necessary.
Yuya Nishihara <yuya@tcha.org> [Sun, 13 Aug 2017 11:05:56 +0900] rev 33830
bundle2: raise ProgrammingError for invalid call of addhookargs()
It should be hard error. Also fixed the error message as s/hooks/hookargs/.
Alex Gaynor <agaynor@mozilla.com> [Fri, 14 Jul 2017 19:27:28 +0000] rev 33829
merge: removed sorting in casefolding detection, for a slight performance win
It was not required for the correctness of the algorithm.
Differential Revision: https://phab.mercurial-scm.org/D30
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 10 Aug 2017 21:00:30 -0700] rev 33828
tests: verify that peer instances only expose interface members
Our abstract interfaces are more useful if we guarantee that
implementations conform to certain rules. Namely, we want to ensure
that objects implementing interfaces don't expose new public
attributes that aren't part of the interface. That way, as long as
consumers don't access "internal" attributes (those beginning with
"_") then (in theory) objects implementing interfaces can be swapped
out and everything will "just work."
We add a test that enforces our "no public attributes not part
of the abstract interface" rule.
We /could/ implement "interface compliance detection" at run-time.
However, that is littered with problems.
The obvious solutions are custom __new__ and __init__ methods.
These rely on derived types actually calling the parent's
implementation, which is no sure bet. Furthermore, __new__ and
__init__ will likely be called before instance-specific attributes
are assigned. In other words, they won't detect public attributes
set on self.__dict__. This means public attribute detection won't
be robust.
We could work around lack of robust self.__dict__ public attribute
detection by having our interfaces implement a custom __getattribute__,
__getattr__, and/or __setattr__. However, this incurs an undesirable
run-time penalty. And, subclasses could override our custom
method, bypassing the check.
The most robust solution is a non-runtime test. So that's what this
commit implements. We have a generic function for validating that an
object only has public attributes defined by abstract classes. Then,
we instantiate some peers and verify a newly constructed object
plays by the rules.
Differential Revision: https://phab.mercurial-scm.org/D339
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 10 Aug 2017 20:58:28 -0700] rev 33827
wireproto: use new peer interface
The wirepeer class provides concrete implementations of peer interface
methods for calling wire protocol commands. It makes sense for this
class to inherit from the peer abstract base class. So we change
that.
Since httppeer and sshpeer have already been converted to the new
interface, peerrepository is no longer adding any value. So it has
been removed. httppeer and sshpeer have been updated to reflect the
loss of peerrepository and the inheritance of the abstract base
class in wirepeer.
The code changes in wirepeer are reordering of methods to group
by interface.
Some Python code in tests was updated to reflect changed APIs.
.. api::
peer.peerrepository has been removed. Use repository.peer abstract
base class to represent a peer repository.
Differential Revision: https://phab.mercurial-scm.org/D338
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Aug 2017 18:00:19 -0700] rev 33826
httppeer: use peer interface
This is similar to what we did to sshpeer. Quirks and all.
Differential Revision: https://phab.mercurial-scm.org/D337
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Aug 2017 17:59:48 -0700] rev 33825
sshpeer: use peer interface
We need the same @property conversion of ui like we did for localpeer.
We renamed _capabilities() to capabilities() to satisfy the new
naming requirement.
However, since we're inheriting from wireproto.wirepeer which inherits
from peer.peerrepository and provides its own code accessing
_capabilities(), we need to keep the old alias around. This wonkiness
will disappear once wirepeer is cleaned up in subsequent commits.
We also implement methods for basepeer that are identical to the
defaults in peer.peerrepository in preparation for the removal of
peerrepository.
Differential Revision: https://phab.mercurial-scm.org/D336
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 09 Aug 2017 23:52:25 -0700] rev 33824
localrepo: use peer interfaces
We now have a formal abstract base class for peers. Let's
transition the peer classes in localrepo to it.
As part of the transition, we reorder methods so they are grouped
by interface and match the order they are defined in the interface.
We also had to change self.ui from an instance attribute to a
property to satisfy the @abstractproperty requirement.
As part of this change, we uncover the first "bug" as part of
enforcing interfaces: stream_out() wasn't implemented on localpeer!
This isn't technically a bug since the repo isn't advertising the
stream capability, so clients shouldn't be attempting to call it.
But I don't think there's a good reason why this is the case.
We implement a dummy method to satisfy the interface requriements.
We can make localpeer instances streamable as a future enhancement.
# no-check-commit
Differential Revision: https://phab.mercurial-scm.org/D335
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Aug 2017 16:47:25 -0700] rev 33823
repository: implement generic capability methods on peer class
These methods are part of the peer interface, are generic, and can
be implemented in terms of other members of the peer interface. So we
implement them on the peer base class as a convenience.
The implementation is essentially copied from peer.py. The code
in peer.py will eventually be deleted.
Differential Revision: https://phab.mercurial-scm.org/D334
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 13 Aug 2017 11:04:42 -0700] rev 33822
repository: formalize wire protocol interface
There are a well-defined set of commands constituting the wire
protocol. Interaction with these and methods for calling them in
batches are exposed via methods on peer instances.
Let's formalize support for these features in abstract classes.
The command parts come from the existing wireproto.wirepeer class.
The batch methods come from peer.peerrepository.
Ample documentation has been added as part of defining the interfaces.
# no-check-commit
Differential Revision: https://phab.mercurial-scm.org/D333
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 13 Aug 2017 10:58:48 -0700] rev 33821
repository: formalize peer interface with abstract base class
There are various interfaces for interacting with repositories
and peers. They form a contract for how one should interact with
a repo or peer object.
The contracts today aren't very well-defined or enforced. There
have been several bugs over the years where peers or repo types
have forgotten to implement certain methods. In addition, the
inheritance of some classes is wonky. For example, localrepository
doesn't inherit from an interface and the god-object nature of
that class means the repository interface isn't well-defined. Other
repository types inherit from localrepository then stub out
methods that don't make sense (e.g. statichttprepository
re-defining locking methods to fail fast).
Not having well-defined interfaces makes implementing alternate
storage backends, wire protocol transports, and repository types
difficult because it isn't clear what exactly needs to be
implemented.
This patch starts the process of attempting to establish more
order to the type system around repositories and peers.
Our first patch starts with a problem space that already has a
partial solution: peers. The peer.peerrepository class already
somewhat defines a peer interface. But it is missing a few things
and the total interface isn't well-defined because it is combined
with wireproto.wirepeer.
Our newly-established basepeer class uses the abc module to
declare an abstract base class with the properties and methods that
a generic peer must implement.
We create a new class that inherits from it. This class will hold
our other future abstract base classes / interfaces so we can expose
a unified base class/interface.
We don't yet use the new interface because subsequent additions
will break existing code without some refactoring first.
A new module (repository.py) was created to hold the interfaces.
I could have put things in peer.py. However, I have plans to
eventually add interfaces to define repository and storage types.
These almost certainly require a new module. And I figured having
all the interfaces live in one module makes sense. So I created
repository.py to be that future home.
Differential Revision: https://phab.mercurial-scm.org/D332
Jun Wu <quark@fb.com> [Mon, 14 Aug 2017 22:28:59 -0700] rev 33820
util: make nogc effective for CPython
279cd80059d4 made `util.nogc` a no-op. It was to optimize PyPy. But it slows
down CPython if many objects (like 300k+) are created.
For example, running `hg log -r .` without extensions in `hg-committed` with
14k+ obsmarkers have the following times:
before | after
hg | chg | hg | chg
-----------------------------
1.262 | 0.860 | 1.077 | 0.619 (seconds, best of 20 runs)
Therefore let's re-enable nogc for CPython.
Differential Revision: https://phab.mercurial-scm.org/D402
Augie Fackler <augie@google.com> [Wed, 26 Jul 2017 23:47:54 -0400] rev 33819
scmutil: use util.shellquote instead of %r
Changes some output, but also resolves differences with Python 3.
Differential Revision: https://phab.mercurial-scm.org/D301
Boris Feld <boris.feld@octobus.net> [Mon, 14 Aug 2017 11:20:06 +0200] rev 33818
context: fix troubled deprecation
troubled has been renamed into isunstable but troubled was calling unstable
instead. Fix the mistake.
Differential Revision: https://phab.mercurial-scm.org/D384
Matt Harbison <matt_harbison@yahoo.com> [Mon, 14 Aug 2017 22:26:48 -0400] rev 33817
test-pushvars: invoke shell script hook via `sh` for Windows
Invoking *.sh on Windows leads to the "what program should open this?" prompt,
which stalls the test and led to the recent series of exceptions on the Windows
test machine as the runner times out.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 14 Aug 2017 22:20:53 -0400] rev 33816
test-sparse: drop unnecessary globs
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Jul 2017 22:04:27 -0700] rev 33815
exchange: simplify unbundle locking using context managers
Differential Revision: https://phab.mercurial-scm.org/D393
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Jul 2017 22:42:10 -0700] rev 33814
util: add base class for transactional context managers
We have at least three types with a close() and a release() method
where the close() method is supposed to be called on success and the
release() method is supposed to be called last, whether successful or
not. Two of them (transaction and dirstateguard) already have
identical implementations of __enter__ and __exit__. Let's extract a
base class for this, so we reuse the code and so the third type
(transactionmanager) can also be used as a context manager.
Differential Revision: https://phab.mercurial-scm.org/D392
Martin von Zweigbergk <martinvonz@google.com> [Mon, 14 Aug 2017 16:26:36 -0700] rev 33813
exchange: remove need for "locked" variable
The transactionmanager() constructor just assigned a few variables and
cannot fail, so it's safe to move it inside the earlier try/except.
Differential Revision: https://phab.mercurial-scm.org/D391
Martin von Zweigbergk <martinvonz@google.com> [Mon, 14 Aug 2017 16:14:14 -0700] rev 33812
exchange: drop now-unnecessary "local" from lock name variables
Since fda0867cfe03 (exchange: drop support for lock-based unbundling
(BC), 2017-08-06), there is no more remote locking.
Differential Revision: https://phab.mercurial-scm.org/D390
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Jul 2017 21:49:44 -0700] rev 33811
exchange: remove 'locallocked' member from pushop object
The variable has been used only within a single function since
94e2862dbcfb (push: elevate phase transaction to cover entire
operation, 2014-11-21), so there's no need to keep it on the pushop
object.
Differential Revision: https://phab.mercurial-scm.org/D389
Jun Wu <quark@fb.com> [Sat, 12 Aug 2017 21:01:06 -0700] rev 33810
rebase: change "result would have 3 parent" error message (BC)
The old error message "cannot use revision REV as base, result would have 3
parents" is confusing - why use REV as base? why add a new parent?.
This patch changes it to "cannot move parent", which seems better.
Differential Revision: https://phab.mercurial-scm.org/D342
Jun Wu <quark@fb.com> [Mon, 14 Aug 2017 07:02:38 -0700] rev 33809
drawdag: allow override file contents via comments
This makes drawdag more flexible, and allow us to create non-clean merges in
test cases.
Differential Revision: https://phab.mercurial-scm.org/D385
Jun Wu <quark@fb.com> [Fri, 04 Aug 2017 12:39:29 -0700] rev 33808
phabricator: add --amend option to phabsend
Previously `hg phabsend` was imitating `hg email` and won't mutate
changesets. That works fine with reviewer-push workflow, reviewers run
`phabread`, `import`.
However, it does not work well with author-push workflow. Namely, the author
needs to run extra commands to get the right commit message, and remove the
local tag after push.
This patch solves those issues by adding the `--amend` option, so local
changesets will have the right commit message, and tags become unnecessary.
Test Plan:
Given the following DAG:
o 17
o 16
| o 15
| @ 14
|/
o 13
o 12
Run `hg phabsend '(13::)-17' --amend`, check the new DAG looks like:
o 21
| o 20
| @ 19
|/
o 18
| o 17
| x 16
| x 13
|/
o 12
And commit messages are updated to contain the `Differential Revision` lines.
Use `phabread` to make sure Phabricator has the amended node recorded.
Also check `phabsend .` followed by a `phabsend . --amend`, the commit
message will be updated and the tag will be removed.
Differential Revision: https://phab.mercurial-scm.org/D122
Jun Wu <quark@fb.com> [Thu, 10 Aug 2017 21:30:31 -0700] rev 33807
rebase: rewrite core algorithm (issue5578) (issue5630)
"defineparents" is the core algorithm of rebase. The old code has too many
tech debts (like outdated comments, confusing assertions, etc) and is very
error-prone to be improved. This patch rewrites "defineparents" to make the
code easier to reason about, and solve a bunch of issues, including:
- Assertion error: no base found (demonstrated by D212, issue5578)
- Asymmetric result (demonstrated by D211, "F with one parent")
- Wrong new parent (demonstrated by D262, "C':A'A'")
- "revlog index out of range" (demonstrated by D262, issue5630)
- "nothing to merge" (demonstrated by D262)
As a side effect, merge base decision has been made more solid - rebase now
prints out explicitly what could go wrong when it cannot find a unique
suitable merge base.
.. fix:: Issue 5578, Issue 5630
Core rebase algorithm has been rewritten to be more robust.
Differential Revision: https://phab.mercurial-scm.org/D21
Jun Wu <quark@fb.com> [Sat, 12 Aug 2017 21:40:48 -0700] rev 33806
phabricator: remove an unnecessary writediffproperties call
This was introduced by D229. Thanks Yuya for finding it!
Differential Revision: https://phab.mercurial-scm.org/D366
Rishabh Madan <rishabhmadan96@gmail.com> [Sat, 12 Aug 2017 09:21:42 +0530] rev 33805
releasenotes: minor bug fix for index error while serializing
Differential Revision: https://phab.mercurial-scm.org/D356
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 15:31:54 +0200] rev 33804
label: rename log.trouble into log.instability
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D259
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 15:30:41 +0200] rev 33803
label: rename trouble.X into instability.X
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D258
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 14:32:50 +0200] rev 33802
label: rename changeset.troubled into changeset.unstable
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D257
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 14:16:54 +0200] rev 33801
test: add a test for stabilization related labels
Differential Revision: https://phab.mercurial-scm.org/D256
Boris Feld <boris.feld@octobus.net> [Fri, 04 Aug 2017 19:39:34 +0200] rev 33800
obsolete: rename bumped volatile set into phasedivergent volatile set
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D255
Boris Feld <boris.feld@octobus.net> [Fri, 04 Aug 2017 19:36:27 +0200] rev 33799
obsolete: rename divergent volatile set into contentdivergent volatile set
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D254
Boris Feld <boris.feld@octobus.net> [Fri, 04 Aug 2017 19:27:39 +0200] rev 33798
obsolete: rename unstable volatile set into orphan volatile set
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D253
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 14:08:39 +0200] rev 33797
revset: rename bumped into phasedivergent
Don't touch bumped volatile set name, only the revset name. The volatile set
name will be updated in a later patch.
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D252
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 14:01:51 +0200] rev 33796
revset: remane divergent into contentdivergent
Don't touch divergent volatile set name, only the revset name. The volatile
set name will be updated in a later patch.
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D251
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 13:48:39 +0200] rev 33795
revset: rename unstable into orphan
Don't touch unstable volatile set name, only the revset name. The volatile set
name will be updated in a later patch.
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D250
Boris Feld <boris.feld@octobus.net> [Fri, 04 Aug 2017 18:41:16 +0200] rev 33794
test: update evolution config
evolution* config has been rewritten in stabilization* in the previous patch,
update tests file to use the new names.
Differential Revision: https://phab.mercurial-scm.org/D249
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 11:38:22 +0200] rev 33793
config: rename evolution config into stabilization
Use aliases for backward-compatibility. Though I'm not sure how to emit
compatibility warnings with aliases.
Test configuration are updated in the next patch.
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D248
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 03 Aug 2017 05:12:35 +0530] rev 33792
morestatus: move fb extension to core by plugging to `hg status --verbose`
morestatus extension in fbext use to show more context about the state of the
repo like the repository is in a unfinished merge state, or a rebase is going
on, or histedit is going on, listing the files which need to be resolved and
also suggesting ways to handle the situation.
This patch moves the extension directly to core by plugging it into the
--verbose flag of the status command. So now if you are in any unfinished state
and you do hg status -v, it will show you details and help related to the state.
The extension in fbext also shows context about unfinished update state
which is not ported to core as that plug in hooks to update command which need
to be tackled somewhat differently.
The following configuration will turn the behaviour on by default
[commands]
status.verbose = 1
You can also skip considering some states like bisect as follows:
[commands]
status.skipstates=bisect
This patch also adds test for the feature.
.. feature::
``hg status -v`` can now show unfinished state. For example, when in
an unfinished rebase state, ``hg status -v`` might show::
# The repository is in an unfinished *rebase* state.
# No unresolved merge conflicts.
# To continue: hg rebase --continue
# To abort: hg rebase --abort
Differential Revision: https://phab.mercurial-scm.org/D219
Boris Feld <boris.feld@octobus.net> [Wed, 09 Aug 2017 17:01:21 +0200] rev 33791
bundle2: fix transaction availability detection
Changeset 5fc4ddfbe626 introduce more complex logic around
'bundleoperation.gettransaction'. In that process it turns the old "attribute"
into a proper method which breaks the code that detects the "transaction
availability".
The change was visible in 'test-acl.t', fixing this reverts the test changes.
Differential Revision: https://phab.mercurial-scm.org/D303
Jun Wu <quark@fb.com> [Thu, 10 Aug 2017 09:37:50 -0700] rev 33790
fsmonitor: correct an error message
Without the change, the error looks like:
warning: Watchman unavailable: "watchman" executable not in PATH (%s),
while executing [Errno 2] No such file or directory
With the change, it now looks like:
warning: Watchman unavailable: "watchman" executable not in PATH
([Errno 2] No such file or directory)
Differential Revision: https://phab.mercurial-scm.org/D322
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 10 Aug 2017 20:55:28 -0700] rev 33789
sshpeer: make instance attributes and methods internal
Peer types are supposed to conform to a formal interface defined by
peer.peerrepository and wireproto.wirepeer. Every "public" attribute on
*peer types makes it harder to understand what attributes are part
of the interface and what are instance specific.
This commit converts a number of "public" instance attributes and
methods on sshpeer to internal so they can't be confused to be part of
the peer API.
The URL-related instance attributes were introduced in 876333a295ff
in 2005. AFAICT most of them aren't used and could potentially be
removed. But I kept them around anyway.
I also reorded some code to make things slightly easier to read.
.. api::
Rename attributes on sshpeer to reflect peer API
Differential Revision: https://phab.mercurial-scm.org/D331
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 09 Aug 2017 23:35:20 -0700] rev 33788
peer: remove non iterating batcher (API)
The last use of this API was removed in b6e71f8af5b8 in 2016. While
not formally deprecated, as of the last commit the code is no longer
explicitly tested. I think the new API has existed long enough for
people to transition to it.
I also have plans to more formalize the peer API and removing batch()
makes that work easier.
I'm not convinced the current client-side API around batching is
great. But it's the best we have at the moment.
.. api:: remove peer.batch()
Replace with peer.iterbatch().
Differential Revision: https://phab.mercurial-scm.org/D320
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 09 Aug 2017 23:29:30 -0700] rev 33787
wireproto: overhaul iterating batcher code (API)
The remote batching code is difficult to read. Let's improve it.
As part of the refactor, the future returned by method calls on
batchiter() instances is now populated. However, you still need to
consume the results() generator for the future to be set. But at
least now we can stuff the future somewhere and not have to worry
about aligning method call order with result order since you can
use a future to hold the result.
Also as part of the change, we now verify that @batchable generators
yield exactly 2 values. In other words, we enforce their API.
The non-iter batcher has been unused since b6e71f8af5b8. And to my
surprise we had no explicit unit test coverage of it! test-batching.py
has been overhauled to use the iterating batcher.
Since the iterating batcher doesn't allow non-batchable method
calls nor local calls, tests have been updated to reflect reality.
The iterating batcher has been used for multiple releases apparently
without major issue. So this shouldn't cause alarm.
.. api::
@peer.batchable functions must now yield exactly 2 values
Differential Revision: https://phab.mercurial-scm.org/D319
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 09 Aug 2017 22:52:05 -0700] rev 33786
wireproto: remove support for local results in @batchable (API)
@peer.batchable decorated generator functions have two forms:
yield value, None
and
yield args, future
yield value
These forms have been present since the decorator was introduced.
There are currently no in-repo consumers of the first form. So this
commit removes support for it.
Note that remoteiterbatcher.submit() asserts the 2nd form. And
b6e71f8af5b8 removed the last user of remotebatcher, forcing everyone
to remoteiterbatcher. So anything relying on this in the wild would
have been broken since b6e71f8af5b8.
.. api::
@peer.batchable can no longer emit local values
Differential Revision: https://phab.mercurial-scm.org/D318
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 09 Aug 2017 21:51:45 -0700] rev 33785
wireproto: properly implement batchable checking
remoteiterbatcher (unlike remotebatcher) only supports batchable
commands. This claim can be validated by comparing their
implementations of submit() and noting how remoteiterbatcher assumes
the invoked method has a "batchable" attribute, which is set by
@peer.batchable.
remoteiterbatcher has a custom __getitem__ that was trying to
validate that only batchable methods are called. However, it was only
validating that the called method exists, not that it is batchable.
This wasn't a big deal since remoteiterbatcher.submit() would raise
an AttributeError attempting to `mtd.batchable(...)`.
Let's fix the check and convert it to ProgrammingError, which may
not have been around when this was originally implemented.
Differential Revision: https://phab.mercurial-scm.org/D317
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 09 Aug 2017 21:04:03 -0700] rev 33784
largefiles: remove remotestore.batch()
This method was added in 9e1616307c4c. AFAICT it didn't do anything at
inception. If it did, there was no test coverage for it because
changing it to raise doesn't fail any tests at that revision.
b6e71f8af5b8 later refactored all remote.batch() calls to
remote.iterbatch(). So if this was somehow used, it isn't called
any more because there are no calls to .batch() remaining in the
repo.
I suspect the original patch author got confused by the distinction
between the peer/remote interface and the largefiles store. The lf
store is a gateway to a peer instance. It exposes additional
lf-specific methods to execute against a peer. However, it is not
a peer and doesn't need to implement batch() because peer itself
does that.
Differential Revision: https://phab.mercurial-scm.org/D316
André Klitzing <aklitzing@gmail.com> [Fri, 11 Aug 2017 15:20:41 +0200] rev 33783
histedit: check first changeset for verb "roll" or "fold" (issue5498)
If someone changes "pick" to "roll" or "fold" for the first
changeset in a histedit rule Mercurial could remove a wrong
changeset if the phase is non-public.
roll or fold for the first changeset should be invalid.
Yuya Nishihara <yuya@tcha.org> [Mon, 31 Jul 2017 23:13:47 +0900] rev 33782
encoding: drop circular import by proxying through '<policy>.charencode'
I decided not to split charencode.c to new C extension module because it
would duplicate binary codes unnecessarily.
Yuya Nishihara <yuya@tcha.org> [Mon, 31 Jul 2017 23:40:36 +0900] rev 33781
policy: reroute proxy modules internally
This allows us to split encoding functions from pure.parsers without doing
that for cext.parsers. See the next patch for why.
Yuya Nishihara <yuya@tcha.org> [Mon, 31 Jul 2017 22:58:06 +0900] rev 33780
cext: modernize charencode.c to use Py_ssize_t
Yuya Nishihara <yuya@tcha.org> [Sun, 21 May 2017 14:23:22 +0900] rev 33779
cext: factor out header for charencode.c
This merges a part of util.h with the header which should exist for
charencode.c.