Commit Graph

28670 Commits

Author SHA1 Message Date
Robert Stanca
fded95215a py3: use absolute_import in test-duplicateoptions.py 2016-04-03 16:56:15 +03:00
Robert Stanca
8680733411 py3: lexicographical order imports and print_function in test-context.py 2016-04-03 16:34:55 +03:00
Maciej Fijalkowski
44a4e8de4b pypy: fix overspecific test checks
Those tests check a bit too specific message in ImportError/SyntaxError.
Make test-hook and test-bad-extension pass on pypy
2016-04-03 08:26:57 +01:00
Robert Stanca
9cba521c9e tests: lexicographical imports in silenttestrunner.py 2016-04-03 10:02:58 +03:00
Robert Stanca
f65be6478e py3: use absolute_import in test-context.py 2016-04-03 06:20:17 +03:00
Robert Stanca
4687d363df py3: use print_function in test-bdiff.py 2016-04-03 06:16:17 +03:00
Robert Stanca
f0f5c61f68 py3: use absolute_import in test-bdiff.py 2016-04-03 06:12:18 +03:00
Robert Stanca
e8fffac232 py3: use print_function in test-batching.py 2016-04-03 06:10:52 +03:00
Robert Stanca
7210c10a6d py3: use absolute_import in test-batching.py 2016-04-03 06:05:43 +03:00
Robert Stanca
fb029720ba py3: use print_function in silenttestrunner.py 2016-04-02 18:17:23 +03:00
Robert Stanca
61dfaca509 py3: use absolute_import in silenttestrunner.py 2016-04-02 18:16:12 +03:00
Robert Stanca
3fe2accfd7 py3: use print_function in hypothesishelpers.py 2016-04-02 18:15:04 +03:00
Robert Stanca
929a6451ae tests: use absolute_import in hypothesishelpers.py 2016-04-02 18:14:10 +03:00
Robert Stanca
f151e77de8 py3: use print_function in get-with-headers.py 2016-04-02 18:12:33 +03:00
Robert Stanca
26872f1dfd py3: use print_function in generate-working-copy-states.py 2016-04-02 17:36:59 +03:00
Robert Stanca
a51cbf4e77 py3: use print_function in filterpyflakes.py 2016-04-02 17:35:02 +03:00
Robert Stanca
3ab964e343 py3: use print_function in test-ancestor.py 2016-04-02 17:33:11 +03:00
Robert Stanca
118adb331f py3: use print_function in seq.py 2016-04-02 17:29:38 +03:00
Robert Stanca
e8ea25819f py3: use absolute_import in seq.py 2016-04-02 17:28:35 +03:00
Yuya Nishihara
1ad58e18af parser: move parsererrordetail() function from revset module
This will be used by common alias functions introduced by future patches.
2016-02-29 17:02:56 +09:00
Anton Shestakov
5322363f78 hgweb: fix links in atom-branches 2016-04-01 21:18:24 +08:00
Maciej Fijalkowski
a47c59eeab revset: prevent infinite recursion on pypy
as explained in the commit, __len__ cannot do [x for x in self] because
that can potentially call __len__ again, causing infinite recursion
2016-04-01 10:09:34 +02:00
Maciej Fijalkowski
688a2c6f37 pypy: fix doctests for pypy optimizations
PyPy would sometime call __len__ at points where it things preallocating
the container makes sense. Change the doctests so they're using generator
expressions and not list comprehensions
2016-03-31 18:38:08 +02:00
liscju
bb92aaa17c largefiles: replace invocation of os.path module by vfs in reposetup.py
This commit is part of bigger effort described in 'Windows UTF-8' plan.
2016-03-19 15:31:13 +01:00
liscju
7b0ac0d003 largefiles: replace invocation of os.path module by vfs in overrides.py
This commit is part of bigger effort described in 'Windows UTF-8' plan.
It is not changing all invocations but the ones where change is
obviously correct and doesn't require complicated changes.
2016-03-19 14:50:40 +01:00
liscju
f82ff5ff29 bundle: warn when update to revision existing only in a bundle (issue5004)
Now its done silently, so unless user really knows what he is doing
will be suprised to find that after update 'hg status' doesn't work.
This commit makes also merge operation warns about missing parent when
revision to merge exists only in the bundle.
2016-03-23 08:55:22 +01:00
Maciej Fijalkowski
eb8f037251 tests: fix builtin module test on pypy
On pypy datetime and cProfile are modules written in Python, not in C.
For the purpose of this test, just list them explicitely as builtins,
which silences warnings about them being imported before stdlib modules.
2016-03-30 21:54:26 +02:00
Anton Shestakov
9f3a77930a hgweb: generate last change date for an empty atom-bookmarks feed (issue5022)
RFC 4287 states that atom feeds must have an <updated> element, so let's add
one even when repo doesn't have a single bookmark.
2016-03-31 15:37:21 +08:00
Anton Shestakov
d9e41fcffc hgweb: sort bookmarks in revlog order of their nodes
Changes, branches and tags are already in revlog order on /summary, /branches
and /tags, let's now make bookmarks be sorted by the same principle. It's more
helpful to show more "recent" bookmarks on top. This will affect /bookmarks
page in all styles, including atom, rss and raw, and also /summary page.

