Commit Graph

20061 Commits

Author SHA1 Message Date
Kevin Bullock
23ff9c2ce1 discovery: prefer loop to double-for list comprehension in changegroupsubset
The double-for form of list comprehensions gets particularly unreadable
when you throw in an 'if' condition. This expands the only remaining
instance of the double-for syntax in our codebase into a loop.
2013-11-24 17:33:39 -06:00
Matt Mackall
304d4bb40f merge with stable 2014-01-02 16:32:51 -06:00
Matt Mackall
ede4158d64 merge with stable 2014-01-02 15:56:30 -06:00
Matt Mackall
258b088046 Added signature for changeset 6b943a1e0510 2014-01-01 21:46:45 -06:00
Matt Mackall
bef1d17e4e merge with i18n 2014-01-01 21:46:03 -06:00
Augie Fackler
acff2f02d0 merge with stable 2014-01-01 18:28:40 -05:00
FUJIWARA Katsunori
45d24ef0b8 i18n-ja: synchronized with 9525dc6ef7d6 2013-12-30 21:30:34 +09:00
Pierre-Yves David
bab0fe5a64 obsolete: order of magnitude speedup in _computebumpedset
Reminder: a changeset is said "bumped" if it tries to obsolete a immutable
          changeset.


The previous algorithm for computing bumped changeset was:

    1) Get all public changesets
    2) Find all they successors
    3) Search for stuff that are eligible for being "bumped"
       (mutable and non obsolete)

The entry size of this algorithm is `O(len(public))` which is mostly the same as
`O(len(repo))`. Even this this approach mean fewer obsolescence marker are
traveled, this is not very scalable.

The new algorithm is:

    1) For each potential bumped changesets (non obsolete mutable)
    2) iterate over precursors
    3) if a precursors is public. changeset is bumped

We travel more obsolescence marker, but the entry size is much smaller since
the amount of potential bumped should remains mostly stable with time `O(1)`.

