Commit Graph

28725 Commits

Author SHA1 Message Date
Robert Stanca
dbef46257d py3: use absolute_import in printenv.py 2016-04-16 05:32:10 +03:00
Robert Stanca
ce17bf1632 py3: use absolute_import in mockblackbox.py 2016-04-16 05:30:32 +03:00
Robert Stanca
93242cf5a6 py3: use absolute_import in killdaemons.py 2016-04-16 05:29:29 +03:00
Matt Harbison
b7d18383be test-shelve: shorten a long path so it works on Windows 2016-04-15 22:53:53 -04:00
Matt Harbison
16f31667a5 test-convert-git: skip tests with invalid path characters on Windows 2016-04-15 22:37:52 -04:00
Matt Harbison
4e1571628b test-subrepo-git: add globs for Windows 2016-04-15 22:23:34 -04:00
Pierre-Yves David
85af4946a6 hook: report untrusted hooks as failure (issue5110) (BC)
Before this patch, there was no way for a repository owner to ensure that
validation hooks would be run by people with write access. If someone had write
access but did not trust the user owning the repository, the config and its hook
would simply be ignored.

After this patch, hooks from untrusted configs are taken into account but never
actually run. Instead they are reported as failures right away. This will ensure
validation performed by a hook is not ignored.

As a side effect writer can be forced to trust a repository hgrc by adding a
'pretxnopen.trust=true' hook to the file.

This was discussed during the 3.8 sprint with Matt Mackall, Augie Fackler and
Kevin Bullock.
2016-04-14 02:41:15 -07:00
Pierre-Yves David
4d33b1dcbd hook: split config reading further
We want an easy way to fetch the hook config with and without honoring
"trusted" so that we can compare the values. So we extract the part
retrieving raw hook data from the config to be able to call it twice
in the next patch.
2016-04-14 17:03:49 -07:00
Pierre-Yves David
c43606ce3c hook: small refactor to store hooks as dict instead of list
We are about to take untrusted hooks into account (to report them as failures)
so we need to rearrange the code a bit to allow config overwriting each other
in a later patch.
2016-04-14 02:28:46 -07:00
timeless
099d7d30ce mail: retain hostname for sslutil.wrapsocket (issue5203)
SMTPS + STARTTLS need to provide serverhostname,
and we can't store it in sslkwargs because that breaks
something involving the https protocol.
2016-04-15 17:43:47 +00:00
Pulkit Goyal
da7d2d2b5d tests: make test-trusted use print_function
There was some confusing output format at some places in
test-trusted.py.out, the new print function ends with a newline by
default whereas the old print statement uses a space generally. So the
output in test-trusted.py.out is changed because of some confusing
output format which was produced by print statement
2016-04-16 04:06:24 +05:30
Pulkit Goyal
8c6c495c76 tests: make test-doctest use absolute_import 2016-04-16 03:38:23 +05:30
Pulkit Goyal
f686137f10 tests: make test-hgwebdir-paths use absolute_import 2016-04-16 03:35:27 +05:30
Pulkit Goyal
5865b15065 tests: make test-lrucachedict use print_function 2016-04-16 03:22:45 +05:30
Pulkit Goyal
6a5c814c42 tests: make test-lrucachedict use absolute_import 2016-04-16 03:10:41 +05:30
Pulkit Goyal
3a8bb7b3ef tests: make test-manifest use absolute_import 2016-04-16 03:08:16 +05:30
Pulkit Goyal
ebb09b497e tests: make test-pathencode use absolute_import 2016-04-16 03:04:23 +05:30
Pulkit Goyal
7e32ca8304 tests: make test-simplemerge use absolute_import 2016-04-16 02:59:36 +05:30
Pierre-Yves David
8727b619f9 crecord: cleanup the remains of commit confirmation
The confirmation screen is now only used for the 'review' option we simplify
the code and rename the function.
2016-04-14 01:37:29 -07:00
Pierre-Yves David
cfee396b5b crecord: drop the extra confirmation screen
The commit confirmation is not very useful -- it gives no way to view what you
have selected, so you're blindly choosing whether to proceed or not, and it adds
a lot of unnecessary friction to committing. In addition, we now have a working
'review' choice for those who really want to review the final change.

