Commit Graph

7427 Commits

Author SHA1 Message Date
Mads Kiilerich
99c7bacd5e color: don't fail on error messages when no curses (issue4237)
The error only occured when Python didn't have curses - such as on Windows and
when Python was built without curses support.

No curses can also be emulated by (re)moving .../lib/python2.7/curses/ from the
Python installation.

It is left as an exercise to figure out exactly what changed in Mercurial that
triggered this error.
2014-05-03 03:29:30 +02:00
Matt Mackall
83f5630acb tests: suppress spurious lchmod error from unzip (issue4088)
Because lchmod doesn't exist on Linux, unzip should be built without lchmod
support. A few distros get this wrong.
2014-05-01 14:33:06 -05:00
Mads Kiilerich
34f9998bde rebase: empty revset should be a gentle no-op with exit code 1, not an error 2014-05-01 16:47:50 +02:00
Mads Kiilerich
9a144bfa2e largefiles: better handling of log from other working directory (issue4236)
When invoked from another directory, the matchers m._cwd will be the absolute
path. The code for calculating relative path to .hglf did not consider that and
log would fail with weird errors and paths.

For now, just don't do any largefile magic when invoked from other directories.
2014-05-01 15:12:49 +02:00
Matt Mackall
36234f5a00 tests: add repository check for pyflakes test
If this test was run from a tarball with no Mercurial repository, it
would fail because 'hg manifest' didn't work.
2014-05-01 09:42:23 -05:00
Pierre-Yves David
7bcfb6a103 graft: do not use .remove on a smart set (regression)
Revset calls use to return a list. Graft use to mutate that list. We cannot do
this anymore leading to a crash when grafting multiple changeset with a revset.

    File ".../mercurial/commands.py", line 3117, in graft
      revs.remove(rev)
    AttributeError: '_addset' object has no attribute 'remove'

We are late in code-freeze so we make the shortest possible fix by turning it
back to a list.
2014-04-28 17:25:36 -07:00
Mads Kiilerich
bdb0a37b31 discovery: don't report all "unsynced" remote heads (issue4230)
49e52fbb2acd made discovery more helpful - too helpful for some extreme use
cases.

Instead, we arbitrarily limit the list it at 4 and add 'or more'.
2014-04-24 16:47:22 +02:00
Julien Cristau
24f866301b rebase: don't abort if we're asked to rebase an empty revset
The documentation says we exit 1 if we have nothing to do, so avoid
breaking that contract when we're passed an empty revset.

This was changed in http://www.selenic.com/hg/rev/1d4f2abc281b to
improve the error message; keep the improved message, just not the
abort.
2014-04-23 13:51:35 +02:00
Matt Harbison
66d98ca80b largefiles: remove directories emptied after their files are moved (issue3515) 2014-04-25 22:34:09 -04:00
Yuya Nishihara
96a8ea56df cmdserver: forcibly use L channel to read password input (issue3161)
Command server is designed to use the channel protocol even if the server
process is accessible to tty, whereas vanilla hg should be able to read
password from tty in that case.  So it isn't enough to swap sys.stdin:

    # works only if the server process is detached from the console
    sys.stdin = self.fin
    getpass.getpass('')
    sys.stdin = oldin

or test isatty:

    # vanilla hg can't talk to tty if stdin is redirected
    if self._isatty(self.fin):
        return getpass.getpass('')
    else:
        ...

Since ui.nontty flag is undocumented and command-server channels don't provide
isatty(), this change won't affect the other uses of ui._isatty().

issue3161 also suggests to provide some context of messages.  I think it can
be implemented by using the generic templating function.
2014-04-26 18:13:06 +09:00
Yuya Nishihara
63bc6388d0 killdaemons: correct typo of _check() function caught by pyflakes 2014-04-29 12:37:36 +09:00
Yuya Nishihara
2e030eb020 match: fix NameError 'pat' on overflow of regex pattern length
'pat' was renamed to 'regex' in 25907f42ff54.
2014-04-29 11:02:40 +09:00
Mads Kiilerich
8b72c846ed httppeer: reintroduce _abort that accidentally was removed in fc14a1cf743e
Including the missing test coverage that would have caught it.
2014-04-23 23:29:55 +02:00
Pierre-Yves David
cb0ccbf8af bundle2: gracefully handle hook abort
We make sure any exceptions raised during the whole span of handling bundle2
processing are decorated. This let us catch exceptions raised by hooks prior to
transaction commit.
2014-04-21 16:13:15 -07:00
Pierre-Yves David
b4b66836e8 bundle2: gracefully handle PushRaced error during unbundle
Same drill again. We catch the PushRaced error, check if it cames from
a bundle2 processing, if so we turn it into a bundle2 with a part
transporting error information to be reraised client side.
2014-04-21 17:51:58 -07:00
Pierre-Yves David
eb0866dfad bundle2: add an error message to push race error
Errors with no explanations makes my uncle Bob sad.
2014-04-21 20:04:54 -07:00
Pierre-Yves David
716843e5d3 bundle2: fix raising errors during heads checking
If the heads on the server differ from the ones reported seen by the client at
bundle time, we raise a PushRaced exception. However, the part raising the
exception was broken.

