Commit Graph

19709 Commits

Author SHA1 Message Date
Pierre-Yves David
63702d52a8 mq: use the new checklocalchange in the strip command
The strip command never use the `refresh` argument. So we can use the function
we just extracted.
2013-09-25 19:32:53 +02:00
Pierre-Yves David
c66ccb3bbf mq: extract checklocalchanges from mq.queue
The core part of `checklocalchanges` is now mq independent. We can extract it in
a standalone function to help the extraction of `strip` as discussed in issue3824.

A `checklocalchanges` function stay in `mq.queue` with the part related to
"refresh first" messages.
2013-09-25 12:43:14 +02:00
Pierre-Yves David
b30305598b mq: extract checksubstate from the queue class
This function does not need any of the the `mq.queue` method or attributes. It
is indirectly used by the `strip` command. We are trying to extract this command
in a standalone extension as discussed in issue issue3824.
2013-09-25 11:24:43 +02:00
Pierre-Yves David
0f912df18c mq: simplifies the refresh hint in checklocalchanges
The `checklocalchanges` function in the `mq.queue` class takes a `refresh` argument that
changes the error message of raised exception. When refresh is
`True` the exception message is "local changes found, refresh first" otherwise,
the message is just "local changes found".

This changeset is the first of a series that extract `strip` into a standalone
extension (as discussed in issue3824). This `checklocalchanges` function is
indirectly used by the strip command. But in a standalone strip extension the
concept of "refresh first" has no sense. In practice, When used in the context
of the strip commands `refresh`'s value is always `False`.

So my final goal is a be able to extract the `checklocalchanges` logic in a
standalone extension but to keep the part related to "refresh first" in the mq
extension. However the refresh handling is deeply entangled into the
`checklocalchanges` code. It is handled as low a possible at the point we raise
the exception.

So we moves handling of refresh upper in the `checklocalchanges` code. This will
allow the extraction of a simple version in the strip extension while mq can
still inject its logic when needed.

Two helper functions `localchangesfound` and `localchangedsubreposfound` died in
the process they are replaced by simple raise lines.
2013-09-25 12:28:40 +02:00
Angel Ezquerra
65d42d2870 merge: let the user choose to merge, keep local or keep remote subrepo revisions
When a subrepo has changed on the local and remote revisions, prompt the user
whether it wants to merge those subrepo revisions, keep the local revision or
keep the remote revision.

Up until now mercurial would always perform a merge on a subrepo that had
changed on the local and the remote revisions. This is often inconvenient. For
example:

- You may want to perform the actual subrepo merge after you have merged the
parent subrepo files.
- Some subrepos may be considered "read only", in the sense that you are not
supposed to add new revisions to them. In those cases "merging a subrepo" means
choosing which _existing_ revision you want to use on the merged revision. This
is often the case for subrepos that contain binary dependencies (such as DLLs,
etc).

This new prompt makes mercurial better cope with those common scenarios.

Notes:

- The default behavior (which is the one that is used when ui is not
interactive) remains unchanged (i.e. merge is the default action).
- This prompt will be shown even if the ui --tool flag is set.
- I don't know of a way to test the "keep local" and "keep remote" options (i.e.
to force the test to choose those options).


# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1378420708 -7200
#      Fri Sep 06 00:38:28 2013 +0200
# Node ID 2fb9cb0c7b26303ac3178b7739975e663075857d
# Parent  796d34e1b749b79834321ef1181ed8433a5515d9
merge: let the user choose to merge, keep local or keep remote subrepo revisions

When a subrepo has changed on the local and remote revisions, prompt the user
whether it wants to merge those subrepo revisions, keep the local revision or
keep the remote revision.

Up until now mercurial would always perform a merge on a subrepo that had
changed on the local and the remote revisions. This is often inconvenient. For
example:

- You may want to perform the actual subrepo merge after you have merged the
parent subrepo files.
- Some subrepos may be considered "read only", in the sense that you are not
supposed to add new revisions to them. In those cases "merging a subrepo" means
choosing which _existing_ revision you want to use on the merged revision. This
is often the case for subrepos that contain binary dependencies (such as DLLs,
etc).

This new prompt makes mercurial better cope with those common scenarios.

Notes:

