Commit Graph

29441 Commits

Author SHA1 Message Date
Mads Kiilerich
3482fa8368 largefiles: test coverage of fatal interruption of update
Test using existing changesets in a clean working directory, revealing problems
with files that don't show up as modified or do show up as removed when they
just not have been written yet.
2016-10-16 02:26:38 +02:00
Augie Fackler
a7fccde07e Added signature for changeset 6c105ed84c14 2016-10-01 15:00:23 -04:00
Augie Fackler
1fc82bbf21 py3: update test expectation on stable 2016-09-23 14:37:15 -04:00
Kevin Bullock
9eb7f2dc02 grep: rewrite help to better document current (confusing) behavior 2016-09-23 12:45:10 -05:00
timeless
aa2c0ad5a3 crecord: properly handle files with No newline at eof (issue5268)
Yes, this bug was a single character with the wrong case...
2016-09-02 20:15:37 +00:00
Jun Wu
a5ec43fe40 annotate: pre-calculate the "needed" dictionary (issue5360)
The "needed" dict is used as a reference counter to free items in the giant
"hist" dict. However, currently it is not very accurate and can lead to
dropping "hist" items unnecessarily, for example, with the following DAG,

       -3-
      /   \
  0--1--2--4--

The current algorithm will visit and calculate rev 1 twice, undesired. And
it tries to be smart by clearing rev 1's parents: "pcache[1] = []" at the
time hist[1] being accessed (note: hist[1] needs to be used twice, by rev 2
and rev 3). It can result in incorrect results if p1 of rev 4 deletes chunks
belonging to rev 0.

However, simply removing "needed" is not okay, because it will consume 10x
memory:

  # without any change
  % HGRCPATH= lrun ./hg annotate mercurial/commands.py -r d130a38 3>&2 [1]
  MEMORY   49074176
  CPUTIME  9.213
  REALTIME 9.270

  # with "needed" removed
  MEMORY   637673472
  CPUTIME  8.164
  REALTIME 8.249

This patch moves "needed" (and "pcache") calculation to a separate DFS to
address the issue. It improves perf and fixes issue5360 by correctly reusing
hist, while maintaining low memory usage. Some additional attempt has been
made to further reduce memory usage, like changing "pcache[f] = []" to "del
pcache[f]". Therefore the result can be both faster and lower memory usage:

  # with this patch applied
  MEMORY   47575040
  CPUTIME  7.870
  REALTIME 7.926

[1]: lrun is a lightweight sandbox built on Linux cgroup and namespace. It's
     used to measure CPU and memory usage here. Source code is available at
     github.com/quark-zju/lrun.
2016-09-02 15:20:59 +01:00
Kevin Bullock
5101bf4c23 Added signature for changeset 8ac1b6da0c44 2016-09-01 14:01:43 -05:00
Akihiko Odaki
82bf519632 bundle2: localize handleoutput remote prompts
Code archaeology suggests that there was no good reason for this not to
be localized. 'remote: ' is already localized elsewhere.
2016-09-01 13:16:55 -05:00
Wagner Bruna
511ad6839c i18n-pt_BR: synchronized with 9c29cf2af0ce 2016-08-31 13:58:33 -03:00
Gregory Szorc
c48909f844 bundle2: fail faster when interrupted
Before this patch, bundle2 application attempted to consume remaining
bundle2 part data when the process is interrupted (SIGINT) or when
sys.exit is called (translated into a SystemExit exception). This
meant that if one of these occurred when applying a say 1 GB
changegroup bundle2 part being downloaded over a network, it may take
Mercurial *several minutes* to terminate after a SIGINT because the
process is waiting on the network to stream megabytes of data. This is
not a great user experience and a regression from bundle1. Furthermore,
many process supervisors tend to only give processes a finite amount of
time to exit after delivering SIGINT: if processes take too long to
self-terminate, a SIGKILL is issued and Mercurial has no opportunity to
clean up. This would mean orphaned locks and transactions. Not good.

This patch changes the bundle2 application behavior to fail faster
when an interrupt or system exit is requested. It does so by not
catching BaseException (which includes KeyboardInterrupt and
SystemExit) and by explicitly checking for these conditions in
yet another handler which would also seek to the end of the current
bundle2 part on failure.

The end result of this patch is that SIGINT is now reacted to
significantly faster: the active transaction is rolled back
immediately without waiting for incoming bundle2 data to be consumed.
This restores the pre-bundle2 behavior and makes Mercurial treat
signals with the urgency they deserve.
2016-08-25 19:53:14 -07:00
Yuya Nishihara
320973b5ef revset: fix keyword arguments to go through optimization process
Before, a keyvalue node was processed by the last catch-all condition of
_optimize(). Therefore, topo.firstbranch=expr would bypass tree rewriting
and would crash if an expr wasn't trivial.
2016-08-07 14:58:49 +09:00
Mathias De Maré
e736d31e70 help: add example of '[templates]' usage
V2:
- move from shortest() with minlength 8 to minlength 4
- mention [templates] in config.txt
- better describe the difference between [templatealias] and [templates]

V3:
- choose a better example template
2016-08-08 16:47:42 +02:00
Augie Fackler
97b8f423b9 exchange: correctly specify url to unbundle (issue5145)
This parameter is slightly confusingly named in wireproto, so it got
mis-specified from the start as 'push' instead of the URL to which we
are pushing. Sigh. I've got a patch for that which I'll mail
separately since it's not really appropriate for stable.

Fixes a regression in bundle2 from bundle1.
2016-08-05 16:25:15 -04:00
Durham Goode
769d2595c4 convert: move svn config initializer out of the module level
The svn_config_get_config config call was being called at the module level, but
had the potential to throw permission denied errors if ~/.subversion/servers was
not readable. This could happen in certain test environments where the user
permissions were very particular.

This prevented the remotenames extension from loading, since it imports
convert's hg module, which imports convert's subversion module, which calls
this. The config is only ever used from this one constructor, so let's just move
it in to there.
2016-08-01 17:38:01 -07:00
Anton Shestakov
f42d0025b8 osx: update bugzilla link in readme 2016-08-04 19:53:46 +08:00
Anton Shestakov
7f3760e482 win32: update link to mailing list in readme 2016-08-04 19:50:25 +08:00
Anton Shestakov
c30efef3cd win32: update wiki link in mercurial.ini 2016-08-04 19:50:06 +08:00
Anton Shestakov
2ffd028d67 debian: update source URL in copyright file 2016-08-04 19:49:07 +08:00
Anton Shestakov
9573c5450e help: update link to wiki/CommandServer 2016-08-04 10:42:03 +08: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
Hannes Oldenburg
d5c4fdb0dc cmdutil: warnings not issued in remove if subrepopath overlaps
Previously a subrepository "sub" would cause no warnings to be issued
for a file "subnot/a" if it is not removed when calling:

hg remove -S "subnot/a"
2016-07-22 11:29:42 +00:00
Matt Mackall
41b11bbbcf merge with i18n 2016-07-20 14:12:45 -05:00