Commit Graph

12013 Commits

Author SHA1 Message Date
Yuya Nishihara
6cc1150344 templater: store revisions as ints so min/max won't compare them as strings
Because a template value has no explicit type (like ancient PHP), ifcontains()
has to coerce the type of the needle. Before, it was always converted to a
string, which meant any container type should be a list/dict of strings.
This no longer works since we've introduced min/max functions.

In order to work around the untyped nature of templater, this patch adds
a type specifier to hybrid dict/list. It isn't named as "valuetype" since
the _hybrid class can also wrap a dict.
2017-09-19 23:13:46 +09:00
David Demelier
f8643ab014 doc: rename README to README.rst
Many hosting services consider README without extension as plain text. By using
.rst extension, we bring better formatting on many services (e.g. bitbucket).
2017-09-26 08:37:17 +02:00
Boris Feld
b005906aea test: use current user in the multi-user amend scenario
The obsfate template keyword that will be introduced in a later patch
distinguish between current user and other users when displaying the obsfate
users.

Update the test before for clarity.
2017-10-09 08:35:55 +02:00
Boris Feld
fc6eca1146 test: cleanup verbosity variant from fatelog test
Unlike the '{obsfate}' keyword defined in 'hg-evolve', the definition of hg
fatelog in test-obsmarker-template.t is not verbosity dependent. Remove useless
call to fatelog -v and fatelog -q.
2017-10-06 17:05:19 +02:00
Boris Feld
72e6ff1378 test: rename obsfate template alias
We will introduce an obsfate templatekw in the next patch that will conflict
with the obsfate template in the test file, rename the one in test file to
avoid this collision.
2017-10-06 16:36:41 +02:00
Boris Feld
9c89c78d23 obsolete: add a devel.user.obsmarker
In tests, we often want to use a different username in obs-markers without
changing the default user. Add a 'devel.user.obsmarker'.
2017-10-06 16:15:24 +02:00
Augie Fackler
fa984aa77e tests: use readlink.py instead of readlink
The latter doesn't always exist, such as on Solaris-derived platforms.

Differential Revision: https://phab.mercurial-scm.org/D999
2017-10-10 11:03:14 -04:00
Augie Fackler
5c67bd6e5c tests: use readlink.py instead of readlink
The latter doesn't always exist, such as on Solaris-derived platforms.

Differential Revision: https://phab.mercurial-scm.org/D998
2017-10-10 11:02:53 -04:00
Augie Fackler
ae1354616a tests: use readlink.py instead of readlink
The latter doesn't always exist, such as on Solaris-derived platforms.

Differential Revision: https://phab.mercurial-scm.org/D997
2017-10-10 11:02:40 -04:00
Augie Fackler
7d54ffa7a4 tests: use readlink.py instead of readlink
The latter doesn't always exist, such as on Solaris-derived platforms.

Differential Revision: https://phab.mercurial-scm.org/D996
2017-10-10 11:02:23 -04:00
Pulkit Goyal
c2e90cbe3b tests: optimize test-copytrace-heuristics.t
test-copytrace-heuristics.t tests the heuristics algorithm of copytracing. The
test has a pattern of making a server repo first and then cloning into a local
repo for each test to have public and draft commits. This is done because if we
have all draft commits and we have very less commits, heuristics will fallback
to full copytracing as that will be fast.

To avoid creating the server repo, we set the commit limit to -1 so that
everytime we perform the heuristics algorithm even when having full drafts and
tweak the config setting when we need to test the ability to fallback to full
copytracing.

This optimizes this test by 3 seconds.

Before:

real    0m41.503s
user    0m36.068s
sys     0m3.900s

After:

real    0m38.826s
user    0m33.884s
sys     0m3.396s

Differential Revision: https://phab.mercurial-scm.org/D991
2017-10-10 01:03:24 +05:30
Mark Thomas
577a671495 tests: add test for path conflicts during merge
Differential Revision: https://phab.mercurial-scm.org/D787
2017-10-02 14:05:30 -07:00
Mark Thomas
a75bef4867 tests: add test for path conflicts during update
Differential Revision: https://phab.mercurial-scm.org/D786
2017-10-02 14:05:30 -07:00
Mark Thomas
9e54508e20 context: also consider path conflicts when clearing unknown files
When clearing unknown files to remove path conflicts, also delete files that
conflict with the target file's path.