Bookmarks are sorted using a (revision number, bookmark name) tuple.
2016-03-31 15:22:06 +08:00
Anton Shestakov
0741a98a71 hgweb: sort bookmarks early
Let's do the same thing that /tags page does. It gets sorted tags and then if
it needs the latest only, it just slices the first item from the list. Since
it's a slice and not a min(), it doesn't throw an exception if the list is
empty. This fixes HTTP 500 error from issue5022.
2016-03-31 14:23:27 +08:00
Anton Shestakov
e81bf97ae9 hgweb: add parents to json-log (issue5074)
Entries prepared in webutil.changelistentry() skip showing parents in the
trivial case when there's only one parent and it's the previous revision. This
doesn't work well for the json-log template, which is supposed to just dump raw
data in an easy-to-parse format, so let's provide all parents as another
keyword: allparents.

Using a lambda function here means that the performance of templates that don't
use allparents won't be affected (see 88bd6697bfad).
2016-03-31 18:09:09 +08:00
Yuya Nishihara
5013ac73bc revset: make _parsealiasdecl() simply return the original parsed tree
It wasn't necessary to reconstruct the same tuple.
2016-02-29 17:46:06 +09:00
Yuya Nishihara
9cb56c55c8 revset: inline isvalidfunc(), getfuncname() and getfuncargs()
See the previous commit for why. These functions are also trivial.
2016-02-29 16:35:58 +09:00
Yuya Nishihara
8437ca0ff3 revset: inline isvalidsymbol() and getsymbol() into _parsealiasdecl()
Since I'm going to extract a common alias parser, I want to eliminate
dependencies to the revset parsing rules. These functions are trivial,
so we can go without them.
2016-02-29 16:32:18 +09:00
Yuya Nishihara
23d5f85790 revset: remove redundant checks for parsed tree of alias
If tree is a tuple, it must have at least one element. Also the length of node
tuple is guaranteed by the syntax elements. (e.g. 'func' must have 3 items.)

This change will help inlining these trivial functions in future patches.
2016-02-29 16:23:09 +09:00
timeless
cb70588e15 py3: handle iter/iterkeys+iteritems python3 divergence in import-checker 2016-03-30 08:15:37 +00:00
timeless
14b03acded py3: use print_function in import-checker 2016-03-30 04:55:16 +00:00
timeless
9580d303e6 py3: use absolute_import in import-checker 2016-03-30 04:50:19 +00:00
timeless
ac72d955ec run-tests: make _processoutput picky about optional globs
72b40f92c680 enabled lines that were not matched to be found later in cases of jitter.

