Commit Graph

22967 Commits

Author SHA1 Message Date
Matt Harbison
6daa20236a tests: introduce a subrepository to test-archive.t
This will be used in an upcoming patch to add coverage for web.archivesubrepos.
2014-11-05 20:31:58 -05:00
Gregory Szorc
04eeb85285 changegroup: sparsely populate fnodes
Previously, fnodes had a key and empty dict value for every element in
changedfiles. This is somewhat wasteful. Empty dicts in CPython consume
a lot more memory than you would expect - 280 bytes.

On mozilla-central, which has ~190,000 files/fnodes keys, the previous
loop populating fnodes allocated 91,924 KB of memory, most of that for
the empty dicts.

With this patch in place, our peak RSS during mozilla-central clone
drops:

before:  364,356 KB
after:   326,008 KB
delta:   -38,348 KB

When combined with the previous patch, total peak RSS decrease is now
190,116 KB.
2014-11-06 22:48:20 -08:00
Gregory Szorc
c6e3c6fb27 changegroup: don't store unused value on fnodes (issue4443)
The contents of fnodes are only accessed once per key. It is wasteful to
cache the value since nobody will use it.

Before this patch, the caching of unused data in fnodes was effectively
causing a memory leak during the file streaming part of bundle creation.

On mozilla-central (which has ~190,000 entries in fnodes), this patch
has a significant impact on RSS at the end of generate():

before:  516,124 KB
after:   364,356 KB
delta:  -151,768 KB

The origin of this code can be traced back to 1f567a607f1f and has been
with us since the 2.7 release.
2014-11-06 22:33:48 -08:00
Gregory Szorc
0bfb4de7ec changegroup: don't define lookupmf() until it is needed
lookupmf() is currently defined earlier than when it is needed. Future
patches further refactoring this code will be easier to read when
lookupmf() is in its new home.
2014-11-06 20:57:12 -08:00
Pierre-Yves David
4919d2a337 mail: actually use the verifycert config value
The mail module only verifies the smtp ssl certificate if 'verifycert' is enabled
(the default). The 'verifycert' can take three possible values:

- 'strict'
- 'loose'
- any "False" value, eg: 'false' or '0'

We tested the validity of the third value, but never converted it to actual
falseness, making 'False' an equivalent for 'loose'.

This changeset fixes it.
2014-11-05 18:31:39 +00:00
Thomas Arendsen Hein
64014abd9c convert: use git diff-tree -Cn% instead of --find-copies=n% for older git
The option --find-copies was added in a later git version than the one included
in Debian squeeze-lts (1.7.2.5), probably around 1.7.4.
2014-11-06 09:36:39 +01:00
Pierre-Yves David
9984e5c699 bookmarks: fix formatting of exchange message (issue4439)
The message formatting was crashing when doing explicit pulling `hg pull -B X`.
This changeset fix it and improved the test coverage.
2014-11-05 17:25:00 +00:00
Mads Kiilerich
c5488ba34c discovery: indices between sample and yesno must match (issue4438)
2ec3e28dea6b changed 'sample' from a list to a set. The iteration order is thus
undefined and the yesno indices are not stable.

To solve this, repeat the listification and comment from elsewhere in the code.

Note: the randomness in the discovery protocol can make this problem hard to
reproduce.
2014-11-05 13:05:32 +01:00
Mads Kiilerich
8079358ce3 discovery: limit 'all local heads known remotely' to real 'all' (issue4438)
2ec3e28dea6b made it possible that the initial head check didn't include all
heads. If that is the case, don't use the early exit just because this random
sample happened to be 'all known'.

Note: the randomness in the discovery protocol can make this problem hard to
reproduce.
2014-11-05 13:05:29 +01:00
Matt Harbison
298c02c65a templater: don't overwrite the keyword mapping in runsymbol() (issue4362)
This keyword remapping was introduced in 236440938a03 as part of converting
generator based iterators into list based iterators, mentioning "undesired
behavior in template" when a generator is exhausted, but doesn't say what and
introduces no tests.

The problem with the remapping was that it corrupted the output for keywords
like 'extras', 'file_copies' and 'file_copies_switch' in templates such as:

    $ hg log -r 82a4f5557c6b --template "{file_copies % ' File: {file_copy}\n'}"
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)
    File: mercurial/changelog.py (mercurial/hg.py)