Ryan McElroy initially submitted a config option to make this optional, but we
never saw a V2. However as the freeze is near and curses have never been
officially out of the door, I think it is worth skipping the config and trying
getting it right for this release.
2016-04-14 01:27:18 -07:00
Yuya Nishihara
51590b34c7 update: resurrect bare update from null parent to tip-most branch head
The situation is tricky if repository has no "default" branch, because "null"
revision belongs to non-existent "default" branch.

Before 9d20b43f7098, bare update from null would bring us to the tip-most
non-closed branch head. 9d20b43f7098 removed the special handling of missing
"default" branch since we wanted to stick to the uncommitted branch in that
case. But, if the parent is "null" revision, and if the missing branch is
"default", it shouldn't be an uncommitted branch. In this case, bare update
should bring us to the tip-most head as before.

This should fix the test breakage introduced by 9d20b43f7098.
2016-04-15 20:37:11 +09:00
timeless
0650f1c5f8 tests: run import-checker with tests .t files 2016-04-12 14:43:36 +00:00
timeless
9af2e630f0 import-checker: parse python code from .t files 2016-04-12 21:43:56 +00:00
timeless
103d337d89 import-checker: track filenames for SyntaxErrors 2016-04-13 16:34:59 +00:00
timeless
37896a9aaf import-checker: track SyntaxErrors
We don't really need to report SyntaxErrors, since in theory
docchecker or a test will catch them, but they happen, and
we can't just have the code crash, so for now, we're reporting
them.
2016-04-13 16:36:19 +00:00
timeless
36d6fb58ef import-checker: refactor source reading
This will allow .t files to generate multiple sources.
It will also allow .py doctests to generate additional sources.
2016-04-11 22:34:04 +00:00
Pulkit Goyal
23ce27e5a3 tests: make test-pathencode use print_function 2016-04-14 01:06:45 +05:30
Pulkit Goyal
013ab712f9 tests: make test-run-tests use absolute_import 2016-04-14 01:03:24 +05:30
Pulkit Goyal
d06862e5b0 tests: make test-symlink-os-yes-fs-no use absolute_import 2016-04-14 00:58:31 +05:30
Pulkit Goyal
356cc5f1db tests: make test-ui-color use absolute_import 2016-04-14 00:56:08 +05:30
Pulkit Goyal
9a264b103c tests: make test-url use absolute_import 2016-04-14 00:53:35 +05:30
Pulkit Goyal
05677e56ec tests: make test-trusted use absolute_import 2016-04-14 00:49:58 +05:30
Yuya Nishihara
d00a0ddedf templater: add parsing and expansion rules to process "templatealias" section
The debugtemplate command is updated to show expanded tree, but still the
template engine doesn't support alias expansion. That's why the test says
"parse error" for now.
2016-03-27 20:31:56 +09:00
Yuya Nishihara
b9d70a8ce1 templater: add function to parse whole string as template expression
This will be a parser of template aliases, and it can also be used for
processing quoted string templates in map files. That's why this function
isn't defined in the upcoming _aliasrules class.
2016-03-27 20:29:03 +09:00
Yuya Nishihara
85d1a67355 parser: factor out _trygetfunc() that extracts function name and arguments
This provides a customization point for templater. In templater, there are
two ways to call a unary function: func(x) and x|func. They are processed
differently in templater due to historical reasons, but they should be
handled in the same way while expanding aliases. In short, x|func should be
processed as syntactic sugar for func(x).

_funcnode and _getlist() are replaced by _trygetfunc().
2016-03-29 17:27:34 +09:00
Yuya Nishihara
f873b2cea1 parser: make _getalias() return (alias, pattern-args) pair
This allows us to factor out a function that extracts a function (name, args)
pair. See the next patch for why.
2016-03-29 17:21:11 +09:00
Yuya Nishihara
22818c3975 parser: drop redundant comparison between alias declaration tree and pattern
Since _getalias() explicitly tests the type and name of the pattern tree, we
don't need to compare "a.tree == tree" for 'symbol', and "a.tree == tree[:2]"
for 'func', where tree is either ('symbol', name) or ('func', ('symbol', name)).