To fix it, we move the PushRaced class in the error module so it can be
accessible everywhere without an import cycle.

A test is also added to prevent regression.
2014-04-21 18:59:09 -07:00
Pierre-Yves David
f5bff0c11f bundle2: gracefully handle UnknownPartError during unbundle
Same as for Abort error, we catch the error, encode it into a bundle2 reply
(expected by the client) and stream this reply. The client processing of the
error will raise the exception again.
2014-04-21 16:02:03 -07:00
Pierre-Yves David
431490fca7 bundle2: make error testing more modular
We have more than Abort to test.
2014-04-21 15:59:55 -07:00
Pierre-Yves David
3085949133 bundle2: gracefully handle abort during unbundle
Clients expect a bundle2 reply to their bundle2 submission. So we
catch the Abort error and turn it into a bundle2 containing a part
transporting the exception data. The unbundling of this reply will
raise the error again.
2014-04-21 15:48:52 -07:00
Mads Kiilerich
134cd15f9a merge: improve notes for listing the bids for ambiguous merges 2014-04-21 20:24:54 +02:00
Mads Kiilerich
a37cc358ef merge: tell the user when we are using bid merge
Bid merge is a new rarely used feature that the user explicitly enabled - we
should tell/warn when the user actually is using it, just like we tell when we
not are using it.

Give a message like
  note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