Differential Revision: https://phab.mercurial-scm.org/D785
2017-10-02 14:05:30 -07:00
Mark Thomas
75628a759b merge: check for path conflicts when merging (issue5628)
When merging, check for any path conflicts introduced by the manifest
merge and rename the conflicting file to a safe name.

Differential Revision: https://phab.mercurial-scm.org/D784
2017-10-02 14:05:30 -07:00
Mark Thomas
08fafa25e1 merge: improve error messages for path conflicts during update
Differential Revision: https://phab.mercurial-scm.org/D782
2017-10-02 14:05:30 -07:00
Mark Thomas
710343cbad merge: check for path conflicts when updating (issue5628)
When updating to a new revision, check for path conflicts caused by unknown
files in the working directory, and handle these by backing up the file or
directory and replacing it.

Differential Revision: https://phab.mercurial-scm.org/D781
2017-10-02 14:05:30 -07:00
Mark Thomas
2c239ca545 tests: add a test demonstrating basic path conflict failures
Differential Revision: https://phab.mercurial-scm.org/D773
2017-10-02 14:05:30 -07:00
Mark Thomas
0af395f454 scmutil: handle conflicting files and dirs in origbackuppath
When ui.origbackuppath is set, .orig files are stored outside of the working
copy.  However conflicts can occur when files or directories end up having the
same name.  These conflicts cause Mercurial to abort, even if they've been
created as a result of different backups.

Make sure we always replace files or directories in the origbackuppath if
they conflict with another file or directory.

Test Plan:
Add new unit test for conflicting paths.

Differential Revision: https://phab.mercurial-scm.org/D680
2017-10-02 14:05:30 -07:00
Yuya Nishihara
a92ecdf646 extdata: show debug message if external command exits with non-zero status
This isn't fatal because it's quite common for grep to exit with 1. Thanks to
Foozy for spotting this.
2017-10-01 12:21:50 +01:00
Yuya Nishihara
ef440af2e7 templatekw: allow accessing to nested namespace item by its template name
Since we have the dot operator, it makes more sense to write

  {namespaces.tags % "{tag}"}

instead of

  {namespaces.tags % "{name}"}
2017-09-30 08:57:50 +01:00
Yuya Nishihara
296d077704 templatekw: rename peerpaths to peerurls per naming convention (BC)
Since each element is called as "url", the template keyword should be named
as "<whatever>urls".

{peerurls} is now stabilized.
2017-09-18 23:53:05 +09:00
Yuya Nishihara
db07c1fcd9 templatekw: make experimental {peerpaths} return a single-level dict (BC)
This was planned as in 2bcc691583ec, "{peerpaths.default.pushurl} will be
translated to peerpaths['default'].makemap()['pushurl'], which means
{peerpaths} should be a single-level dict and sub-options should be
makemap()-ed."
2017-09-18 23:31:01 +09:00
Yuya Nishihara
3d25496222 templatekw: fix scope of peerpath url bound to generator
I had to explicitly bind 'd' to the generator. Otherwise, the last 'd' would
be used.
2017-09-18 23:49:05 +09:00
Yuya Nishihara
2a17199870 templater: extend dot operator as a short for get(dict, key) 2017-09-18 23:07:17 +09:00
Yuya Nishihara
6215164ca2 templater: add dot operator to easily access a sub item
This and the next patch will allow us to access a deeply-nested item
by foo.bar.baz syntax.
2017-09-09 19:32:56 +09:00
Yuya Nishihara
366ad4616f templater: wrap get/min/max result so map operation can apply to element
See the test for usage example.

wraphybridvalue() takes a key/value pair because a hybrid dict passes a key
to its makemap() function. Since makemap() of showmanifest() doesn't need
a key, it's set to None.
2017-09-09 19:13:25 +09:00
Saurabh Singh
4d1fce7aa0 test-push-race: use 'ui.atexit' instead of python's 'atexit'
Callbacks registered with 'atexit' are sometimes not called (like when a
process is killed by the SIGTERM signal). Therefore, this commit replaces it
with 'ui.atexit' which ensures that the callbacks are always called. This also
makes the test compatible with chg.

