Commit Graph

29443 Commits

Author SHA1 Message Date
Anton Shestakov
f6519368e1 tests: update bugzilla link in test-issue1175.t 2016-08-04 19:51:03 +08:00
Yuya Nishihara
7c8b72638d journal: use fm.formatdate() to pass date tuple in appropriate type (BC) 2016-07-31 17:11:48 +09:00
Yuya Nishihara
bcdd7c502f formatter: add function to convert date tuple to appropriate format 2016-07-31 17:07:29 +09:00
Yuya Nishihara
431f6e2124 journal: use fm.formatlist() to pass hashes in appropriate type (BC) 2016-07-31 16:56:26 +09:00
Yuya Nishihara
f449ec5977 formatter: add function to convert list to appropriate format (issue5217)
Before, it wasn't possible for formatter to handle array structure other
than date tuple. We've discussed that at the last sprint, which ended we
would probably want to allow only templatable data structure, i.e. a list
of dicts:

  data(tags=[{'tag': a}, {'tag': b}, ...])

Unfortunately, it turned out not working well with template functions:

  "{ifcontains(a, tags, ...)}"
    ^^^^^^^^^^^^^^^^^^
    "a in tags", where tags should be a plain list/set of tags

So the formatter must at least know if the type [{}] was constructed from
a plain list or was actually a list of dicts.

This patch introduces new explicit interface to convert an array structure
to an appropriate data type for the current formatter, which can be used
as follows:

  fm.write('tags', _('tags: %s\n'), fm.formatlist(tags, name='tag'))

No separate fm.data() call should be necessary.
2016-07-10 21:03:06 +09:00
Yuya Nishihara
df734a45ca journal: use fm.hexfunc() to get full hash in JSON/template output (BC)
We generally do that.
2016-07-31 16:38:16 +09:00
Pulkit Goyal
b12e59d025 py3: update test-check-py3-compat.t output
The lower part of test-check-py3-compat.t runs only on py3 and hence its
 remain unchanged. Hence this patch updates the output so that change in output
 in the next patches will be only related to the change in the patch.
2016-08-04 00:04:48 +05:30
Pierre-Yves David
9652a8ad03 deprecation: enforce thew 'tr' argument of 'dirstate.write' (API)
Compatibility was meant to be drop after 3.9 is released.
2016-08-02 16:51:27 +02:00
Pierre-Yves David
a7ac53500f tests: remove initial bundle2 enabling in various bundle2 tests
Bundle 2 is enable by default since 3.6 so we don't need this anymore.

The remaining use of 'experimental.bundle2-exp' are there to test legacy behavior
with bundle 1. Future patches will introduce a way outside of experimental to
test that.
2016-08-02 14:54:06 +02:00
Pierre-Yves David
f1d1e225a0 tests: remove bundle2 activation from test-largefiles.t
This is an old config that predate bundle2 on by default. This should have been
remove after Mercurail 3.6 got released.
2016-08-02 15:44:51 +02:00
Pierre-Yves David
a4d5cee7ca tests: remove bundle2 activation from test-tags.t
This is an old config that predate bundle2 on by default. This should have been
remove after Mercurail 3.6 got released.
2016-08-02 15:05:57 +02:00
Yuya Nishihara
bd360299a6 templatekw: change joinfmt to a mandatory argument of _hybrid object
We've fixed several bugs caused by the misuse of the default joinfmt. Make
it more explicit to prevent future bugs.

dict.values()[0] is replaced by dict[element] as showlist() knows what the
key is.
2016-07-23 13:08:43 +09:00
Yuya Nishihara
24e1889328 url: drop compatibility wrapper of socket.create_connection()
It should be available on Python 2.6+.
2016-07-18 23:12:09 +09:00
Yuya Nishihara
e1051c310e doc: remove double imports of inspect from hgmanpage.py 2016-05-14 14:37:25 +09:00
Yuya Nishihara
b432ce21ff merge: concatenate default conflict marker at parsing phase of .py
"+" operations are unnecessary.
2015-05-05 10:51:34 +09:00
Pierre-Yves David
da34f186a3 tests: remove bundle2 activation from test-push-warn.t
This is an old config that predate bundle2 on by default. This should have been
remove after Mercurail 3.6 got released.
2016-08-02 03:54:17 +02:00
Pierre-Yves David
db3b71ac20 tests: remove bundle2 activation from test-phases-exchanges.t
This is an old config that predate bundle2 on by default. This should have been
remove after Mercurail 3.6 got released.
2016-08-02 03:53:48 +02:00
Pierre-Yves David
4f85aaaa06 tests: remove bundle2 activation from test-obsolete.t
This is an old config that predate bundle2 on by default. This should have been
remove after Mercurail 3.6 got released.
2016-08-02 03:53:17 +02:00
Pierre-Yves David
4e9cb6a3a0 tests: remove bundle2 activation from test-http-proxy.t
This is an old config that predate bundle2 on by default. This should have been
remove after Mercurail 3.6 got released.
2016-08-02 03:53:05 +02:00
Pierre-Yves David
0626099d50 tests: remove bundle2 activation from test-hook.t
This is an old config that predate bundle2 on by default. This should have been
remove after Mercurail 3.6 got released.
2016-08-02 03:50:58 +02:00
Pierre-Yves David
38227e0903 tests: remove bundle2 activation from test-acl.t
This is an old config that predate bundle2 on by default. This should have been
remove after Mercurail 3.6 got released.
2016-08-02 03:50:42 +02:00
Augie Fackler
defd77b437 Added signature for changeset f19241339f58 2016-08-01 12:37:25 -04:00
Augie Fackler
de2b5133ca merge with i18n 2016-08-01 12:11:56 -04:00
FUJIWARA Katsunori
8d71526776 i18n-ja: synchronized with 9b5b7cc2faf0 2016-08-01 08:27:22 +09:00
FUJIWARA Katsunori
7276a9d11f doc: make previous line of certificate example end with "::"
Before this patch, certificate example is formatted just as normal
text.
2016-08-01 06:08:27 +09:00
FUJIWARA Katsunori
9e475c7395 doc: fix incorrect use of rst hg role in help text 2016-08-01 06:08:27 +09:00
FUJIWARA Katsunori
7d27fc4948 doc: use field rst syntax to show keywords in debugdeltachain help correctly
List of available keywords is well formatted as a list of fields in
doc string, but is formatted as just normal text in online help
output.
2016-08-01 06:08:26 +09:00
FUJIWARA Katsunori
5f2b407a05 revset: refactor to make xgettext put i18n comments into hg.pot file
xgettext expects both "_()" and (a part of) text to be placed at just
next line of "i18n:" comment.
2016-08-01 06:08:26 +09:00
FUJIWARA Katsunori
5f8eaa537b doc: omit useless _() invocation
In this case, column positioning isn't needed for i18n, too.