2014-04-18 13:33:20 +02:00
Mads Kiilerich
019c70c1d0 merge: fix stray character in bid merge message 2014-04-21 20:22:14 +02:00
Mads Kiilerich
8190c147a9 tests: better test coverage for bid merge
Martin Geisler's test case revealed the previous message argument error.
2014-04-21 20:18:42 +02:00
Isaac Jurado
3b2cb9598b churn: compute padding with unicode strings
Most UTF-8 aware terminals convert multibyte sequences into a single displayed
characters.  Because the first column is padded by counting bytes, the second
column is not perfectly aligned in the presence of non ASCII characters.
2014-04-19 15:11:25 +02:00
Pierre-Yves David
953b10a36c bundle2: move bundle2 config option to section "experimental"
We highlight the fact that this is experimental by moving it to an "experimental"
section, and we match the config name with the server capability name
`bundle2-exp`.
2014-04-17 16:01:58 -04:00
Pierre-Yves David
fd614e4d04 bundle2: move all parts into a bx2 namespace
All currently core parts are moved to a `bx2` namespace (for "bundle 2
experimental"). This should avoid conflicts between the final stable
format and the one about to be released.
2014-04-17 15:45:12 -04:00
Pierre-Yves David
7e653a9c0f bundle2: use HG2X in the header
The current implementation of bundle2 is still very experimental and the 3.0
freeze is yesterday. The current bundle2 format has never been field-tested, so
we rename the header to HG2X. This leaves the HG20 header available for real
usage as a stable format in Mercurial 3.1.

We won't guarantee that future mercurial versions will keep supporting this
`HG2X` format.
2014-04-17 15:27:54 -04:00
Pierre-Yves David
f2ead829c7 bundle2: protect capabilities name and values with url quoting
This lift limitations of the text based encoding.
2014-04-17 01:03:33 -04:00
Pierre-Yves David
f48478a77f bundle2: support for capabilities with values
The capabilities attributes of `bundle20` is now a dictionary and the reply caps
can encode capabilities with values.
2014-04-17 11:44:49 -04:00
Pierre-Yves David
b4784becd2 bundle2: add capabilities support in replycaps part
This part now contains a list of supported capabilities.
2014-04-17 11:32:30 -04:00
Pierre-Yves David
1c2cd8594e bundle2: include stderr when capturing handlers output
We do not discriminate between stdout and stderr yet. But this will do for now.
2014-04-16 23:18:27 -04:00
Pierre-Yves David
53ffee95a2 bundle2: capture remote stdout while unbundling
When a reply is built, the bundle processing will capture the output of each
handler and sends it to the client in a dedicated part.

As a side effect, this add a "remote: " prefix to destination output on local
push. This is considered okay for now as:

1. bundle2 is still experimental,
2. Matt said he could be okay to change output for bundle2,
3. This keeps the implementation simple.

This changeset does it for stdout only. stderr will be done in a future changeset.
2014-04-16 14:22:24 -04:00
Pierre-Yves David
f7d4dc294b bundle2: introduce replycaps part for on-demand reply
The bundle2 processing does not create a bundle2 reply by default anymore.  It
is only done if the client requests it with a `replycaps` part. This part is
called `replycaps` as it will eventually contain data about which bundle2
capabilities are supported by the client.

We have to add a flag to the test command to control whether a reply is
generated or not.
2014-04-16 14:09:35 -04:00
Pierre-Yves David
88fa4f238f bundle2: use an official iterparts method to unbundle parts
Explicit is better than implicit.
2014-04-16 18:41:48 -04:00
Mads Kiilerich
5a1f9b25aa merge: with merge.preferancestor=*, run an auction with bids from ancestors
The basic idea is to do the merge planning with all the available ancestors,
consider the resulting actions as "bids", make an "auction" and
automatically pick the most favourable action for each file.

This implements the basic functionality and will only consider "keep" and
"get" actions. The heuristics for picking the best action can be tweaked later
on.

By default it will only pass ctx.ancestor as the single ancestor to
calculateupdates. The code path for merging with a single ancestor is not
changed.
2014-02-28 02:52:32 +01:00
Lucas Moscovicz
2794920df6 log: changed implementation to use graphlog code
Now that revsets work in a lazy way, log code can be changed to parse every
option into a revset and then evaluate it lazily.

Now expressions like

  "hg log -b default -b ."

are converted into a revset using the same code as graphlog.
2014-02-28 15:10:56 -08:00
Mads Kiilerich
cdb11ac02d context: introduce merge.preferancestor for controlling which ancestor to pick
Multiple revisions can be specified in merge.preferancestor, separated by
whitespace. First match wins.

This makes it possible to overrule the default of picking the common ancestor
with the lowest hash value among the "best" (introduced in f19507e1bcf2).

This can for instance help with some merges where the 'wrong' ancestor is used.
There will thus be some overlap between this and the problems that can be
solved with a future 'consensus merge'.

Mercurial will show a note like
  note: using 40663881a6dd as ancestor of 3b08d01b0ab5 and adfe50279922
        alternatively, use --config merge.preferancestor=0f6b37dbe527
when the option is available, listing all the alternative ancestors.
2014-02-24 22:42:14 +01:00
Mads Kiilerich
81feeb72af context: tell when .ancestor picks one of multiple common ancestors heads
Show a message like
  note: using 0f6b37dbe527 as ancestor of adfe50279922 and cf89f02107e5

So far this is just a warning - there is nothing the user can do to select
another ancestor.
2014-04-17 17:32:04 +02:00
FUJIWARA Katsunori
4ea3569fd2 hgweb: align entries in "changelog" and "revisions" pages of "spartan" style
Before this patch, each log entries in "changelog" and "revisions"
pages of "spartan" style are not aligned by column, because:

  - each log entries are separated "<table>" entries, and
  - there are no fixed "width" information for each "<th>"/"<td>" entries

This patch aligns entries in "changelog" and "revisions" pages of
"spartan" style by:

  - adding 'label' class to '<th>' for 'age' information, and
  - setting 'width' of '<th class="label">' with fixed size

'class="age"' is not used for this purpose, because it is also used to
set "bold" font-weight

"16em" seems to be wide enough to show date information fully, when
web browser disables (or doesn't support) javascript.
2014-04-17 09:36:09 +09:00
FUJIWARA Katsunori
350af37dc3 hgweb: show revisions and hashes gotten from changelog in "comparison" page
Before this patch, revision numbers and hash values in "comparison"
page are gotten from not changelog but filelog.

Such filelog information is useful only for hgweb debugging, and may
confuse users.

This patch shows revision numbers and hash values gotten from
changelog in "comparison" page.
2014-04-17 09:36:09 +09:00
FUJIWARA Katsunori
62dac3c633 hgweb: show as same parents as "hg parents -r REV FILE" in pages for file
Before this patch, "parents" in pages for file doesn't show as same
parents as "hg parents -r REV FILE", when the specified file is not
modified in the specified revision.

For example, it is assumed that revision A, B and D change file "f".

    changelog   (A) ---> (B) ---> (C) ---> (D)
    filelog "f" (x) ---> (y) ------------> (z)

"/file/D/f" invokes "webutil.parents()" with filectx(z) gotten from
changectx(D), and it returns changectx(B). This is as same result as
"hg parents -r D f".

In the other hand, "/file/C/f" invokes "webutil.parents()" with
filectx(y') gotten from changectx(C), and it returns changectx(A),
because filectx(y') is linked to changectx(B), and works like
filectx(y) in some cases.

In this case, revision B is hidden from users browsing file "f" in
revision C.

This patch shows as same parents as "hg parents -r REV FILE" in pages
for file, by making "webutil.parents()" return:

  - "linkrev()"-ed revision only, if:

    - specified context instance is "filectx" (because
      "webutil.parents()" is invoked with changectx, too), and

    - (1) the revision from which filectx is gotten and (2) the one to
      which filectx is linked are different from each other

  - revision gotten from "ctx.parents()", otherwise
2014-04-17 09:36:08 +09:00
FUJIWARA Katsunori
fc4364cead hgweb: make "comparison" get parent from not filelog but changelog
Before this patch, "comparison" shows unexpected result, when the
specified file is not modified in the specified revision, even though
"diff" shows empty result.

When REV doesn't change specified FILE, "diff" shows:

  "hg diff -c REV FILE"

but "comparison" shows:

  "hg diff -c `hg parents -r REV FILE` FILE"

In other words, the former gets parent from changelog, but the latter
gets one from filelog.

This may confuse users browsing (and switching "diff" and
"comparison" of) files in the specified revision.

This patch makes "comparison" get parent from not filelog but
changelog, to show "hg diff -c REV FILE" in both "diff" and
"comparison" pages.
2014-04-17 09:36:08 +09:00
FUJIWARA Katsunori
98201640e7 hgweb: fix lack of "bookmarks" link in "/file" page of "paper" style
This patch also fixes same problem of "coal" style, because it re-uses
"filerevision.tmpl" of "paper" style.

"gitweb" and "monoblue" styles don't have such problems.

"spartan" style doesn't have "bookmarks" page definition itself.
2014-04-17 09:36:08 +09:00
Aaron Jensen
4ecda29bda hgweb: adding branch names from inbranch template to atom feed 2014-04-17 11:45:43 -07:00
Ben Kehoe
3b4d556fee purge: add options for deleting only files or only directories 2013-11-07 17:24:14 -08:00
FUJIWARA Katsunori
dc3a08f408 shelve: accept '--edit' like other commands creating new changeset
After this patch, users can invoke editor for the commit message by
'--edit' option regardless of '--message'.
2014-06-20 16:15:38 +09:00
Augie Fackler
e218dca2c5 test-extension: add check for 'hg version -v' listing enabled extensions 2014-07-08 22:57:54 -04:00
David Soria Parra
2dc9732a35 strip: remove bookmarks after strip succeed (issue4295)
In case we have revs to strip, delete the bookmark after the strip succeeds, not
beforehand as we might still abort due to dirty working directory, etc.
2014-07-08 16:24:23 -07:00
Ryan McElroy
2464893018 templater: introduce word function
This function allows returning only the nth "word" from a string. By default
a string is split as by Python's split() function default, but an optional
third parameter can also override what string the string is split by.
2014-06-12 18:02:23 -07:00
Sean Farley
e5137b4545 test-context: add test for performing a diff on a memctx
We now see the first result of all that refactoring of memctx: we can now diff
against a memctx.
2014-06-13 15:59:18 -07:00
Sean Farley
49ecf5d144 test-context: add test for memctx status 2014-06-13 15:56:11 -07:00
Lucas Moscovicz
097fe28381 largefiles: changed overridelog to work with graphlog
Log for largefiles was failing for graph log since it was overriding match
instead of matchandpats.

[Mads Kiilerich modified this patch to address his review comments and ended up
rewriting/removing most of it.]
2014-03-05 15:55:09 -08:00
Lucas Moscovicz
b7ef7e0c3b largefiles: added test coverage for graph log
[Mads Kiilerich placed this patch before the patch that makes graphlog actually
work correctly for largefiles. As it is introduced here it just adds test
coverage and the actual bugfix patch will show the actual change.]
2014-03-06 14:52:07 -08:00
FUJIWARA Katsunori
0ba1f1ddab check-code: detect "% inside _()" when there are leading whitespaces
Before this patch, "contrib/check-code.py" can't detect "% inside _()"
correctly, when there are leading whitespaces before the format
string, like below:

    _(
      "format string %s" % v)

This patch adds regexp pattern "[ \t\n]*" before the pattern matching
against the format string.

"[\s\n]" can't be used in this purpose, because "\s" is automatically
replaced with "[ \t]" by "_preparepats()" and "\s" in "[]" causes
nested "[]" unexpectedly.
2014-04-16 03:05:00 +09:00
Matt Mackall
3fd77ddc42 merge with stable 2014-07-02 00:01:13 -05:00
Ryan McElroy
e3b09c4564 templater: add symbol to error
This patch makes it easier to debug writing templater functions by
telling the user exactly what was sent to the templater.
2014-06-12 18:07:21 -07:00
Ryan McElroy
f735b30979 templater: introduce startswith function
This function returns a string only if it starts with a given string.
It is particularly useful when combined with splitlines and/or used with
conditionals that fail when empty strings are passed in to take action
based on the contents of a line.
2014-06-12 17:53:37 -07:00
Ryan McElroy
9f5399cbcd templatefilter: add splitlines function
This is useful for applying changes to each line, and it's especially powerful
when used in conjunction with conditionals to modify lines based on content.
2014-06-12 17:45:41 -07:00
Matt Mackall
73894d1463 merge with stable 2014-06-27 15:20:50 -07:00
Stephen Lee
b831a97d01 diff: add nobinary config to suppress git-style binary diffs 2014-06-21 15:56:49 +10:00
Matt Mackall
9e74ea490c branchmap: don't use ui.warn for debug message 2014-06-23 13:50:44 -05:00
Gregory Szorc
0c523b218f tests: define norepo in command decorator 2014-05-04 22:07:45 -07:00
Matt Harbison
91d5edadd1 convert: update the transplant, rebase and graft references in 'extra'
This change allows the origin() and destination() revsets to yield the same
results in the new and old repos after a conversion.  Previously, nothing would
be listed for queries in the new repo.

Like the SHA1 updates to the commit messages, this is only operational when the
'convert.hg.saverev=True' option is specified.  If the old reference cannot be
found, it is left as-is.  It seems slightly better to leave stale evidence of
the graft/transplant/rebase than to eliminate it entirely.
2014-06-11 22:19:29 -04:00
Matt Mackall
f3b0b8e4bb merge with stable 2014-06-18 20:59:36 -05:00
Matt Mackall
e5948a69d1 run-tests: hold iolock across diff/prompt when interactive
Otherwise diff may get separated from the corresponding prompt by
other threads. This required moving the interactive prompting from one
helper method to another.
2014-06-18 20:51:49 -05:00
Matt Mackall
c3f187f7c4 bookmarks: improve the bookmark help (issue4244) 2014-06-18 15:26:07 -05:00
Pierre-Yves David
d5bb6cb3eb test-run-tests.t: test the --nodiff option 2014-05-30 12:57:58 -07:00
Pierre-Yves David
c90f87b7e5 test-run-tests.t: test the --interactive option 2014-05-30 12:12:12 -07:00
anuraggoel
56f12d427d run-tests: fixes the '--interactive' option error
This patch fixes a regression recently introduced by a refactoring.

Previously when failure occurs while testing with '--interactive' was enable,
it didn't prompt user by asking whether he wants to accept this failure
changes or not.

This was happening beacuse of the 'if' condition
if ret or not self._options.interactive or \
not os.path.exists(test.errpath):

Everytime failure occurs, this condition gets true and returns back even
when '--interactive' is enabled. This condition don't led the function to
execute further, which consist the '--interactive' functionality.

Now, on failure with '--interactive' enabled, it prompts user whether he wants
to accepts failure changes or not.
If yes then test gets passed  and returns true, else test gets failed.

On every failure, results gets stored in "self.failures.append((test, reason))"
But if failure changes accepted by user then test must get "pop out" from
failed test list.
2014-06-13 14:45:23 +05:30
anuraggoel
3226c7323f run-tests: checks behaviour of test on failure while testing
On failure while testing, if this function "result.addFailure(self, str(e))"
returns true then test get 'passed' else count as 'failed'.
2014-06-13 14:33:02 +05:30
Matt Mackall
f1d993bf16 merge with stable 2014-06-13 17:42:04 -05:00
Pierre-Yves David
4732464f1e test-run-tests.t: tests --jobs option 2014-05-30 12:12:03 -07:00
Pierre-Yves David
1889819d1f test-run-tests.t: test --debug option 2014-05-30 12:11:51 -07:00
Pierre-Yves David
411c323ef1 test-run-tests.t: test selection of testfile from the command line 2014-05-30 12:11:39 -07:00
Pierre-Yves David
336693de0b test-run-tests.t: tests the --retest option 2014-05-30 12:11:17 -07:00
anuraggoel
04c584a5dc run-tests: fixes the number of tests ran when '--retest' is enabled
This patch fixes a regression recently introduced by a refactoring. (see
a2d588d82fa2 and about 200 previous changesets from Gregory Szorc)

While retesting, that is when '--retest' is enabled, only failure tests run
and others either skipped or ignored.

During retesting, "result.testsRun" holds the count of failure test that has
run. But as while printing output, we have subtracted the skipped and ignored
count from "result.testsRun". Therefore, to make the count remain
the same, we need to add skipped and ignored count before printing.
2014-06-12 03:20:28 +05:30
anuraggoel
ad20794545 run-tests: skipped test should not produce 'i' mark while retesting
When '--retest' option is enabled then skipped test should not produce 'i' mark.
This fixes a regression introduced by a2d588d82fa2 and about 200 previous
changesets from Gregory Szorc.
2014-06-12 02:36:52 +05:30
Pierre-Yves David
61ff88f87e test-run-tests.t: test running a failing test 2014-05-30 12:10:56 -07:00
Matt Mackall
e27ac051fd run-tests: filter whitespace at end of error diffs
Python 2.6 and 2.7 produce slightly different diff headers.
2014-06-13 16:36:53 -05:00
anuraggoel
8761fa590f run-tests: produce '!' mark after running a failing test
This patch  fixes a regression recently introduced by a refactoring (see
a2d588d82fa2 and about 200 previous changesets from Gregory Szorc).  '!' mark
denotes that the test gets failed while testing.
2014-06-12 01:28:22 +05:30
anuraggoel
6abace8ac1 run-tests: produce error on running a failing test
This patch fixes a regression recently introduced by a refactoring (see
a2d588d82fa2 and about 200 previous changesets from Gregory Szorc).  It produce
an error message everytime with a test filename which gets fail while testing
except at one condition when '--nodiff' option is enabled.
2014-06-12 01:36:57 +05:30
Pierre-Yves David
f314702217 test-run-tests.t: test running a passing test 2014-05-30 12:10:19 -07:00
Pierre-Yves David
31b8a93ca3 run-tests: don't check for the mercurial library used when using --with-hg
In the ``--with-hg`` case, we cannot properly infer the location of the mercurial
library, so we skip the warning completely.
2014-06-10 14:32:52 -07:00
Pierre-Yves David
dce829ed70 test: introduce test-run-tests.t
This testfile tests the test runner itself. There were multiple regressions in the
last few weeks. Having tests would prevent this in the future.
2014-05-30 12:09:49 -07:00
Pierre-Yves David
dbfd5660c3 tests: comment the main purpose of `test-unified-test.t` 2014-05-30 11:40:24 -07:00
Pierre-Yves David
b65b8117ce tests: rename `test-run-tests.t to test-unified-test.t`
This ``test-run-tests.y`` is testing the unified test (.t) syntax
interpretation, not really the run-tests.py command tool itself.
2014-05-30 11:35:45 -07:00
Augie Fackler
f2d5956439 patchbomb: reorder header insertions to clarify code
This is done as its own change to make the changes to test-patchbomb.t
easier to review.
2014-06-07 11:32:37 -04:00
Augie Fackler
b8c9c1134c patchbomb: always use message-id of first patch for series-id
This currently has the side effect that the 0 of N message has no
series-id. This won't matter for Mercurial's own use, but may be
undesirable for other projects depending on their workflow.

The way the header is inserted is intentionally a little funny to make
the test expectation diff easier to review.
2014-06-07 11:06:15 -04:00
Augie Fackler
4dd5b69683 test-patchbomb: normalize glob lines and record their construction
This makes it significantly less painful to use --interactive on
run-tests, as you can now use the recorded regular expression
substitutions to fix up the glob lines and produce zero diffs.

This also tightens the expectations of a few of the lines for the MIME
boundaries - it just seemed like the thing to do while in here and
causing some changes.
2014-06-07 11:30:06 -04:00
Pierre-Yves David
1437d7ae17 patchbomb: includes a unique series ID in email header
Now that we have patch index and series size information, having a unique series
identifier will helps tool to glue all email back together without any
additional logic.
2014-05-05 22:51:20 -07:00
Matt Mackall
140901211f resolve: fix grammar of no matching files message 2014-06-09 14:11:17 -05:00
Matt Mackall
3cb2ffc448 merge with stable 2014-06-09 13:53:23 -05:00
FUJIWARA Katsunori
d79f20e375 shelve: add option combination tests for refactoring in succeeding patch 2014-06-05 22:20:32 +09:00
FUJIWARA Katsunori
5ea4e92a4f qfold: allow to specify '--message/'--logfile' and '--edit' at the same time
Before this patch, 'hg qfold' disallows to specify
'--message/'--logfile' and '--edit' at the same time.

'hg qfold' has disallowed such combination since Mercurial 0.9.2, but
this restriction seems not to be reasonable for recent Mercurial,
because all other commands creating new changeset allow it.

This patch allows 'hg qfold' to specify '--message/'--logfile' and
'--edit' at the same time like other commands creating new changeset.
2014-06-01 00:08:33 +09:00
FUJIWARA Katsunori
872d5bce44 qrefresh: allow to specify '--message/'--logfile' and '--edit' at the same time
Before this patch, 'hg qrefresh' disallows to specify
'--message/'--logfile' and '--edit' at the same time.

'hg qrefresh' has disallowed such combination since Mercurial 0.9.2,
but this restriction seems not to be reasonable for recent Mercurial,
because all other commands creating new changeset allow it.

This patch allows 'hg qrefresh' to specify '--message/'--logfile' and
'--edit' at the same time like other commands creating new changeset.
2014-06-01 00:08:32 +09:00
FUJIWARA Katsunori
2b812d91a3 backout: accept '--edit' like other commands creating new changeset
After this patch, users can invoke editor for the commit message by
'--edit' option regardless of '--message'/'--logfile'.
2014-06-01 00:08:32 +09:00
FUJIWARA Katsunori
aa534af518 gpg: accept '--edit' like other commands creating new changeset
After this patch, users can invoke editor for the commit message by
'--edit' option regardless of '--message'.
2014-06-01 00:08:32 +09:00
Pierre-Yves David
21bb02d08f merge: drop the quotes around commit description
We already have a ":" after the user name to denote the start of the
description. The current usage of quotes around the description is
problematic as the truncation to 80 chars is likely to drop the
closing quote. This may confuse syntax coloration in some editors.
2014-05-26 11:44:58 -07:00
Sean Farley
1002b6c612 memfilectx: call super.__init__ instead of duplicating code
This patch changes the calling signature of memfilectx's __init__ to fall in
line with the other file contexts.

Calling code and tests have been updated accordingly.
2013-08-15 16:49:27 -05:00
Pierre-Yves David
7d4ff0f0a2 bundle2: add more phase movement in the test
To test phase exchange with bundle2 we need some phase movement to happen.
Appropriate logging is added to track those changes.
2014-05-27 13:44:16 -07:00
Pierre-Yves David
4d7a80ca09 bundle2: use non-publishing repo in test
If we are going to test usage of bundle for phases exchange, we need some phase movements
to be exchanged.
2014-05-27 13:40:12 -07:00
Pierre-Yves David
79dcdad496 bundle2: use a smarter template for test
We use a more compact template that includes phase information.
2014-05-27 13:30:38 -07:00
Mads Kiilerich
d218c1aced convert: only consider shamap revisions converted if they still exists
Rollback or strip could leave a Mercurial repo with a shamap with revisions no
longer in the repository.

To ensure reliable conversions we now check that the commit actually exists and
consider it non-existing if it doesn't exist.
2014-05-19 22:12:31 +02:00
Mads Kiilerich
3382835737 tests: better tests for two-way convert 2014-05-19 22:10:50 +02:00
Pierre-Yves David
e60d3c1093 bundle2: raise BundleValueError error for stream level unsupported params
This ensures both consistency and smooth propagation over the wire.
2014-05-28 15:37:47 -07:00
Pierre-Yves David
29c25aabd5 bundle2: ignore advisory part with unknown parameters
Advisory parts are advisory. If a handler exists but does not support the
proper parameters, we can safely ignore it.

Test has been updated to include this case.
2014-05-27 12:16:45 -07:00
Pierre-Yves David
da0446d1b9 bundle2: enforce all parameters in a part to be handled
Once we picked a handler, we check that all mandatory parameter keys are
properly supported. If not we raise an exception.

We added a test for this case.

The code now fails for any part with unknown mandatory parameters. We will
ignore such errors for advisory parts in a later changeset.
2014-05-27 12:01:00 -07:00
Pierre-Yves David
d9f1652a77 bundle2: move exception classes into the error module
Exceptions should have known their place.
2014-05-28 15:31:05 -07:00
Pierre-Yves David
08bcb101f2 bundle2: rename UnknownPartError to BundleValueError
We are going to raise exceptions for a wider range of cases: unsupported
mandatory stream and part parameters.  We rename the exception with a wider
name.
2014-05-28 14:22:24 -07:00
Gregory Szorc
c498780367 run-tests: write .err files earlier
Earlier refactoring of run-tests.py accidentally broke --interactive
and external diff generation by not having .err files written before
they are consulted. This patch fixes that.
2014-05-27 19:21:12 -07:00
Gregory Szorc
a52d8f80c9 run-tests: exit with non-0 exit code when tests fail or warn
As part of the run-tests.py refactor, run-tests.py accidentally started
exiting with 0 for most test runs. This patch restores the expected
behavior.
2014-05-27 19:10:22 -07:00
Pierre-Yves David
76215be0d0 bundle2: introduce a `addparam` method on part
We make it easier to add new parameters after the part creation. As for the
``data`` attribute we make sure the part generation has not begun yet.
2014-05-22 11:38:40 -07:00
Pierre-Yves David
3c42f04f04 bundle2: the ability to set `data` attribute of the part is now official
We make it safe to set the data attribute after part creation. It is an allowed
operation as long as the part has not started to be generated.
2014-05-22 11:21:26 -07:00
Pierre-Yves David
121338752e bundle2: update all `addpart callers to newpart`
The new method is what we want in all current cases.
2014-05-23 15:59:19 -07:00
Matt Mackall
95a0ecfb91 merge with stable 2014-05-27 17:41:20 -07:00
Stephen Lee
05934f0bb8 discovery: if a push would create a new head, mention the bookmark name if any 2014-03-08 19:02:39 +11:00
Pierre-Yves David
ca87e2a8ca revert: use p2 as parent when reverting against it
revert was always using p1 as parent. This created some minor misbehavior when
reverting against p2. See test change for an example of that.

This is also a useful cleanup for coming refactoring to revert.
2014-05-14 10:38:05 -07:00
Pierre-Yves David
4a6b74a80e revert: add a test case to reverting "add" during merges
This kind of revert is specifically trickier since the file is
reported as "modified" by status. This case was only tested by some
largefiles test. We introduce proper testing of all aspects of this
case in the revert tests themselves.
2014-05-13 17:28:19 -07:00
Matt Mackall
d4f9291927 merge with stable 2014-05-26 18:16:23 -07:00
Pierre-Yves David
b7c330c46d import: add --partial flag to create a changeset despite failed hunks
The `hg import` command gains a `--partial` flag. When specified, a commit will
always be created from a patch import. Any hunk that fails to apply will
create .rej file, same as what `hg qimport` would do. This change is mainly
aimed at preserving changeset metadata when applying a patch, something very
important for reviewers.

In case of failure with `--partial`, `hg import` returns 1 and the following
message is displayed:

    patch applied partially
    (fix the .rej files and run `hg commit --amend`)

When multiple patches are imported, we stop at the first one with failed hunks.

In the future, someone may feel brave enough to tackle a --continue flag to
import.
2014-05-08 17:08:17 -07:00
Mads Kiilerich
8244be3a60 update: introduce --tool for controlling the merge tool
Update is a kind of merge and may also need a merge tool and should have the
options described in the merge-tools help.
2014-05-19 01:53:34 +02:00
Augie Fackler
bb57f51c4a Merge with stable 2014-05-26 12:39:31 -04:00
Siddharth Agarwal
265738b91b resolve: don't abort resolve -l even when no merge is in progress
This broke some internal automation that was quite reasonably checking for
unresolved files as a way to determine whether a merge happened cleanly. We
still abort for resolve --mark etc.
2014-05-23 13:10:31 -07:00
Mads Kiilerich
c9533b7029 run-tests: assign value to ESCAPEMAP - dict.update do not return self
5819a76729ab did more than what the description said and introduced a bug.
2014-05-25 13:47:42 +02:00
Mads Kiilerich
b478aa67c2 run-tests: fix invalid reference to stringescape after 5819a76729ab 2014-05-25 13:47:19 +02:00
Durham Goode
18580a4620 update: specify custom conflict markers for update (BC)
Add custom conflict markers 'working copy' and 'destination' for doing hg update
when there are conflicts between your working copy and the destination.
2014-05-09 18:09:11 -07:00
Gregory Szorc
9040584c9d run-tests: add docstrings 2014-05-09 16:13:14 -07:00
Gregory Szorc
84bd2471e4 run-tests: avoid duplicate code in vlog() 2014-05-09 15:55:58 -07:00
Gregory Szorc
419c755930 run-tests: make attributes of TestRunner internal
There is little reason for the data members of TestRunner to be public,
as they are implementation details. Enforce it through naming.
2014-04-25 15:34:28 -07:00
Gregory Szorc
dd51f9b9a4 run-tests: make testdir an argument of TestSuite.__init__
With this change, TestSuite no longer accesses anything on TestRunner
and the TestRunner is no longer passed to TestSuite.
2014-04-25 15:11:38 -07:00
Gregory Szorc
3893068a8d run-tests: move loop to a named argument of TestSuite.__init__ 2014-04-25 15:08:03 -07:00
Gregory Szorc
d4cf43f426 run-tests: make keywords a named argument to TestSuite.__init__
This was the last usage of option in ``TextTestRunner.run``.
2014-04-25 15:06:23 -07:00
Gregory Szorc
a9774725ac run-tests: make retest a named argument of TestSuite.__init__ 2014-04-25 15:03:06 -07:00
Gregory Szorc
829f7e62aa run-tests: move whitelist and blacklist to named arguments of TestSuite 2014-04-25 15:00:54 -07:00
Gregory Szorc
6884debc3f run-tests: pass jobs into TestSuite constructor
This starts a series of patches that will lessen the importance of
TestRunner. It will remove the TestRunner instance stored inside the
TestSuite.
2014-04-25 14:51:53 -07:00
Durham Goode
91de13260e rebase: specify custom conflict marker labels for rebase (BC)
Changes rebase conflict markers to say 'source' and 'dest' instead of
'local' and 'other'.  This ends up looking like:

  one
  <<<<<<< dest:   a3e5c7fd master - bob: "A commit to master"
  master
  =======
  mine
  >>>>>>> source: c7fda3e5 - durham: "A commit to my feature branch"
  three
2014-05-08 16:55:56 -07:00
Gregory Szorc
375be90a07 run-tests: move interactive test acceptance into TestResult
We shouldn't be performing interactive prompting during test execution.
The first step of this is to move the functionality into TestResult.
2014-04-22 13:32:05 -07:00
Gregory Szorc
70868f71e0 run-tests: raise WarnTest outside of Test.fail() 2014-04-22 13:25:17 -07:00
Gregory Szorc
382f52cba6 run-tests: move diff generation into TestResult
TestResult is the thing that captures all our test results. It's logical
for diff viewing to be handled there and not inside Test.

While writing this patch, it was discovered that Test.fail() was
printing redundant test result output. This has been removed.

Arguments controlling diffs have been removed from Test.__init__.
2014-04-22 13:16:34 -07:00
Gregory Szorc
cb478bcd7b run-tests: remove global abort flag
The global abort flag has been moved into each Test instance. A
Test.abort() accomplishing the same thing has been added.
2014-04-22 12:35:18 -07:00
Durham Goode
bcc0ea1fe2 merge: add conflict marker formatter (BC)
Adds a conflict marker formatter that can produce custom conflict marker
descriptions. It can be set via ui.mergemarkertemplate. The old behavior
can be used still by setting ui.mergemarkers=basic.

The default format is similar to:

  {node|short} {tag} {branch} {bookmarks} - {author}: "{desc|firstline}"

And renders as:

  contextblahblah
  <<<<<<< local: c7fdd7ce4652 - durham: "Fix broken stuff in my feature branch"
  line from my changes
  =======
  line from the other changes
  >>>>>>> other: a3e55d7f4d38  master - sid0: "This is a commit to master th...
  morecontextblahblah
2014-05-08 16:50:22 -07:00
Gregory Szorc
c2d6530853 run-tests: remove options from Test.__init__
All options are now passed as arguments and we no longer need options.

This enables us to instantiate Test from "plain old data" types. Since
options must be given as arguments, it also makes people think harder
about adding things that may not belong in Test. This will help ensure a
proper separation of responsibility going forward.
2014-04-22 12:20:10 -07:00
Gregory Szorc
5656f4586d run-tests: move shell to Test.__init__ 2014-04-22 12:17:23 -07:00
Gregory Szorc
285b810dae run-tests: move py3kwarnings to Test.__init__ 2014-04-22 12:15:55 -07:00
Gregory Szorc
7a6aa4b289 run-tests: move extra config options to Test.__init__ 2014-04-22 12:13:40 -07:00
Gregory Szorc
2bd392374e run-tests: refactor port number declaration
Instead of making port numbers derived from count and a global initial
port, we now pass a start port to Test.__init__ and do the calculation
at a higher level.
2014-04-22 12:10:25 -07:00
Gregory Szorc
e29eaf20cf run-tests: move timeout into Test.__init__ 2014-04-22 12:04:15 -07:00
Gregory Szorc
08548ac839 run-tests: move interactive to Test.__init__ 2014-04-22 12:01:31 -07:00
Gregory Szorc
7427586dc4 run-tests: move diff options into arguments of Test.__init__ 2014-04-22 11:58:32 -07:00