Test Plan:
Ran the test 'test-push-race.t' with and without the '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D957
2017-10-05 20:46:49 +00:00
Jun Wu
8ad49ae972 test-rebase-base: clarify it is about the "--base" flag
It happened several times that people use `test-rebase-base.t` as a general
purposed test file for rebase. But it is intended to be only related to the
`--base` flag. This patch split, renamed the test, and added a note to
clarify.

Differential Revision: https://phab.mercurial-scm.org/D975
2017-10-05 20:41:50 -07:00
Saurabh Singh
ffc1ad2f09 histedit: removing the experimental config 'histeditng'
This config has been around for about 2 years now. So, it can be
assumed to be stable. Therefore, I am removing the config. This also makes the
test 'test-histedit-base.t' compatible with chg.

Test Plan:
 - Ran the test 'test-histedit-base.t' with and without '--chg' option.
 - Ran all the other tests without '--chg' option.
 - Checked the output of 'hg help histedit'.

Differential Revision: https://phab.mercurial-scm.org/D942
2017-10-05 21:56:25 +00:00
Augie Fackler
49deaca739 test-annotate: fix up expected output for pure
This is just a side effect of surfacing the "revisions were skipped"
state in the blame output.

Differential Revision: https://phab.mercurial-scm.org/D956
2017-10-05 15:12:11 -04:00
Jun Wu
0802429abd test-alias: make it compatible with chg
ad1bdea (dispatch: defer environment variable resolution in alias commands
(BC), 2016-05-06) made environment variables lazily resolved. But after
D805 (alias: make alias command lazily resolved 2017-09-23), alias
resolution happened after uisetup, which breaks the test for chg.

`uisetup` is known to behave different in chg. Let's verify the feature
without using `*setup`.

Differential Revision: https://phab.mercurial-scm.org/D912
2017-10-02 16:48:58 -07:00
Saurabh Singh
c06453cd30 serve: make tests compatible with chg
chg only supports 'hg serve' when the options to the serve command
follow the 'hg serve'. For example, 'hg -R <repo> serve ..' is unsupported.
This leads to issues with chg running for the following tests:

 - test-bundle2-exchange.t
 - test-clone-uncompressed.t
 - test-hgweb-csp.t
 - test-http-bad-server.t
 - test-http-bundle1.t
 - test-http-protocol.t
 - test-http.t

There was an effort made earlier to fix this issue for chg and the tests were
fixed to confirm to the compatible pattern. But the new tests did not take care
of the same and hence, fail. Hopefully, there will be continuous build setup
for chg after all tests are made compatible with chg so that we can avoid such
issues.

Test Plan:
Ran the aforementioned tests with and without '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D946
2017-10-04 18:39:26 -07:00
Saurabh Singh
93c6f3667f test-devel-warnings: make the test compatible with chg
The test fails when run with the "--chg" option. Therefore, this
commit makes it compatible with chg.

Test Plan:
Ran the test "test-devel-warnings.t' with and without the "--chg"
option

Differential Revision: https://phab.mercurial-scm.org/D915
2017-10-04 10:42:55 -07:00
Yuya Nishihara
810071518d extdata: ignore ambiguous identifier as well 2017-10-01 11:56:41 +01:00
Yuya Nishihara
a5c1e61fda templater: add experimental support for extdata
This is minimal and non-controversial implementation of extdata() template
function. Originally extdata sources were exposed to the keyword namespace,
but I've changed it to a plain function for simplicity.
2017-10-01 11:13:09 +01:00
Yuya Nishihara
235c46722f revset: add experimental support for extdata
This is minimal and non-controversial implementation of extdata() revset.
Originally extdata sources were exposed to the symbol namespace, but I've
changed it to a plain function for simplicity.
2017-10-01 10:50:00 +01:00
Denis Laxalde
ca0e3377b8 tests: change to parent directory before all "hg init" in test-log.t
Add a "cd .." before the second "hg init" so that all repositories are on top
level of test directory. Makes inspection of test directory easier.
2017-10-04 10:02:15 +02:00
Saurabh Singh
ea7132319b test-strip: make test compatible with chg
The test was using reposetup which had the logic for stripping
commits. This leads to a situation where if the reposetup was called twice for
an extension (which can happen with chg running), the stripped node would not
be found the second time. Therefore, this commit changes the test to put the
stripping logic inside commands instead of the reposetup. This ensures that the
stripping logic is invoked only when the command is invoked and thus, avoids
any problems.

