Commit Graph

27817 Commits

Author SHA1 Message Date
FUJIWARA Katsunori
4d0ebd5133 tests: make timezone in diff output glob-ed for portability
Before this patch, some tests using external "diff" command via
extdiff extension fail on Solaris, because system standard "diff" (=
/usr/bin/diff) on Solaris doesn't display timezone for timestamp of
each files in diff output.

This patch makes timezone in external diff output glob-ed for
portability of tests, and adds check-code.py a rule to detect such
2016-02-08 18:29:17 +09:00
FUJIWARA Katsunori
91b31cc00a tests: omit -p for external diff via extdiff extension for portability
Before this patch, some tests using external "diff" command via
extdiff extension fail on Solaris, because "-p" (show which C function
each change is in) option isn't supported by system standard "diff" on
Solaris, even though extdiff passes it to external "diff" by default.

Fortunately, this non-portable option isn't important for (current, at
least) tests using external "diff" command via extdiff extension.

This patch omits "-p" for external "diff" command via extdiff
extension for portability of tests, and adds check-code.py a rule to
detect invocation of "diff" with "-p".

Newly added check-code.py rule examines only lines generated by
external "diff" with "-r", because strict examination might
misidentify "hg diff -p" or other complicated lines consisting of
"diff" string as wrong one.

This patch is a part of making tests using external "diff" portable,
and tests below aren't yet portable even after this patch.

  test-graft.t
  test-largefiles-update.t
  test-subrepo-deep-nested-change.t
2016-02-08 18:29:17 +09:00
Martin von Zweigbergk
e106ceb930 update: check command line before modifying repo
A failed command should not have any effect on the repo.
2016-02-07 22:18:24 -08:00
Martin von Zweigbergk
d7ef7dd40a treemanifest: fix debugrebuildfncache
When I taught debugrebuildfncache about dirlogs in ebe9dacc63ba
(treemanifests: fix streaming clone, 2016-02-04), I added a
last-minute "if 'treemanifest' in repo" guard. That should have been
checking for "... in repo.requirements". Fix that and add tests for
it.
2016-02-07 21:44:38 -08:00
Pierre-Yves David
3998c3b144 update: warn about other topological head in pull and unbundle
Other commands have a '--update' triggering a bare update. We now issue the
message introduced into the previous changeset for these too.
2016-02-03 15:12:01 +00:00
Pierre-Yves David
2e0675043e update: warn about other topological heads on bare update
A concern around the user experience of Mercurial is user getting stuck on there
own topological branch forever. For example, someone pulling another topological
branch, missing that message in pull asking them to merge and getting stuck on
there own local branch.

The current way to "address" this concern was for bare 'hg update' to target the
tipmost (also latest pulled) changesets and complain when the update was not
linear. That way, failure to merge newly pulled changesets would result in some
kind of failure.

Yet the failure was quite obscure, not working in all cases (eg: commit right
after pull) and the behavior was very impractical in the common case
(eg: issue4673).

To be able to change that behavior, we need to provide other ways to alert a
user stucks on one of many topological head. We do so with an extra message after
bare update:

  1 other heads for branch "default"

Bookmark get its own special version:

  1 other divergent bookmarks for "foobar"

There is significant room to improve the message itself, and we should augment
it with hint about how to see theses other heads or handle the situation (see
in-line comment). But having "a" message is already a significant improvement
compared to the existing situation. Once we have it we can iterate on a better
version of it. As having such message is an important step toward changing the
default destination for update and other nicety, I would like to move forward
quickly on getting such message.

This was discussed during London - October 2015 Sprint.
2016-02-02 14:49:02 +00:00
timeless
1ee6f788c8 tests: mock getpid to reduce glob usage
With util.getpid, it is now possible to define fixed pids.

Future iterations can define a map of pids on a locked
first come first serve basis to create a more realistic
harness, but for now this is good enough.

This applies to blackbox, but could apply to other
tests as well.
2016-02-03 04:37:04 +00:00
timeless
3502e556ef util: enable getpid to be replaced
This will enable tests to write stable process ids.
2016-02-03 09:11:22 +00:00
timeless
0541bdf700 blackbox: refactor use of vfs as _bbvfs 2016-02-08 00:47:36 +00:00
timeless
6eaedecd28 blackbox: flush output file descriptor
Without this, when there are multiple ui views, each blackbox
will have its own file handle, and the logging will be in
a really bad order.