What was happening was that in the first call to runtemplate() inside runmap(),
'lm' mapped the keyword (e.g. file_copies) to the appropriate showxxx() method.
On each subsequent call to runtemplate() in that loop however, the keyword was
mapped to a list of the first item's pieces, e.g.:

   'file_copy': ['mercurial/changelog.py', ' (', 'mercurial/hg.py', ')']

Therefore, the dict for the second and any subsequent items were not processed
through the corresponding showxxx() method, and the first item's data was
reused.

The 'extras' keyword regressed in 56b014c52204, and 'file_copies' regressed in
4e182fb53989 for other reasons.  The common thread of things fixed by this seems
to be when a list of dicts are passed to the templatekw._hybrid class.
2014-11-03 12:08:03 -05:00
Michael Fyles
001d1e7cb7 extdiff: quote user-supplied options passed to shell
$ hg extdiff -p cmd -o "name <user@example.com>"
resulted in a shell redirection error (due to the less-than sign),
rather than passing the single option to cmd. This was due to options
not being quoted for passing to the shell, via util.system(). Apply
util.shellquote() to each of the user-specified options (-o) to the
comparison program before they are concatenated and passed to
util.system(). The requested external diff command (-p) and the
files/directories being compared are already quoted correctly.

The discussion at the time of changeset 6654fcb57d92 correctly noted
that this course of action breaks whitespace-separated options specified
for external diff commands in the configuration. The lower part of the
patch corrects this by lexing options read from the configuration file
into separate options rather than reading them all into the first
option.

Update test to cover these conditions.

Related changesets (reverse-chronological):
- 6654fcb57d92 (fix reverted to make configuration file options work)
- c64ec6e8ffa2 (issue fixed but without fix for configuration file)
2012-07-26 11:38:13 +01:00
Yuya Nishihara
9db6205062 serve: correct meta variable of --daemon-pipefds option
It was changed to lock path at 670de588e29e.
2014-11-02 13:20:07 +09:00
Matt Mackall
dfc8c7a032 Added signature for changeset e5270c957a24 2014-11-01 22:48:49 -05:00
Pierre-Yves David
1b8f2c7e41 setdiscovery: limit the size of all sample (issue4411)
Further digging on this issue show that the limit on the sample size used in
discovery never works for heads. Here is a quote from the code itself:

  desiredlen = size - len(always)
  if desiredlen <= 0:
      # This could be bad if there are very many heads, all unknown to the
      # server. We're counting on long request support here.

The long request support never landed and evolution make the "very many heads,
all unknown to the server" case quite common.

We implement a simple and stupid hard limit of sample size for all query. This
should prevent HTTP 414 error with the current state of the code.
2014-11-01 23:52:53 +00:00
Pierre-Yves David
fddc78071a hook: protect commit hooks against stripping of temporary commit (issue4422)
History rewriting commands like histedit tend to use temporary
commits. They may schedule hook execution on these temporary commits
for after the lock has been released. But temporary commits are likely
to have been stripped before the lock is released (and the hook run).
Hook executed for missing revisions leads to various crashes.

We disable hooks execution for revision missing in the repo. This
provides a dirty but simple fix to user issues.
2014-11-01 23:17:50 +00:00
Pierre-Yves David
4c446d7e00 mq: do not call [0] on revset
The __getitem__ method have been removed. The "first" method is to be used
instead. Test have been extended to test this code path.
2014-11-01 22:59:37 +00:00
Pierre-Yves David
2463533597 addset: fix first and last on sorted addset (issue4426)
The lazy sorting were not enforced on addset. This was made visible through MQ.
2014-11-01 22:58:30 +00:00
Matt Mackall
738a03c0f6 clone: properly mark branches closed with --uncompressed (issue4428)
On streaming clone, we were priming the local branch cache with the
remote branchmap, without checking which heads were closed.

This fixes an issue introduced in:

 changeset:   17740:f8d7aaf86507
 user:        Tomasz Kleczek <tomasz.kleczek@fb.com>
 date:        Wed Oct 03 13:19:53 2012 -0700
 summary:     branchcache: fetch source branchcache during clone (issue3378)

