Commit Graph

33509 Commits

Author SHA1 Message Date
Boris Feld
c886c86073 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
2017-08-04 18:41:16 +02:00
Boris Feld
7f8b0aa44f 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
2017-08-03 11:38:22 +02:00
Pulkit Goyal
3f92988eda 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
2017-08-03 05:12:35 +05:30
Boris Feld
657776f4e3 bundle2: fix transaction availability detection
Changeset aa97e972460f 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
2017-08-09 17:01:21 +02:00
Jun Wu
c218b8b432 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
2017-08-10 09:37:50 -07:00
Gregory Szorc
b724074785 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 904c418bea16
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
2017-08-10 20:55:28 -07:00
Gregory Szorc
b5802cf167 peer: remove non iterating batcher (API)
The last use of this API was removed in 3bcb9f9a4a63 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
2017-08-09 23:35:20 -07:00
Gregory Szorc
34a7acd6d7 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 3bcb9f9a4a63. 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
2017-08-09 23:29:30 -07:00
Gregory Szorc
014510187c 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
3bcb9f9a4a63 removed the last user of remotebatcher, forcing everyone
to remoteiterbatcher. So anything relying on this in the wild would
have been broken since 3bcb9f9a4a63.

.. api::

   @peer.batchable can no longer emit local values

Differential Revision: https://phab.mercurial-scm.org/D318
2017-08-09 22:52:05 -07:00
Gregory Szorc
c3d3dc57f1 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
2017-08-09 21:51:45 -07:00
Gregory Szorc
ad1ddbea6f largefiles: remove remotestore.batch()
This method was added in 6fb54510b150. 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.

3bcb9f9a4a63 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
2017-08-09 21:04:03 -07:00
André Klitzing
fb861bea86 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.
2017-08-11 15:20:41 +02:00
Yuya Nishihara
854edbfe8b 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.
2017-07-31 23:13:47 +09:00
Yuya Nishihara
742443aa7d 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.
2017-07-31 23:40:36 +09:00
Yuya Nishihara
665cbeddba cext: modernize charencode.c to use Py_ssize_t 2017-07-31 22:58:06 +09:00
Yuya Nishihara
b32d207c09 cext: factor out header for charencode.c
This merges a part of util.h with the header which should exist for
charencode.c.
2017-05-21 14:23:22 +09:00
Yuya Nishihara
20afdd710d cext: split character encoding functions to new compilation unit
This extracts charencode.c from parsers.c, which seems big enough for me
to hesitate to add new JSON functions. Still charencode.o is linked to
parsers.so to avoid duplication of binary codes.
2017-07-31 22:28:27 +09:00
Yuya Nishihara
7f424270a8 cext: move _dict_new_presized() to header
Prepares for splitting encoding functions from parsers.c.
2017-07-31 22:12:24 +09:00
Boris Feld
b1539c55c0 configitems: register the 'notify.test' config 2017-06-30 03:43:31 +02:00
Boris Feld
a40deebbae configitems: register the 'notify.template' config 2017-06-30 03:43:30 +02:00
Boris Feld
540c73467b configitems: register the 'notify.style' config 2017-06-30 03:43:29 +02:00
Boris Feld
a8dced4101 configitems: register the 'notify.strip' config 2017-06-30 03:43:28 +02:00
Boris Feld
f3bd1de48b configitems: register the 'notify.sources' config 2017-06-30 03:43:27 +02:00
Boris Feld
d32ccbab59 configitems: register the 'notify.merge' config 2017-06-30 03:43:26 +02:00
Boris Feld
43c3734660 configitems: register the 'notify.mbox' config 2017-06-30 03:43:25 +02:00
Boris Feld
a8548941d5 configitems: register the 'notify.maxsubject' config 2017-06-30 03:43:24 +02:00
Boris Feld
183f3607c4 configitems: register the 'notify.maxdiff' config 2017-06-30 03:43:23 +02:00
Boris Feld
9400d81aec configitems: register the 'notify.fromauthor' config 2017-06-30 03:43:22 +02:00
Boris Feld
0e80269f91 configitems: register the 'notify.domain' config 2017-06-30 03:43:20 +02:00
Boris Feld
77b5c0d17a configitems: register the 'notify.diffstat' config 2017-06-30 03:43:19 +02:00
Boris Feld
16425ec90a configitems: register the 'notify.config' config 2017-06-30 03:43:18 +02:00
Augie Fackler
ef945af30b merge with stable 2017-08-10 18:55:33 -04:00
Augie Fackler
abe39330a6 Added signature for changeset 229937197835 2017-08-10 18:46:55 -04:00
Augie Fackler
9a0febea27 merge with stable 2017-08-10 14:23:41 -04:00
Augie Fackler
25ec33c0a4 stable: merge heads 2017-08-10 14:23:25 -04:00
Augie Fackler
1003d2c0a9 Added signature for changeset 525f2b18248f 2017-08-10 14:14:49 -04:00
Augie Fackler
fa0eb2f7c3 Added signature for changeset 9ab2705099b9 2017-08-10 13:29:09 -04:00
Yuya Nishihara
509744ddfc ssh: unban the use of pipe character in user@host:port string
This vulnerability was fixed by the previous patch and there were more ways
to exploit than using '|shellcmd'. So it doesn't make sense to reject only
pipe character.