Unfortunately, in this model an optional line would always jitter to the end when
it is not present. That is not ideal.

It would be possible to do better, by queuing all writes until the end in case
an optional line jitters, but for now, it is simpler to assume optional lines
have a fixed place in the stream.
2016-03-30 09:13:47 +00:00
timeless
250ff767cf py24: remove check-code py24 notation
We require python2.6+
2016-03-30 07:24:51 +00:00
timeless
8e8201d525 py3: convert hghave output to text
Before this, Python3 generated:
b'skipped: unknown feature: not-py3k\n'
2016-03-30 08:02:34 +00:00
timeless
efbcb6a1c1 py3: convert prereq bytes to string in run-tests
Without this, run-tests would generate:
WARNING: Did not find prerequisite tool: b'python3.5'
2016-03-30 05:26:51 +00:00
Pierre-Yves David
6fceb4873e record: deprecate the extension
The feature has been moved into core behind the -i flag. We can safely
deprecated the extension and point people at the --interactive flag in core.
2016-03-28 12:50:56 -07:00
FUJIWARA Katsunori
4f1a0e917c templater: use templatefunc to mark a function as template function
Using decorator can localize changes for adding (or removing) a
template function in source code.

This patch also removes leading ":FUNC(ARG...):" part in help document
of each function, because using templatefunc makes it useless.

This patch uses not 'func' but 'templatefunc' as a decorator name,
because the former is too generic one, even though the latter is a
little redundant in 'templater.py'.
2016-03-30 02:10:44 +09:00
FUJIWARA Katsunori
7a6d96d902 registrar: add templatefunc to mark a function as template function (API)
This patch also adds loadfunction() to templater, because this
combination helps to figure out how they cooperate with each other.

Listing up loadfunction() in dispatch.extraloaders causes implicit
loading template function at loading (3rd party) extension.

This patch explicitly tests whether templatefunc decorator works as
expected, because there is no bundled extension, which defines
template function.

This change requires that "templatefunc" attribute of (3rd party)
extension is registrar.templatefunc or so.
2016-03-30 02:10:44 +09:00
FUJIWARA Katsunori
a35dfb0209 keyword: use templatefilter to mark a function as template filter
This patch also adds test for filter 'svnisodate' and 'svnutcdate' for
safety, because there is no test using them, yet.
2016-03-30 02:10:44 +09:00
FUJIWARA Katsunori
15ff9ca52f templatefilters: use templatefilter to mark a function as template filter
Using decorator can localize changes for adding (or removing) a
template filter function in source code.

This patch also removes leading ":FILTER:" part in help document of
each filters, because using templatefilter makes it useless.

This patch uses not 'filter' but 'templatefilter' as a decorator name,
because the former name hides Python built-in one, even though the
latter is a little redundant in 'templatefilters.py'.
2016-03-30 02:10:44 +09:00
FUJIWARA Katsunori
098aa2f5a6 registrar: add templatefilter to mark a function as template filter (API)
This patch also adds loadfilter() to templatefilters, because this
combination helps to figure out how they cooperate with each other.

Listing up loadfilter() in dispatch.extraloaders causes implicit
loading template filter functions at loading (3rd party) extension.

This change requires that "templatefilter" attribute of (3rd party)
extension is registrar.templatefilter or so.
2016-03-30 02:10:44 +09:00
Yuya Nishihara
0f4849fc71 revset: inline _getaliasarg() function
This function is now much simpler than before. Inlining small functions helps
to extract a reusable alias processor.
2016-02-14 20:43:30 +09:00
Yuya Nishihara
6c870f3b69 revset: drop redundant check for unknown alias arguments
Since _parsealiasdefn() rejects unknown alias arguments, _checkaliasarg() is
unnecessary. New test is added to make sure unknown '$n' symbols are rejected.
2016-02-14 20:27:08 +09:00