Also, because of the way blackbox works, it never closes its
file handles, which means the last output before exit is
often lost.
2016-02-03 15:18:29 +00:00
timeless
178005e982 tests: change blackbox test to work cross platform
While it is not easy to make a file 000 on Windows, you can
emulate most of the behaviors by replacing the file with a directory.

Also corrects test description to properly indicate that failing to
read from the log is fatal.
2016-02-03 18:15:18 +00:00
Siddharth Agarwal
33c18c0f15 merge: document checkignored and checkunknown configs again
These options were undocumented for 3.7 because of an issue found during the
freeze (see rev e5c26e4e6ec7). This issue has now been fixed, so we can
document these options again.
2016-02-01 20:28:32 -08:00
Siddharth Agarwal
66f60475b8 rebase: respect checkunknown and checkignored in more cases
checkunknown and checkignored are currently respected for updates and regular
merges, but not for certain kinds of rebases. To be precise, they aren't
respected for rebases when:

(1) we're rebasing while currently on the destination commit, and
(2) an untracked or ignored file F is currently in the working copy, and
(3) the same file F is in a source commit, and
(4) F has different contents in the source commit.

This happens because rebases set force to True when calling merge.update.
Setting force to True makes a lot of sense in general, but it turns out the
force option is overloaded: there's a deprecated '--force' option in merge that
allows you to merge in outstanding changes, including changes in untracked
files. We use the 'mergeforce' parameter to tell those two cases apart.

I think the behavior during rebases when checkunknown is 'abort' (the default)
is wrong -- we should abort on or overwrite differing untracked files, not try
to merge them in. However that currently breaks rebases by aborting in the
middle -- we need better handling for that case before we can change the
default.
2016-02-03 13:12:06 -08:00
Siddharth Agarwal
afdc50e948 test-merge-force: add tests for merge.checkunknown=warn
In an upcoming patch we're going to change the behavior of some merges with
merge.checkunknown=warn or ignore -- ensure that the behavior of the deprecated
'merge --force' remains the same.
2016-02-03 13:11:34 -08:00
Siddharth Agarwal
803f564a2a merge: tell _checkunknownfiles about whether this was merge --force
In an upcoming patch we'll have different behavior here for when 'merge
--force' is used as opposed to when other kinds of force operations are
performed, like rebases.
2016-02-01 20:28:32 -08:00
Siddharth Agarwal
fceebb99a4 merge: add missing doc for 'labels' parameter 2016-02-01 20:28:32 -08:00
Siddharth Agarwal
3386176013 merge: move abort/warn checks up to the top level of _checkunknownfiles
In upcoming patches, we're also going to do these checks when force is True.
2016-02-01 20:28:32 -08:00
Martin von Zweigbergk
c84bb33a89 match: rename "narrowmatcher" to "subdirmatcher" (API)
I keep mistaking "narrowmatcher" for narrowhg's
narrowmatcher. "subdirmatcher" seems more to the point anyway.
2016-02-05 21:09:32 -08:00
timeless
8e3dbae060 tests: relax test-devel-warnings to reduce false positives
This test is interested in warning output, so
glob away line numbers and hashes as they aren't relevant
to its core.
2016-02-03 18:59:35 +00:00
Matt Mackall
fd4d3ffdae merge with stable 2016-02-07 00:49:31 -06:00
timeless
2c0eb26137 rebase: update working directory when aborting (issue5084) 2016-02-05 01:56:46 +00:00
Yuya Nishihara
6b8c99a6d3 revset: flatten chained 'list' operations (aka function args) (issue5072)
Internal _matchfiles() function can take bunch of arguments, which would
lead to a maximum recursion depth error. This patch avoids the excessive
stack use by flattening 'list' nodes beforehand.

Since getlist() no longer takes a nested 'list' nodes, _parsealiasdecl()
also needs to flatten argument list, "aliasname($1, $2, ...)".
2016-02-02 23:49:49 +09:00
André Sintzoff
7d205ba10a help: fix typo in backgroundclose documentation 2016-02-05 19:40:57 +01:00
Matt Mackall
14c6be5d46 Added signature for changeset 48d3cfe1ba91 2016-02-03 16:00:00 -06:00
Siddharth Agarwal
69360ef583 rebase: don't preserve most extra fields
This backs out changeset 5293d4f88aef.

See the previous patches for why.
2016-02-03 09:23:31 -08:00
Siddharth Agarwal
d6d688266e rebase: backout changeset 9b23739c41de
This is a dependency for a future backout of 5293d4f88aef.