This change helps implementing better handling of template aliases. See the
subsequent patches for details.

The alias.tree field is removed as it is no longer used.
2016-03-29 16:50:16 +09:00
timeless
2778e2894f patchbomb: fix public-is-missing hint
Without this, there is no space between a hash and the -r preceding the next
line in the use hg push hint
2016-04-14 14:26:37 +00:00
timeless
d34aba084e tests: clarify patchbomb repo is public not remote 2016-04-14 14:36:52 +00:00
timeless
13f6bf6c8e run-tests: set HGMODULEPOLICY for --pure
Without this, my python 2.6 virtualenv test run with --pure and
--local fails with:

+  ImportError: Python minor version mismatch: The Mercurial extension modules were compiled with Python 2.7.8, but Mercurial is currently using Python with sys.hexversion=33950192: Python 2.6.9 (unknown, Apr 13 2016, 12:40:12)
+  [GCC 4.9.2 20141101 (Red Hat 4.9.2-1)]
+   at: ~/hg/py26/bin/python
2016-04-13 13:51:39 +00:00
Nathaniel Manista
9e78f05831 cmdutil: avoid recycling variable name "name" in namespaces code
This just feels like asking for future trouble and confusion.
2016-04-14 15:26:18 -04:00
liscju
4b86252e85 update: fix bare update to work on new branch
So far bare update on new branch results in
'abort: branch new-branch not found'. This commit fixes
this by updating to the parent of wctx.

The effect of updating to the parent of wctx is to move to the paren't
branch - this means that it is no longer necessary to prevent you from
updating if you would lose your newly created branch.
2016-04-05 06:53:33 +02:00
liscju
22e1e3529b remove: fix --force option help description (issue5177)
Before this commit --force option help description stated
that file was removed and deleted even if file was added
or modified which is not true. Force option removes added
file only from dirstate, it doesn't delete it from the
filesystem.
2016-04-13 09:56:51 +02:00
Martijn Pieters
7d4b1c457a logtoprocess: new experimental extension
This extension lets you direct specific ui.log() information to shell
commands, spawned in the background. This can be used to, say, capture
timings, commandfailure tracebacks, etc., making the output available
to other command-line tools.
2016-04-05 17:39:59 +01:00
Mads Kiilerich
274ba69e53 convert: keep converted hg parents that are outside convert.hg.revs (BC)
Before, when converting revisions without also including their already
converted parents in convert.hg.revs, the parents would no longer be parents.

That seems unfortunate and we dare to assume that nobody ever wants that.

Instead, preserve parents that are outside the current convert range but
already have been converted.

The parents returned in getcommit() are unconditionally converted, so we
introduce a separate optparents with optional parents.
2016-04-13 00:16:21 +02:00
Mads Kiilerich
baa3481392 tests: coverage of ancestry with convert in multiple non-overlapping steps
This exposes that parent information is lost in cases where it is possible to
preserve it - and where it thus would make sense if that was what happened.
2016-03-24 16:01:07 -07:00
Yuya Nishihara
4d9561138b revset: rename findaliases() to expandaliases()
This function returns a full tree of alias expansion applied, which sounds
different from what "findaliases" would do.
2016-02-29 22:58:15 +09:00
Yuya Nishihara
e178513a20 parser: add short comment how aliases are expanded in phases 2016-03-29 16:30:59 +09:00
Yuya Nishihara
8c48f711f6 parser: reorder alias expansion routine to return early
I think it improves readability to move trivial cases first, and unindent
blocks.
2016-03-29 16:19:31 +09:00
Yuya Nishihara
45e9c21bc0 parser: move functions that process alias expansion to rule-set class
They will be commonly used by revset and templater. It isn't easy to understand
how _expand() works, so I'll add comments by a follow-up patch.

The local variable 'alias' is renamed to 'a' to avoid shadowing the global
'alias' class.
2016-02-29 22:15:44 +09:00