that was exposed in 2.9 by:

 changeset:   20192:6c385e85aa05
 user:        Brodie Rao <brodie@sf.io>
 date:        Mon Sep 16 01:08:29 2013 -0700
 summary:     branches: simplify with repo.branchmap().iterbranches()
2014-11-01 17:30:57 -05:00
Mads Kiilerich
f8bf9f40a4 Makefile: update .PHONY
Based on
sed -n 's/^\([a-z0-9-]*\):\(\s.*\)\?$/\1/gp' Makefile | xargs echo
add check, check-code, update-pot, some packaging targets
2014-11-01 20:00:31 +01:00
Mads Kiilerich
e41b8f78e4 buildrpm: fix use of invalid $PLATFORM in mercurial.repo 2014-11-01 20:00:00 +01:00
Matt Mackall
19a76cd0ae debuglocks: add missing usage summary 2014-11-01 13:13:04 -05:00
Mads Kiilerich
a42a10599a help: don't crash on help for 'sections' with multiple '.' 2014-11-01 19:02:31 +01:00
Mads Kiilerich
ddd482eeb0 help: fix config description of ui.reportoldssl 2014-11-01 18:28:54 +01:00
FUJIWARA Katsunori
7568a9762d i18n-ja: synchronized with e47ebaad2ffc 2014-11-01 18:03:17 +09:00
Wagner Bruna
45eb8f69e8 i18n-pt_BR: synchronized with 237838ba8a0e 2014-10-31 22:30:39 -02:00
Wagner Bruna
472b8b7c43 merge with i18n 2014-10-31 22:22:41 -02:00
Durham Goode
a9c8623638 clone: fix copying bookmarks in uncompressed clones (issue4430)
8a92e6790099 broke bookmarks getting copied during uncompressed clones. Since
most of the pull logic has been moved into exchange.py, lets just call
exchange.pull to fix up the repo with the latest bits after the streaming clone
has bootstrapped the repo. This keeps us from having to duplicate the bookmark
logic.
2014-10-31 12:56:25 -07:00
Martin von Zweigbergk
ef6448aa8b revset: don't recreate matcher for every revision
The matcher variable 'm' in checkstatus() is reset to None on each
call, so the caching of the matcher no longer happens as it was
intended. This seems to be a regression in 6b9fbae54476 (revset: added
lazyset implementation to checkstatus, 2014-01-03).

Fix by moving the cached matcher into the enclosing function so it's
actually cached across calls. This speeds up

  hg log -r 'modifies(mercurial/context.py)' >/dev/null

from 7.5s to 4s.

Also see similar fix in 5ff5c5c9e69f (revset: avoid recalculating
filesets, 2014-10-22).
2014-10-31 10:41:36 -07:00
FUJIWARA Katsunori
65a438a0c5 help: use ":hg:command" instead of incorrect ":hg:'command'" notation 2014-11-01 02:43:08 +09:00
FUJIWARA Katsunori
13d9d50897 i18n: add i18n comment to error messages of filesets predicates 2014-11-01 02:43:08 +09:00
FUJIWARA Katsunori
3bf105df13 i18n: add i18n comment to error messages of template functions 2014-11-01 02:43:08 +09:00
FUJIWARA Katsunori
45bd2bfacb help: refer ":merge3" instead of "internal:merge3"
According to warning message (introduced by 727c196b0843) in
filemerge.py, the former should be used as official name.
2014-11-01 02:43:08 +09:00
FUJIWARA Katsunori
bf44489048 i18n: make hint message of exception translatable 2014-11-01 02:43:08 +09:00
FUJIWARA Katsunori
18a0e8a463 help: use "hg files" instead of "hg locate" in "hg help filesets"
The latter command is already deprecated.
2014-11-01 02:43:08 +09:00
FUJIWARA Katsunori
42fbbbc7eb files: refer "hg help filesets" instead of "hg help revsets" in help text
"specifying FILE patterns" should refer the former.
2014-11-01 02:41:18 +09:00
FUJIWARA Katsunori
659bd4d145 i18n-ja: synchronized with 736cb15b8fb9 2014-11-01 01:03:11 +09:00
Matt Mackall
66c843c0a1 tests: silence output race in test-run-tests.t 2014-10-30 17:52:01 -05:00
Matt Mackall
4779d0cacb merge with i18n 2014-10-30 16:57:28 -05:00
Wagner Bruna
9c62163a53 i18n-pt_BR: synchronized with 5ee35e3c2f35 2014-10-27 20:38:17 -02:00
Wagner Bruna
9eb76d45d6 i18n-pt_BR: synchronized with ed876f44a269 2014-10-23 18:17:00 -02:00
Yuya Nishihara
740a18d819 revset: avoid O(n) lookup of invalid revision in rev()
0cc5c10d5dc7 was not the final version of that patch.  It was really slow
because `l not in repo.changelog` iterates revisions up to `l`.  Instead,
rev() should utilize spanset.__contains__().