Maybe, check-code warning "missing _() in ui message" caused this
useless _() invocation in 6477dd5eeedf.
2016-08-01 06:08:26 +09:00
FUJIWARA Katsunori
7a8d36afcf doc: trim newline at the end of exception message 2016-08-01 06:08:25 +09:00
FUJIWARA Katsunori
26ac627689 demandimport: avoid infinite recursion at actual module importing (issue5304)
Before this patch, importing C module on Windows environment causes
infinite recursion call, if py2exe is used with -b2 option.

At importing C module "a.b", extra hooking by zipextimporter of py2exe
causes:

  0. assumption before accessing "b" of "a":

     - built-in module object is created for "a",
       (= "a" is actually imported)
     - _demandmod is created for "a.b" as a proxy object, and
       (= "a.b" is not yet imported)
     - an attribute "b" of "a" is initialized by the latter

  1. invocation of __import__ via _hgextimport() in _demandmod._load()
     for "a.b" implies _demandimport() for "a.b"

     This is unintentional, because _demandmod might be returned by
     _hgextimport() instead of built-in module object.

  2. _demandimport() at (1) is invoked with not context of "a", but
     context of zipextimporter

     Just after invocation of _hgextimport() in _demandimport(), an
     attribute "b" of the built-in module object for "a" is still
     bound to the proxy object for "a.b", because context of "a" isn't
     updated by actual importing "a.b". even though the built-in
     module object for "a.b" already appears in sys.modules.

     Therefore, chainmodules() returns _demandmod for "a.b", which is
     gotten from the attribute "b" of "a".

  3. processfromitem() on "a.b" causes _demandmod._load() for "a.b"
     again

     _demandimport() takes context of "a" in this case.

     Therefore, attributes below are bound to built-in module object
     for "a.b", as expected:

     - "b" of built-in module object for "a"
     - _module of _demandmod for "a.b"

  4. but _demandimport() invoked at (1) returns _demandmod object

     because _demandimport() just returns the object returned by
     chainmodules() at (3) above.

  5. then, _demandmod._load() causes infinite recursion call

     _demandimport() returns _demandmod for "a.b", and it is "self" at
     _demandmod._load().

To avoid infinite recursion at actual module importing, this patch
uses self._module, if _hgextimport() returns _demandmod itself. If
_demandmod._module isn't yet bound at this point, execution should be
aborted, because actual importing failed.

In this patch, _demandmod._module is examined not on _demandimport()
side, but on _demandmod._load() side, because:

  - the former has some exit points
  - only the latter uses _hgextimport(), except for _demandimport()

BTW, this issue occurs only in the code path for non .py/.pyc files in
zipextimporter (strictly speaking, in _memimporter) of py2exe.

Even if zipextimporter is enabled, .py/.pyc files are handled by
zipimporter, and it doesn't imply unintentional _demandimport() at
invocation of __import__ via _hgextimport().
2016-07-31 05:39:59 +09:00
Kim Randell
7d9a563a01 url: avoid re-issuing incorrect password (issue3210)
Some draconian IT setups lock accounts after a small number of incorrect
password attempts. Mercurial's implementation of the urllib2 authentication was
causing 5 retry attempts with the same credentials, without prompting the user.
The code was attempting to check whether the authorization token had changed,
but unfortunately was reading the misleading 'headers' member of the request
instead of using the 'get_header' accessor.