Test Plan:
Ran the test 'test-strip.t' with and without the '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D928
2017-10-03 16:59:17 -07:00
Saurabh Singh
fd92abf61e test-hook: make test compatible with chg
The test uses the 'print' method instead of writing to stdout using
'ui.write' which leads to incompatibility with chg. This commit modifies the
test to use 'ui' instead which fixes the problem.

Test Plan:
Ran the test 'test-hook.t' with and without '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D927
2017-10-03 14:35:24 -07:00
Saurabh Singh
15210308cf test-setdiscovery: make test compatible with chg
The test checks the output of the blackbox extension which will
contain logs corresponding to chg in case chg is running. Therefore, this
commit modifies the test to take chg into consideration while working with the
blackbox extension.

Test Plan:
Ran the test 'test-setdiscovery.t' with and without the '--chg'
option.

Differential Revision: https://phab.mercurial-scm.org/D926
2017-10-03 13:30:36 -07:00
Saurabh Singh
31fe1e97ae test-merge-subrepos: make test compatible with chg
The test checks the output of '.hg/blackbox.log' which will contain
logs corresponding to chg in case chg is running. Therefore, this commit
modifies the test to take chg into consideration while checking the
blackbox.log contents.

Test Plan:
Ran the test 'test-merge-subrepos.t' with and without the '--chg'
option.

Differential Revision: https://phab.mercurial-scm.org/D925
2017-10-03 13:05:58 -07:00
Saurabh Singh
8bb0e0f54f test-convert-cvs: make test compatible with chg
The test uses the 'print' method instead of writing to stdout using
'ui.write' which leads to incompatibility with chg. This commit modifies the
test to use the 'ui' object instead which fixes the problem.

Test Plan:
Ran the test 'test-convert-cvs.t' with and without '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D923
2017-10-03 12:49:28 -07:00
Saurabh Singh
04d7964be4 test-basic: make test compatible with chg
The error codes returned when writing to /dev/full are different after
the first failure with and without '--chg' option. Therefore, this commit
conditionally handles the error codes as appropriate.

Test Plan:
Ran the test 'test-basic.t' with and without '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D922
2017-10-03 12:09:23 -07:00
Jun Wu
372ecf5929 test-revlog-mmapindex: make it compatible with chg
The test misses an explicit flush().

Differential Revision: https://phab.mercurial-scm.org/D918
2017-10-02 19:31:33 -07:00
Jun Wu
9dd2be2e99 test-profile: gate chg-incompatible part with '#if chg'
chg has a different extension loading logic, which affects the profiler
extension test case. Gate the block with '#if chg' so the test passes with
chg.

Differential Revision: https://phab.mercurial-scm.org/D916
2017-10-02 19:10:32 -07:00
Jun Wu
5c5bc340e6 test-logtoprocess: make it compatible with chg
chg runs more commands and outputs more lines. This patch matches them.

Differential Revision: https://phab.mercurial-scm.org/D914
2017-10-02 18:22:43 -07:00
Saurabh Singh
f6be9e54c3 test-globalopts: make the test compatible with chg
The test fails when run with the '--chg' option. Therefore, this
commit modifies the test to make it compatible with chg.

Test Plan:
Ran 'test-globalopts.t' with and without the '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D913
2017-10-03 11:10:03 -07:00
Jun Wu
08d7c65ce8 test-pager: make it compatible with chg
chg's runpager implementation is different. It behaves differently for the
"shell=False, command not found" case.

Differential Revision: https://phab.mercurial-scm.org/D911
2017-10-02 16:11:57 -07:00
Siddharth Agarwal
ba2d76cf38 annotate: mark lines affected by skip-annotate with *
This is to prevent weird surprises from happening with skips being attributed
to the wrong changeset.

.. feature::

   `hg annotate --skip` now prints a `*` on lines with skipped revisions

Differential Revision: https://phab.mercurial-scm.org/D900
2017-10-02 18:18:57 +01:00