Test cases are updated to actually try to exploit the bug. As the SSH bridge
of git/svn subrepos are not managed by our code, the tests for non-hg subrepos
are just removed.

This may be folded into the original patches.
2017-08-07 22:22:28 +09:00
Yuya Nishihara
62967cdb51 ssh: unban the use of pipe character in user@host:port string
This vulnerability was fixed by the previous patch and there were more ways
to exploit than using '|shellcmd'. So it doesn't make sense to reject only
pipe character.

Test cases are updated to actually try to exploit the bug. As the SSH bridge
of git/svn subrepos are not managed by our code, the tests for non-hg subrepos
are just removed.

This may be folded into the original patches.
2017-08-07 22:22:28 +09:00
Mathias De Maré
cafe7e372c chg: define _GNU_SOURCE to allow CentOS 5 compilation
Without this flag, compilation fails with:
 hgclient.c: In function 'hgc_open':
 hgclient.c:466: error: 'O_DIRECTORY' undeclared (first use in this function)
 hgclient.c:466: error: (Each undeclared identifier is reported only once
 hgclient.c:466: error: for each function it appears in.)

Differential Revision: https://phab.mercurial-scm.org/D260
2017-08-07 13:40:36 +02:00
Mathias De Maré
744ba88ca3 centos5: use vault urls
CentOS 5 has reached end-of-life. A working build for it is still
possible using 'vault.centos.org'.

Differential Revision: https://phab.mercurial-scm.org/D261
2017-08-07 13:38:25 +02:00
Kostia Balytskyi
edfeaa5101 ui: make sure buffer is flushed before waiting for user input (issue5587)
Without this patch on Windows 'hg ci -i' hangs waiting for user input
and "examine changes to 'file'? [Ynesfdaq?]" is never displayed (at least
if the diff is sufficiently small). When Ctrl+C is pressed, this prompt
becomes visible, which suggests that the buffer just wasn't flushed.
I've never seen this happening on Linux, but this looks harmless enough
to not platform-gate it.
2017-08-05 13:19:09 -07:00
Jun Wu
a0e5a4defb ssh: quote parameters using shellquote (SEC)
This patch uses shellquote to quote ssh parameters more strictly to avoid
shell injection.
2017-08-04 23:54:12 -07:00
Jun Wu
6b28fe8df7 ssh: quote parameters using shellquote (SEC)
This patch uses shellquote to quote ssh parameters more strictly to avoid
shell injection.
2017-08-04 23:54:12 -07:00
Boris Feld
d88d8d1c9e obsutil: rename allprecursors into allpredecessors
Use util.nouideprecwarn because obsstore doesn't have easy access to an ui
object.

The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.

Differential Revision: https://phab.mercurial-scm.org/D247
2017-08-02 19:49:57 +02:00
Boris Feld
aecab865d6 obsolete: rename precursor into predecessor in obsolete docstrings
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.

Differential Revision: https://phab.mercurial-scm.org/D246
2017-08-02 19:48:06 +02:00
Boris Feld
edffdda1d5 obsstore: rename precursors into predecessors
Use util.nouideprecwarn because obsstore doesn't have easy access to an ui
object.

The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.

Differential Revision: https://phab.mercurial-scm.org/D245
2017-08-02 19:39:08 +02:00
Boris Feld
284208b1ed obsolete: rename _addprecursors into _addpredecessors
Use util.nouideprecwarn because _addpredecessors doesn't have easy access to
an ui object.

The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.

Differential Revision: https://phab.mercurial-scm.org/D244
2017-08-02 19:34:15 +02:00
Boris Feld
6a8cca1d6e obsmarker: rename precnode into prednode
Rename prednode (predecessors node) into precnode (precursors node) in markers
class. Use util.nouideprecwarn because markers doesn't have easy access to an
ui object.

The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.

Differential Revision: https://phab.mercurial-scm.org/D243
2017-08-02 19:20:59 +02:00
Boris Feld
b4ef988c72 context: rename troubled into isunstable
As we changed the meaning of unstable between the old vocabulary and the new
one, we can't reuse the unstable method name at the risk of breaking
extensions calling unstable and getting a wrong result.

Instead rename troubled into isunstable so extensions will continue to work.

The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.

Differential Revision: https://phab.mercurial-scm.org/D242
2017-08-02 19:13:56 +02:00