On some confidential gigantic repo this move bumped computation from 15.19s to
0.46s (×33 speedup…). On "smaller" repo (mercurial, cubicweb's review) no
significant gain were seen. The additional traversal of obsolescence marker is
probably probably counter balance the advantage of it.

Other optimisation could be done in the future (eg: sharing precursors cache
for divergence detection)
2013-12-23 15:29:51 -08:00
Pierre-Yves David
777603b25a obsolete: add an allprecursors method mirroring allsuccessors one.
Detection of bumped changeset should use `allprecursors(<mutable>)` instead or
`allsuccessors(<immutable>)` so we need the all precursors function to exists.
2013-12-23 13:36:13 -08:00
Pierre-Yves David
f834b74f49 perf: fix perfvolatilesets
The repoview's `filteredrevs` has been renamed to `filterrevs` at some point.
perf was never informed.
2013-12-23 16:04:51 -08:00
Pierre-Yves David
04de18abd8 obsolete: improve allsuccessors doc string
The fact original nodes are also yield is not obvious. We update the docstring
to highlight it.
2013-12-23 13:33:21 -08:00
Pierre-Yves David
9cb9a199aa obsolete: fix bad comment
We cannot afford such extra "with" they are far too pricy.
2013-12-23 13:32:03 -08:00
Christian Ebert
a9aa17b61c util: remove unused realpath (issue4063)
util.realpath was in use for only 5 days from 17bc9a6bb165
until it was backed out in e60acde24a62 because it caused
issue3077 and issue3071.
2013-12-29 13:54:04 +00:00
Augie Fackler
3dbcd046f6 import-checker: suppress check-code about any()
ast is a new enough module that this script can't work on any version
of Python without any(), so we'll just use it.
2014-01-01 17:57:48 -05:00
Augie Fackler
84d472600b import-checker: use any() and a genexp to avoid awkward for/else construction 2013-12-24 19:10:04 -05:00
Chris Jerdonek
2f40a478a8 import-checker: backout dbcb4de20d06 (issue4129)
This patch backs out dbcb4de20d06, which caused test-module-imports.t to
be skipped when the test was run using virtualenv.  Since the test now
passes when using virtualenv, the skip is no longer necessary.
2013-12-22 21:27:00 -08:00
Chris Jerdonek
9908f472a9 import-checker: make test-module-imports.t work using virtualenv (issue4129)
This patch modifies contrib/import-checker.py so that test-module-imports.t
will pass if run using virtualenv.  The patch achieves this by adding two
new prefixes to the list of allowable sys.path prefixes.  The added prefixes
are the directories of two modules in the stdlib.  The modules selected are
a minimal set that allowed the return value of list_stdlib_modules() to
match the return value without virtualenv, when run on the patch author's
machine: Mac OS X 10.8, Python 2.7.6.
2013-12-22 21:20:38 -08:00
Chris Jerdonek
4162c2e12f import-checker: refactor sys.path prefix check (issue4129)
This patch refactors the logic in contrib/import-checker.py responsible for
checking the beginnings of the paths in sys.path.  In particular, it adds a
variable that defines the set of allowed prefixes.

The primary purpose of this change is to make it easier to add more allowed
prefixes.  This will be useful in resolving issue4129, which involves making
the function list_stdlib_modules() work when run from a virtualenv.
2013-12-22 14:10:26 -08:00
Pierre-Yves David
de4bc2f6f8 filter: add a comment so that people do not forget to update subsettable
Changeset aad678a92970 moved `subsettable` from `mercurial/repoview.py` to
`mercurial/branchmap.py`. This mean that `filtertable` and `subsettable` are no
longer next to each other. So we add a comment to remind people to update both.
2013-12-24 17:44:23 -05:00
Yuya Nishihara
cb7a1dd14c fileset, revset: do not use global parser object for thread safety
parse() cannot be called at the same time because a parser object keeps its
states.  This is no problem for command-line hg client, but it would cause
strange errors in multi-threaded hgweb.

Creating parser object is not too expensive.

original:
% python -m timeit -s 'from mercurial import revset' 'revset.parse("0::tip")'
100000 loops, best of 3: 11.3 usec per loop

thread-safe:
% python -m timeit -s 'from mercurial import revset' 'revset.parse("0::tip")'
100000 loops, best of 3: 13.1 usec per loop
2013-12-21 12:44:19 +09:00
Matt Mackall
03adb7cbe4 hgweb: avoid initialization race (issue3953) 2013-12-04 13:42:28 -06:00
Matt Mackall
c4f5764d33 mpatch: rewrite pointer overflow checks 2013-12-11 18:33:42 -06:00
Matt Mackall
68554e4b42 tests: fix missing import in check-translations 2013-12-01 21:24:26 -06:00
Matt Mackall
e539bfb887 Added signature for changeset b000784e52a9 2013-12-01 20:51:15 -06:00
Matt Mackall
a7756031f0 tests: fix Mac doctest escape code garbage for check-translations 2013-12-01 20:39:11 -06:00
Wagner Bruna
1f2bdd921d i18n-pt_BR: synchronized with 5d367afa6755 2013-12-01 18:26:42 -02:00
Andrew Shadura
e4287fe436 hgk: fix tag list parser (issue4101)
As tags may have embedded spaces, and "hg tags" command doesn't escape them,
the output of the command doesn't make a well-formed list, so we can't just
iterate over it. Instead, apply a simple regexp to transform it to a list
which we actually use. Line boundary matching should be enabled.
2013-12-01 13:53:24 -06:00
Matt Mackall
c6b13a6bbd merge with i18n 2013-12-01 13:45:00 -06:00
Wagner Bruna
d61a68e7a9 i18n-pt_BR: fix wording in tag command help text 2013-11-30 21:50:40 -02:00
FUJIWARA Katsunori
4f41aff6b6 i18n-ja: synchronized with 5cdd099776c7 2013-11-28 20:10:47 +09:00
FUJIWARA Katsunori
3535aee6e1 i18n: add the tool to check Mercurial specific translation problems in *.po
Existing tool like "msgfmt --check" can check typical translation
problems (missing "%s" in msgstr, for example), but can't check
Mercurial specific ones.

For example, "msgfmt --check" can't check whether the translated
string given to "ui.promptchoice()" is correct or not, even though
problems like below cause run-time error or unexpected behavior:

  - less or more choices than msgid,
  - choices without '&', or
  - choices with '&' followed by none

This patch adds the tool to check Mercurial specific translation
problems in *.po files.
2013-11-27 22:47:32 +09:00
Santiago Pay=C3=A0 i Miralta
42d271f1db help: fix backwards bisect help example 2013-11-27 22:32:01 +01:00
Durham Goode
3357a8eb2b unshelve: add tests for unknown files
Adds a basic test for shelving/unshelving with an unknown file present.

Adds a test for unshelving on top of an existing unknown file.
2013-11-26 16:30:52 -08:00
Durham Goode
0b43211792 unshelve: don't commit unknown files during unshelve (issue4113)
Previously, unshelve would temporarily commit unknown files (via addremove) in
an attempt to allow unshelving into unknown files.  This produced unexpected
results, like the file time stamp changing and a .i file being created.

This change makes it no longer use addremove.  It ignores unknown files
completely.  If an unshelve would overwrite an unknown file, the unknown file is
moved to *.orig

The shelve continue/abort format is changed, but it just removes stuff from the
end of the file, so it can still read the old format.
2013-11-26 16:23:05 -08:00
Mads Kiilerich
f2255e8146 largefiles: don't crash on 'local renamed directory' actions
a8386b4c47b1 introduced splitstandin on all action filenames. It would however
crash on 'd' actions where the filename is None.

Fix that and add test coverage for that case.
2013-11-26 15:38:33 +01:00
Wagner Bruna
22b11e7b78 i18n-pt_BR: synchronized with 5131f2755f60 2013-11-26 11:00:49 -02:00
Martin Geisler
6907950b0d glossary: don't mention obsolete graphlog extension 2013-11-22 19:13:07 +01:00
Martin Geisler
8b1b36c645 bisect: don't mention obsolete graphlog extension in help 2013-11-22 19:12:44 +01:00
Martin Geisler
dc22476982 contrib: don't mention obsolete graphlog extension in mercurial.ini 2013-11-22 19:12:18 +01:00
Martin Geisler
477180c942 contrib: stop mentioning obsolete graphlog extension in sample.hgrc 2013-11-22 19:11:48 +01:00
Martin Geisler
422edf9e4c contrib: promote strip extension over MQ in sample.hgrc 2013-11-22 17:14:44 +01:00
Matt Mackall
ed6ec26983 help: use progress instead of mq as in 'hg help config' example 2013-11-22 17:12:43 +01:00
Chris Jerdonek
e02a62783a parse_index2: fix crash on bad argument type (issue4110)
Passing a non-string to parsers.parse_index2() causes Mercurial to crash
instead of raising a TypeError (found on Mac OS X 10.8.5, Python 2.7.6):

    import mercurial.parsers as parsers
    parsers.parse_index2(0, 0)

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0 parsers.so  0x000000010e071c59 _index_clearcaches + 73 (parsers.c:644)
    1 parsers.so  0x000000010e06f2d5 index_dealloc + 21 (parsers.c:1767)
    2 parsers.so  0x000000010e074e3b parse_index2 + 347 (parsers.c:1891)
    3 org.python.python 0x000000010dda8b17 PyEval_EvalFrameEx + 9911

This happens because when arguments of the wrong type are passed to
parsers.parse_index2(), indexType's initialization function index_init() in
parsers.c leaves the indexObject instance in a state that indexType's
destructor function index_dealloc() cannot handle.

This patch moves enough of the indexObject initialization code inside
index_init() from after the argument validation code to before it.
This way, when bad arguments are passed to index_init(), the destructor
doesn't crash and the existing code to raise a TypeError works.  This
patch also adds a test to check that a TypeError is raised.
2013-11-26 16:14:22 -08:00
Sean Farley
a66d57e510 bookmarks: consider successor changesets when moving bookmark (issue4015)
Previously, this required -f because we didn't consider obsolete changesets
(and their children ... or successors of those children, etc.). We now use
obsolete.foreground to calculate acceptable changesets when advancing the
bookmark.

Test coverage has been added.
2013-11-06 19:01:14 -06:00
Simon Heimberg
2143905ef7 util: url keeps backslash in paths
Backslashes (\) in paths were encoded to %C5 when converting from url to
string. This does not look nice for windows paths. And it introduces many
problems when running tests on windows.
2013-11-20 22:03:15 +01:00
Mads Kiilerich
666578cf0e tests: deal with new gits sending status messages to stderr
git-1.8.4.2 will send messages like
  Cloning into 'X'...
  done.
to stderr.

Mute stderr.
2013-11-16 19:55:38 -05:00
Matt Mackall
82c7f5838c subrepo: sanitize non-hg subrepos 2013-11-25 13:50:36 -06:00
Matt Mackall
d11d77ad19 shelve: fix bad argument interaction with largefiles (issue4111) 2013-11-25 13:46:46 -06:00
Siddharth Agarwal
c8404bbf4f strip: hold wlock for entire duration
Previously, we'd acquire and release the wlock several times. This meant that
other hg processes could come in and change state. Instead of that, retain the
wlock for the entire duration of the strip.
2013-11-18 08:57:19 -08:00
Mads Kiilerich
7014dca534 bisect: report "both good and bad" as such, not as "not directly related" 2013-11-10 18:51:21 +01:00