See the previous patches for why.
2016-02-03 09:24:47 -08:00
Siddharth Agarwal
82b2cbc2ee rebase: backout changeset 9fd8e3a61d6a
This is a dependency for a future backout of 5293d4f88aef.

See the previous patches for why.
2016-02-03 09:23:52 -08:00
Siddharth Agarwal
08f24f1f67 graft: don't preserve most extra fields
This backs out changeset 9aa13e9feec8.

See the previous patch for why we're doing this.
2016-02-03 09:06:52 -08:00
Siddharth Agarwal
c8ebb66630 amend: don't preserve most extra fields
This backs out changeset fd794e885a9e9.

There are some extra fields that absolutely should not be preserved, like the
convert_revision field introduced by the convert and hgsubversion extensions.
The problem with extensions blacklisting certain extra fields is that they
might not be enabled at the time the amend is performed.

In the long run we probably want separately marked transferable and
non-transferable extra fields, but for now restore the old Mercurial 3.6
behavior.
2016-02-03 08:59:46 -08:00
Wagner Bruna
de70b03c22 histedit: fix typo in documentation 2016-02-03 11:01:11 -02:00
Yuya Nishihara
9d11e83caf osutil: do not abort loading pure module just because libc has no recvmsg()
On Solaris, recvmsg() is provided by libsocket.so. We could try hard to look
for the library which provides 'recvmsg' symbol, but it would make little sense
now since recvfds() won't work anyway on Solaris. So this patch just disables
_recvmsg() on such platforms.

Thanks to FUJIWARA Katsunori for spotting this problem.
2016-02-03 22:47:27 +09:00
Yuya Nishihara
ce2c3d9c16 osutil: disable compilation of recvfds() on unsupported platforms
It appears that Solaris doesn't provide CMSG_LEN(), msg_control, etc. As
recvfds() is only necessary for chg, this patch just drops it if CMSG_LEN
isn't defined, which is the same workaround as Python 3.x.

https://hg.python.org/cpython/rev/c64216addd7f#l7.33
2016-02-02 20:56:48 +09:00
Wagner Bruna
520e980e14 i18n-pt_BR: synchronized with f565b894e807 2016-02-03 10:57:27 -02:00
Matt Mackall
00e8416bcd Added signature for changeset b68cb92d45ee 2016-02-01 17:58:13 -06:00
Matt Mackall
441b93c1f5 merge with i18n 2016-02-01 16:14:51 -06:00
FUJIWARA Katsunori
7b42659ca1 i18n-ja: synchronized with 8722bd8b0726 2016-02-01 23:17:40 +09:00
Wagner Bruna
f0a0975a77 i18n-pt_BR: synchronized with 2fdffa2ec2c4 2016-02-01 12:12:06 -02:00
Martin von Zweigbergk
80df9c6505 verify: recover lost freeing of memory
In 0413f674179e (verify: move file cross checking to its own function,
2016-01-05), "mflinkrevs = None" was moved into function, so the
reference was cleared there, but the calling function now held on to
the variable. The point of clearing it was presumably to free up
memory, so let's move the clearing to the calling function where it
makes a difference. Also change "mflinkrevs = None" to "del
mflinkrevs", since the comment about scope now surely is obsolete.
2016-01-31 00:31:55 -08:00
Martijn Pieters
9c233476de rebase: better way to detect non-detaching revisions (issue5044)
Rather than look for the lowest revision, see if the rebase state is tracking
the parents of this revision. Otherwise we can't handle multiple revisions in
one rebase that includes a merge revision.

Fixes issue5044.
2016-02-01 15:41:43 +00:00
FUJIWARA Katsunori
127b880d6a doc: itemize text blocks to increase readability in HTML format
Before this patch, text blocks changed in this patch are shown as just
continuous text blocks like below in HTML format.

    Global configuration like the username setting is typically put into:

    %USERPROFILE%\mercurial.ini
    $HOME/.hgrc

This patch itemizes these text blocks to increase readability in HTML
format.

    Global configuration like the username setting is typically put into:

    - %USERPROFILE%\mercurial.ini (on Windows)
    - $HOME/.hgrc (on Unix, Plan9)

Like as other platform sensitive container-ed text blocks, this patch
also adds explicit "on PLATFORM" information to each items for
readability in HTML format, even though output of "hg help config" on
command line seems a little redundant. For example, on Unix:

    Global configuration like the username setting is typically put into:

    - "$HOME/.hgrc" (on Unix, Plan9)