- The default behavior (which is the one that is used when ui is not
interactive) remains unchanged (i.e. merge is the default action).
- This prompt will be shown even if the ui --tool flag is set.
- I don't know of a way to test the "keep local" and "keep remote" options (i.e.
to force the test to choose those options).
2013-09-06 00:38:28 +02:00
Augie Fackler
67877b90cc python2.4: fix imports of sub-packages of the email package
These all have an obvious comment so if/when we finally ditch Python
2.4 we can eradicate them easily.
2013-09-24 15:10:32 -04:00
Augie Fackler
3c989f7606 httpconnection: properly inject ssl_wrap_socket into httpclient (issue4038)
This causes httpclient to use the same SSL settings as the rest of
Mercurial, and adds an easy extension point for later modifications to
our ssl handling.
2013-09-20 09:16:07 -04:00
Augie Fackler
006064bcd2 sslutil: make keyfile and certfile arguments consistent between 2.6+ and 2.5- 2013-09-20 09:15:43 -04:00
Augie Fackler
ea14145f1e httpclient: import 4bb625347d4a to provide SSL wrapper injection
This lets us inject our own ssl.wrap_socket equivalent into
httpclient, which means that any changes we make to our ssl handling
can be *entirely* on our side without having to muck with httpclient,
which sounds appealing. For example, an extension could wrap
sslutil.ssl_wrap_socket with an api-compatible wrapper and then tweak
SSL settings more precisely or use GnuTLS instead of OpenSSL.
2013-09-20 09:15:09 -04:00
Augie Fackler
cb1c036518 sslutil: add a config knob to support TLS (default) or SSLv23 (bc) (issue4038)
Prior to this change, we default to SSLv23, which is insecure because
it allows use of SSLv2. Unfortunately, there's no constant for OpenSSL
to let us use SSLv3 or TLS - we have to pick one or the other. We
expose a knob to revert to pre-TLS SSL for the user that has an
ancient server that lacks proper TLS support.
2013-09-19 16:29:00 -04:00
Siddharth Agarwal
99a29f5838 largefiles: standardize error message for dirty working dir 2013-09-23 21:41:01 -07:00
Siddharth Agarwal
1addd98f97 cmdutil.bailifchanged: standardize error message for dirty working dir
This affects rebase, graft, histedit, and other similar commands.
2013-09-23 21:31:37 -07:00
Siddharth Agarwal
c84868311c merge: standardize error message for dirty subrepo 2013-09-23 20:53:14 -07:00
Siddharth Agarwal
88c86521eb merge: standardize error message for dirty working dir 2013-09-23 20:50:51 -07:00
Siddharth Agarwal
663145e3f0 update: standardize error message for dirty update --check
This and following patches will standardize the error message for dirty working
directories to "uncommitted changes".
2013-09-23 20:33:02 -07:00
Siddharth Agarwal
7213ad0e07 update: improve error message for dirty non-linear update with rev 2013-09-23 20:08:52 -07:00
Siddharth Agarwal
ecd3be8cef update: add error message for dirty non-linear update with no rev
Previously, the error message for a dirty non-linear update was the same (and
relatively unhelpful) whether or not a rev was specified. This patch and an
upcoming one will introduce separate, more helpful hints.
2013-09-23 20:07:30 -07:00
Siddharth Agarwal
55e7463f51 update: improve error message for clean non-linear update 2013-09-23 17:43:33 -07:00
Siddharth Agarwal
3bfd19f5c2 pull: for pull --update with failed update, print hint if any
An upcoming patch will add a hint to the abort message, and we don't want to
lose that here.
2013-09-23 19:02:32 -07:00
Alexander Plavin
8495f525a8 paper: edit search hint to include new feature description 2013-09-06 13:30:57 +04:00
Alexander Plavin
fd04e86dd0 revset: fix wrong keyword() behaviour for strings with spaces
Some changesets can be wrongly reported as matched by this predicate
due to searching in a string joined with spaces and not individually.
A test case added, which fails without this fix.
2013-08-06 00:52:06 +04:00
Matt Mackall
945b0b2cfa Added signature for changeset 52a9b67dec5f 2013-09-03 18:05:11 -05:00
FUJIWARA Katsunori
08b1b07292 tags: write tag overwriting history also into tag cache file (issue3911)
Before this patch, tag overwriting history is not written into tag
cache file ".hg/cache/tags".

This may give higher priority to local tag than global one, even if
the former is overwritten by the latter, because tag overwriting
history is used to compare priorities of them (as "rank").

In such cases, "hg tags" invocations using tag cache file shows
incorrect tag information.

This patch writes tag overwriting history also into tag cache file.
2013-08-28 22:09:53 +09:00
FUJIWARA Katsunori
ca113e2a18 histedit: add description about "histedit --outgoing" to command help
Before this patch, there is no explicit description that argument is
treated as the URL of the destination repository when "--outgoing" is
specified.

This patch adds description about "histedit --outgoing" to command
help of it.
2013-08-26 16:11:21 +09:00
FUJIWARA Katsunori
bc5efe5be4 histedit: add description about basic histedit function to command help
Before this patch, there is no explicit description that histedit
edits changesets between specified ancestor and the parent of the
working directory: users may notice it by error message "REV is not an
ancestor of working directory".

This patch adds description about basic histedit function to command
help of it.