Modelled on fix for Python issue 8797:
https://bugs.python.org/issue8797
https://hg.python.org/cpython/rev/30e8a8f22a2a
2016-07-29 12:46:07 +01:00
Pierre-Yves David
89eafebd2c packagelib: do not remove packages directory in hggetversion (issue5262)
People running packages related code probably do care about the content of this
directory. In particular this shound fix the rpm builder process.
2016-07-29 00:45:24 +02:00
Pierre-Yves David
a098ddad6b make: introduce a target to clean everything but packages
Removing the 'packages' directory makes nightly builder life much harder.
2016-07-29 00:39:59 +02:00
Matt Mackall
8b736f8354 date: accept broader range of ISO 8601 time specs
The "normal" ISO date/time includes a T between date and time. It also
allows dropping the colons and seconds from the timespec. Add new
patterns for these forms as well as tests.
2016-07-27 15:22:36 -05:00
Matt Mackall
6976de3bc5 date: parse ISO-style Z and +hh:mm timezone specs 2016-07-27 15:20:34 -05:00
Matt Mackall
6fad3ce25a date: refactor timezone parsing
We want to be able to accept ISO 8601 style timezones that don't
include a space separator, so we change the timezone parsing function
to accept a full date string and return both the offset and the
non-timezone portion.
2016-07-27 15:14:19 -05:00
Gregory Szorc
e14145640d tests: glob over ssl error
We do this in the rest of the file. This bad line was introduced in
fbde510a858d.
2016-07-28 08:53:36 -07:00
Christian Ebert
6e0f6b6bd8 keyword: avoid traceback when kwdemo is run outside a repo
68ae3063a47d causes a fatal AttributeError if kwdemo is run outside a repo
because in the temporary repo creation repo is None and therefore cannot have a
baseui attribute.
In this case fall back to using ui.

Add test case.
2016-07-27 13:57:51 +01:00
Hannes Oldenburg
723f5d01de cmdutil: warnings not issued in cat if subrepopath overlaps
Previously a subrepository "sub" would cause no warnings to
be issued for a file "subnot/a", if it's not present in the
corresponding changeset when calling:

hg cat subnot/a
2016-07-27 08:38:54 +00:00
Gábor Stefanik
8c51f3f327 graft: use opts.get() consistently
Make life easier for extension writers.
2016-07-25 17:00:42 +02:00
Gregory Szorc
d7b8ffb31f sslutil: work around SSLContext.get_ca_certs bug on Windows (issue5313)
SSLContext.get_ca_certs() can raise
"ssl.SSLError: unknown error (_ssl.c:636)" on Windows. See
https://bugs.python.org/issue20916 for more info.

We add a try..except that swallows the exception to work around
this bug. If we encounter the bug, we won't print a warning
message about attempting to load CA certificates. This is
unfortunate. But there appears to be little we can do :/
2016-07-25 12:00:55 -07:00
Matt Mackall
01b803db22 extdiff: escape path for docstring (issue5301)
The existing code (a) assumed path would be specified in
encoding.encoding and (b) assumed unicode() objects wouldn't cause
other parts of Mercurial to blow up. Both are dangerous assumptions.

Since we don't know the encoding of path and can't pass non-ASCII
through docstrings, just escape the path and drop the early _(). Will
have to suffice until we can teach docstrings to handle UTF-8b
escaping.

This has the side-effect that the line containing the path is now
variable by the time it reaches _() and thus can't be translated.
2016-07-18 16:25:35 -05:00
Kostia Balytskyi
989ebc4f0d update: fix bug when update tries to modify folder symlink
In cbefa73a359814e6784a63f90b78c7afd39bc7d5, I introduced a new bug:
when a symlink points to a folder in commit A and to another folder
in commit B, while updating from A to B, Mercurial will try to use
removedir on this symlink, which will fail. This is a very bad bug,
since it basically renders symlinks to folders unusable in repos.

Added test case fails without a fix and passes with it.
2016-07-21 15:55:47 -07:00
Anton Shestakov
a8830a1b95 spartan: make annotate popup use theme colors 2016-07-25 12:59:52 +08:00
Anton Shestakov
d6219ea1aa monoblue: make annotate popup use theme colors 2016-07-25 12:37:58 +08:00
Anton Shestakov
fbb5b06e2e gitweb: make annotate popup use theme colors 2016-07-25 12:33:18 +08:00
Anton Shestakov
bc4fdc78c0 paper: make annotate popup use theme colors 2016-07-25 12:22:17 +08:00
Yuya Nishihara
1c24b2522b templatekw: fix join format of parents keyword (issue5292)
Since the default joinfmt() can't process a dict of multiple keywords, we
need a dedicated joinfmt for showparents().

Unlike revset(), parents are formatted as '{rev}:{node|formatnode}' by default.
We copy the default formatting just like showextras() and showfilecopies() do.
2016-07-22 22:12:12 +09:00
Yuya Nishihara
9bf038789f templatekw: fix join format of revset() function
It's been broken since eef3c19484ca, which made makemap() return a dict of
multiple keywords. Because the default joinfmt() randomly picks one item
from a dict, we have to make revset() select d[name] explicitly.
2016-07-22 22:00:46 +09:00