2016-02-01 22:14:06 +09:00
FUJIWARA Katsunori
4c1f8febc6 doc: use correct indentation for enumeration
This creates hg.1.html as expected.
2016-02-01 22:14:06 +09:00
FUJIWARA Katsunori
c6d9f4c401 doc: use correct cross reference in help documentation
This patch fixes problems below:

  - ":hg:" role should be followed by not '"' but '`'
  - there is a help topic not "default-push" but "config.default-push"
2016-02-01 22:13:57 +09:00
FUJIWARA Katsunori
6a03d4f576 doc: prevent literal text block from being treated as non-literal one
This creates hg.1.html as expected.
2016-02-01 22:06:35 +09:00
FUJIWARA Katsunori
901d78d859 doc: prevent non-literal text block from being treated as literal one
This creates hg.1.html as expected.
2016-02-01 22:06:35 +09:00
FUJIWARA Katsunori
a189f9751b histedit: show correct hash ID at verification error
node.short() on 'ha' in verifyactions() causes broken hash ID, because
it is initialized with node.hex()-ed node value.
2016-02-01 20:29:20 +09:00
Yuya Nishihara
c24eb61d0c backout: disable --merge with --no-commit (issue4874)
Because "backout --merge" have to make a commit before merging, it doesn't
work with --no-commit. We could change "backout --merge" to make a merge
commit automatically, and --no-commit to bypass a merge commit, but that
change would be undesirable because:

 a) it's hard to fix bad merges in general
 b) two commits would be created with the same --message

So, this patch simply disables "--merge --no-commit".
2016-01-30 18:00:11 +09:00
Martin von Zweigbergk
86ca76bafe changegroup: fix pulling to treemanifest repo from flat repo (issue5066)
In b89de5ee5b31 (changegroup: don't support versions 01 and 02 with
treemanifests, 2016-01-19), I stopped supporting use of cg1 and cg2
with treemanifest repos. What I had not considered was that it's
perfectly safe to pull *to* a treemanifest repo using any changegroup
version. As reported in issue5066, I therefore broke pull from old
repos into a treemanifest repo. It was not covered by the test case,
because that pulled from a local repo while enabling treemanifests,
which enabled treemanifests on the source repo as well. After
switching to pulling via HTTP, it breaks.

Fix by splitting up changegroup.supportedversions() into
supportedincomingversions() and supportedoutgoingversions().
2016-01-27 09:07:28 -08:00
Martin von Zweigbergk
19285a7ebc tests: minor cleanup to treemanifest test 2016-01-28 13:49:05 -08:00
Siddharth Agarwal
bfbbb007c7 merge: don't try to merge subrepos twice (issue4988)
In my patch series ending with rev c3f2eede6938 I switched most change/delete
conflicts to be handled at the resolve layer. .hgsubstate was the one file that
we weren't able to handle, so we kept the old code path around for it.

The old code path added .hgsubstate to one of the other lists as the user
specifies, including possibly the 'g' list.

Now since we did this check after converting the actions from being keyed by
file to being keyed by action type, there was nothing that actually removed
.hgsubstate from the 'cd' or 'dc' lists. This meant that the file would
eventually make its way into the 'mergeactions' list, now freshly augmented
with 'cd' and 'dc' actions.

We call subrepo.submerge for both 'g' actions and merge actions.

This means that if the resolution to an .hgsubstate change/delete conflict was
to add it to the 'g' list, subrepo.submerge would be called twice. It turns out
that this doesn't cause any adverse effects on Linux due to caching, but
apparently breaks on other operating systems including Windows.

The fix here moves this to before we convert the actions over. This ensures
that it .hgsubstate doesn't make its way into multiple lists.

The real fix here is going to be:
(1) move .hgsubstate conflict resolution into the resolve layer, and
(2) use a real data structure for the actions rather than shuffling data around
    between lists and dictionaries: we need a hash (or prefix-based) index by
    file and a list index by action type.

There's a very tiny behavior change here: collision detection on
case-insensitive systems will happen after this is resolved, not before. I think
this is the right change -- .hgsubstate could theoretically collide with other
files -- but in any case it makes no practical difference.

Thanks to Yuya Nishihara for investigating this.
2016-01-29 14:19:29 -08:00
Nathan Goldbaum
2d19c5b8f4 bookmarks: improve documentation for --rev option 2016-01-27 16:16:38 -06:00