This patch uses term "ancestor" instead of "parent", because it seems
to be more suitable, and almost all (error) messages already use it.
2013-08-26 16:11:21 +09:00
Bryan O'Sullivan
c32bb7d1f6 rebase: handle bookmarks matching revset function names (issue3950)
We handled these correctly with all rev-specifying options except,
somehow, -r/--rev.
2013-09-03 15:12:35 -04:00
Matt Mackall
59df62f815 Added signature for changeset da90524fb77e 2013-08-01 22:37:44 -05:00
Kevin Bullock
7e226a7735 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
This makes `hg pull --update` behave the same wrt the active bookmark as
`hg pull && hg update` does as of 13ea5e437ff8. A helper function,
bookmarks.calculateupdate, is added to prevent code duplication between
postincoming and update.
2013-08-01 21:43:14 -05:00
Matt Mackall
0ac4365bef merge with i18n 2013-08-01 20:06:00 -05:00
Matt Mackall
d52228b61b histedit: don't clobber working copy on --abort if not on histedit cset
Similar to issue4009, 2.7 will force people to abort histedits before
doing interesting things. Without this fix, people with histedit
sessions they wandered away from before upgrading to 2.7 could clobber
their working copy for no reason.
2013-08-01 19:55:02 -05:00
Matt Mackall
758ebca217 rebase: allow aborting when descendants detected
With this, all aborts will succeed in removing the state, rather than
leaving the user in 'what do I do now?' limbo.
2013-08-01 17:54:12 -05:00
Matt Mackall
c63eb47329 rebase: continue abort without strip for immutable csets (issue3997)
This causes us to simply discard the rebase state.
2013-08-01 17:45:13 -05:00
Matt Mackall
0cf44a4d14 rebase: don't clobber wd on --abort when we've updated away (issue4009) 2013-08-01 17:33:09 -05:00
Wagner Bruna
04fb6bb30f i18n-pt_BR: synchronized with 1d921a7399ad 2013-08-01 02:36:59 -03:00
FUJIWARA Katsunori
13b4a0deaa i18n-ja: synchronized with d64dab8bf4c4 2013-08-01 04:32:29 +09:00
Matt Mackall
9b3084fb50 checklink: work around sshfs brain-damage (issue3636)
With the follow_symlinks option, sshfs will successfully create links
while claiming it encountered an I/O error. In addition, depending on
the type of link, it may subsequently be impossible to delete the link
via sshfs. Our existing link to '.' will cause sshfs to think the link
is a directory, and thus cause unlink to give EISDIR. Links to
non-existent names or circular links will cause the created link to not even
be visible.

Thus, we need to create a new temporary file and link to that. We'll
still get a failure, but we'll be able to remove the link.
2013-07-28 15:02:32 -05:00
Matt Mackall
aa456e3925 import: cut commit messages at --- unconditionally (issue2148)
We used to do this based on X-mailer: mentioning git, but git doesn't
put X-mailer in its git-format-patch output.
2013-07-27 19:31:14 -05:00
Pascal Quantin
b52e26e4ec win32: update Inno Setup installer script and extensions list 2013-07-27 21:16:12 +02:00
Matt Mackall
b2c60c13a2 revert: fix largefiles breakage 2013-07-26 21:03:25 -05:00
Matt Mackall
0bc2bdce17 revert: make backup when unforgetting a file (issue3423)
This skips the backup if it would be a duplicate.
2013-07-26 17:08:05 -05:00
Matt Mackall
fac649fcb2 revsingle: fix silly API issue (issue2992) 2013-07-26 15:42:10 -05:00
Wojciech Lopata
af27e2b918 bookmarks: update only proper bookmarks on push -r/-B (issue 3973)
Make push -r/-B update only these bookmarks that point to pushed revisions
or their ancestors, so we can be sure that commit pointed by bookmark is
present in the remote reposiory. Previously push tried to update all shared
bookmarks.
2013-07-26 13:34:51 -07:00
Matt Mackall
a4d6cc16ae Added signature for changeset a4865ca9f2f3 2013-07-26 15:05:48 -05:00
Simon Heimberg
fb20210081 i18n-it: do not translate rst syntax
".. container::" and ".. note::" are rst syntax and therefore must not be
translated.
2013-07-25 21:00:03 +02:00
Frank Kingswood
cded2790ad convert: handle changeset sorting errors without traceback (issue3961) 2013-07-26 14:44:13 +01:00
Siddharth Agarwal
52db69329a ancestor.deepest: ignore ninteresting while building result (issue3984)
ninteresting indicates the number of non-zero elements in the interesting
array, not the number of elements in the final list. Since elements in
interesting can stand for more than one gca, limiting the number of results to
ninteresting is an error.

Tests for issue3984 are included.
2013-07-25 14:43:15 -07:00
Wei, Elson
ec2b8c873f ancestor.deepest: decrement ninteresting correctly (issue3984)
The invariant this code tries to hold is that ninteresting is the number of
non-zero elements in the interesting array. interesting[nsp] is incremented at
the same time as interesting[sp] is decremented. So if interesting[nsp] was
previously 0, ninteresting shouldn't be decremented.
2013-07-25 17:35:53 +08:00
Siddharth Agarwal
2267993ebc ancestor.deepest: sort revs in C version
This isn't strictly necessary, but it makes the code more consistent with the
Python version.
2013-07-25 14:20:37 -07:00
Augie Fackler
ac76c4f1a9 check-code: add a check for the next() builtin, which was new in 2.6 2013-07-25 10:44:51 -04:00
Augie Fackler
a3022f6834 mq: rename next() to nextpatch() to avoid confusing a future check-code patch
next() is a builtin starting in 2.6, so it's also nice to avoid
shadowing the builtin.
2013-07-25 10:42:36 -04:00