revset #0: rev(210000)
0) wall 0.000039 comb 0.000000 user 0.000000 sys 0.000000 (best of 67978)
1) wall 0.002721 comb 0.000000 user 0.000000 sys 0.000000 (best of 1055)
2) wall 0.000059 comb 0.000000 user 0.000000 sys 0.000000 (best of 45599)
(0: 3.2-rc, 1: 0cc5c10d5dc7, 2: this patch)

Note that the benchmark result described in 0cc5c10d5dc7 is wrong because
it is the one of the initial version.
2014-10-23 21:53:37 +09:00
Matt Mackall
78b956ae0c run-tests: output diffs with only forward slashes
This removes some gratuitous variance when testing on Windows with
test-run-tests.t.
2014-10-23 13:44:34 -05:00
Wagner Bruna
779ceca4ff i18n: add hint to digest mismatch message 2014-10-23 12:35:10 -02:00
Wagner Bruna
6791cdb7aa help/config: fix typo 2014-10-23 12:28:00 -02:00
Wagner Bruna
8b3ed4dd05 files: fix example list syntax 2014-10-23 12:27:57 -02:00
Mads Kiilerich
20e288b0f3 parsers: use 'k' format for Py_BuildValue instead of 'n' because Python 2.4
'n' was introduced in Mercurial in 5d1adb6683fa and broke Python 2.4 support in
mysterious ways that only showed failure in test-glog.t. Py_BuildValue failed
because of the unknown format and a TypeError was thrown ... but it never
showed up on the Python side and it happily continued processing with wrong
data.

Quoting https://docs.python.org/2/c-api/arg.html :

  n (integer) [Py_ssize_t]
    Convert a Python integer or long integer to a C Py_ssize_t.
    New in version 2.5.

  k (integer) [unsigned long]
    Convert a Python integer or long integer to a C unsigned long without
    overflow checking.

This will use unsigned long instead of Py_ssize_t. That is not a good solution,
but good is not an option when we have to support Python 2.4.
2014-10-23 02:42:57 +02:00
Durham Goode
aea70fa3a4 rebase: improve base revset performance
The old revset had pretty terrible performance on large repositories (12+
seconds). This new revset achieves the same result in only 0.7s. As we improve
the underlying revset APIs we can probably get this revset down to 'only(base,
dest)::', but at the moment that version still takes 2s.
2014-10-20 18:50:09 -07:00
Pierre-Yves David
34fb3a3cdd transaction: only generate file when we actually close the transaction
Before this change, the file were written for every call to `tr.close()`
exposing data to reader far too early.
2014-10-17 21:25:48 -07:00
Ryan McElroy
365c7718eb amend: fix amending rename commit with diverged topologies (issue4405)
This addresses the bug described in issue4405: when obsolescence markers are
enabled, amending a commit with a file move can lead to the copy information
being lost.

However, the bug is more general and can be reproduced without obsmarkers as
well, as demonstracted by Pierre-Yves and put into the updated test.
Specifically, graph topology divergences between the filelogs and the changelog
can cause copy information to be lost during amends.
2014-10-16 06:35:06 -07:00
Augie Fackler
0e58e63b9c hgweb: disable SSLv3 serving (BC)
Because of recent attacks[0] on SSLv3, let's just drop support entirely.

0: http://googleonlinesecurity.blogspot.com/2014/10/this-poodle-bites-exploiting-ssl-30.html
2014-10-21 17:09:37 -04:00