Commit Graph

28085 Commits

Author SHA1 Message Date
Gregory Szorc
ab7f7f6a19 changelog: lazy decode user (API)
This appears to show a similar speedup as the previous patch.
2016-02-27 22:34:18 -08:00
Gregory Szorc
6f651cb96b changelog: lazy decode description (API)
Currently, changelog reading decodes read values. This is wasteful
because a lot of times consumers aren't interested in some of these
values.

This patch changes description decoding to occur in changectx as
needed.

revsets reading changelog entries appear to speed up slightly:

revset #7: author(lmoscovicz)
   plain
0) 0.906329
1) 0.872653

revset #8: author(mpm)
   plain
0) 0.903478
1) 0.878037

revset #9: author(lmoscovicz) or author(mpm)
   plain
0) 1.817855
1) 1.778680

revset #10: author(mpm) or author(lmoscovicz)
   plain
0) 1.837052
1) 1.764568
2016-02-27 22:25:14 -08:00
timeless
6944befadd blackbox: optionally log event source 2016-02-11 19:38:26 +00:00
timeless
3046e843ec blackbox: remove hexfn
It was introduced as copy+paste code, but was never necessary.
2016-03-01 10:45:47 +00:00
timeless
8ffb77cabf blackbox: rewrite dirty documentation noting it is expensive 2016-03-01 10:43:52 +00:00
timeless
bc17264706 zeroconf: remove whitespace around = for named parameters 2016-03-01 09:49:38 +00:00
timeless
dc63708974 zeroconf: del is not a function 2016-03-01 09:44:32 +00:00
timeless
d663c817be zeroconf: add whitespace around operator 2016-03-01 09:48:11 +00:00
timeless
b24249e75c zeroconf: wrap long lines 2016-03-01 09:33:39 +00:00
timeless
c72c0f2737 zeroconf: drop tabs 2016-03-01 08:53:40 +00:00
timeless
d76d9e277e zeroconf: omit semicolons 2016-03-01 08:48:10 +00:00
timeless
c202bff77a zeroconf: use absolute_import 2016-03-01 08:42:46 +00:00
timeless
1f9922ecf6 zeroconf: use print function 2016-03-01 07:17:32 +00:00
liscju
7a22f98665 histedit: improve error when run on nodes with children (issue5056) 2016-02-29 15:12:26 +01:00
timeless
0c436e0682 tests: minor grammar change for check-commit 2016-03-01 11:51:46 +00:00
Gregory Szorc
bfe71a12f3 worker: document poor partitioning scheme impact
mpm isn't a fan of the existing or previous partitioning scheme. He
provided a fantastic justification for why on the mailing list.

This patch adds his words to the code so they aren't forgotten.
2016-02-27 21:43:17 -08:00
Matt Mackall
c0ab1b7cbf merge with stable 2016-02-29 17:52:17 -06:00
Matt Mackall
9661ec8b8c merge with i18n 2016-02-29 17:44:00 -06:00
FUJIWARA Katsunori
27b5df55d8 i18n-ja: synchronized with 03346da08322 2016-02-29 22:52:29 +09:00
Gregory Szorc
9068a821f3 run-tests: fix Python 3 incompatibilities
At one point run-tests.py and test-run-tests.t worked and passed
under Python 3.5. Various changes to run-tests.py over the past
several months appear to have broken Python 3.5 compatibility.

This patch implements various fixes (all related to str/bytes type
coercion) to make run-tests.py and test-run-tests.t mostly work
again. There are still a few failures in test-run-tests.t due to
issues importing mercurial.* modules. But at least run-tests.py
seems to work under 3.5 again.
2016-02-27 21:29:42 -08:00
Gregory Szorc
cf440c3122 hghave: use print function
For Python 3 compatibility.
2016-02-27 21:19:53 -08:00
Gregory Szorc
c5114195d9 changelog: remove redundant parentheses
You don't need to surround returned tuples with parens.
2016-02-27 22:25:47 -08:00
Gregory Szorc
3774b02abb changegroup: use changelog.readfiles
We have a dedicated function to get just the list of files in
a changelog entry. Use it.

This will presumably speed up changegroup application since we're
no longer decoding the entire changelog entry. But I didn't measure
the impact.
2016-02-27 23:06:05 -08:00
Pierre-Yves David
0f9abc9deb rebase: remove experimental option from 'rebase' config section
Changeset 9a4b77db854b introduced a guard against case where obsolete changesets
are included in the rebase in a way this will result in divergence (because
rebase create new successors for changeset which already have successors). In
the same go a 'rebase.allowdivergence' option was introduced to control that
behavior.

We rename this config option to 'experimental.allowdivergence' for multiple
reasons:

* First this behavior is attached to changeset evolution, a feature still
 experimental.

* Second, there was no 'rebase' section in config before we introduced this
  option. I would like to avoid proliferation of micro config section and
  therefore would like to avoid the creation of this new section just for an
  experimental feature.

* Third, this guard (warning the user about a history rewriting operation that
  will create divergence) will very likely be generalised to all history
  rewriting operations, making this not rebase specific.

* Finally, because this will likely be a general guard present a bit everywhere
  in the UI we'll likely end up with something better than a config option to
  control this behavior, so having the current config option living in
  experimental will allow us make it disappear in the future.

So we banish this config option back to the experimental section where it
belongs, killing the newly born 'rebase' config section in the process.
2016-02-27 18:02:12 +01:00
David R. MacIver
0db622903d testing: allow Hypothesis tests to disable extensions
Doing this required the introduction of a mechanism for keeping
track of more general config in the test. At present this is only
used for extensions but it could be used more widely (e.g. to
control specific extension behaviour)

This greatly simplifies the extension management logic by introducing
a general notion of config, which we maintain ourselves and pass to
HG on every invocation.

This results in significantly less error prone test generation, and
also allows us to turn extensions off as well as on.

The logic that used an environment variable to rerun the tests with
an extension disabled now just edits the test file (in a fresh copy)
to remove these --config command line flags.
2016-02-26 17:15:49 +00:00
Gregory Szorc
2ef42b9dfb keepalive: remove useless parentheses around exception type 2016-02-28 00:00:13 -08:00
Jun Wu
5b7badc1c4 chgserver: add a structure for confighash and mtimehash
confighash and mtimehash are often used together. This patch adds a simple
structure called hashstate to store them. hashstate also has a handly method
called fromui to calculate the hashes from a ui object.
2016-02-24 20:45:47 +00:00
Jun Wu
06733e6248 chgserver: add utilities to calculate mtimehash
mtimehash is designed to detect file changes. These files include:
- single file extensions (__init__.py for complex extensions)
- mercurial/__version__.py
- python (sys.executable)

mtimehash only uses stat to check files so it's fast but not 100% accurate.
However it should be good enough for our use case.

For chgserver, once mtimehash changes, the server is considered outdated
immediately and should no longer provide service.
2016-02-26 14:59:39 +00:00
Pierre-Yves David
7ba8661a7b tests: rename 'test-module-import.t' into 'test-check-module-import.t'
This test is checking our source code to ensure style and correct behavior (eg:
no cycle). Current convention is that such tests starts with 'test-check-' so we
flock this on back with the others.
2016-02-27 17:31:23 +01:00
FUJIWARA Katsunori
682ffa7011 pull: deactivate a bookmark not matching with the destination of the update
Before this patch, "hg pull -u" with a target doesn't deactivate a current
active bookmark, which doesn't match with the explicit destination of the
update, even though bare "hg update" does so.

A "target" can be provided through:
  - option --rev ANOTHER
  - option --branch ANOTHER
  - source URL#ANOTHER
2016-02-26 20:22:05 +09:00
FUJIWARA Katsunori
f00c81db76 pull: activate a bookmark matching with the destination of the update (BC)
Before this patch, "hg pull -u" with a target doesn't activate a bookmark, which
matches with the explicit destination of the update, even though bare "hg
update" does so.

A "target" can be provided through:
  - option --rev BOOKMARK
  - source URL#BOOKMARK
2016-02-26 20:22:05 +09:00
Pierre-Yves David
afc2550500 revert: properly revert to ancestor of p2 during merge (issue5052)
During merge, added (from one perspective) file can be reported as "modified".
To work around that, revert was testing if modified file were present in the
parent manifest and marking them as "added" in this case. However, we should be
checking against the target revision manifest instead. Otherwise see file as
"newly added" even if they exist in the target revision.

That revert behavior regressed in 3657ae7519b7.
2016-02-23 11:41:47 +01:00
Yuya Nishihara
5b1b6151af log: fix order of revisions filtered by multiple OR options (issue5100)
This is the simplest workaround for the issue of the ordering of revset, which
is that the expression "x or y" takes over the ordering specified by the input
set (or the left-hand-side expression.) For example, the following expression

  A & (x | y)

will be evaluated as if

  (A & x) | (A & y)

That's wrong because revset has ordering. I'm going to fix this problem in
the revset module, but that wouldn't fit to stable. So, this patch just works
around the common log cases.

Since this change might have some impact on performance, it is enabled only
if the expression built from log options has ' or ' operation.
2016-02-15 22:46:07 +09:00
Gregory Szorc
038daf0c4c demandimport: add _imp to ignore list
Mozilla is seeing an issue with demand importing of _imp
failing in pkg_resources/__init__.py:fixup_namespace_packages.
It strangely only reproduces when using a modern version of
setuptools/pip in certain scenarios. Adding _imp to the demand import
ignore list seems to make the problem go away.
2016-02-25 22:35:11 -08:00
Pierre-Yves David
c93d28cfa7 unionrepo: properly handle hidden linkrev in revlog (issue5070)
The unionrepository have to do some special magic to handle linkrev of the
unioned filerev and manifestrev. That logic was done from a repoview and
obsolescence marker affecting bundled changeset could lead to a crash. We now
ensure we operate on unfiltered repository.
2016-02-22 23:36:04 +01:00
Pierre-Yves David
55efb3cd6d bundlerepo: properly handle hidden linkrev in manifestlog (issue4945)
The bundlerepository have to do some special magic to handle linkrev of the
bundled manifest. That logic was done from a repoview and obsolescence marker
affecting bundled changeset could lead to a crash. We now ensure we operate on
unfiltered repository.
2016-02-22 23:34:54 +01:00
Pierre-Yves David
7443f70cc2 bundlerepo: properly handle hidden linkrev in filelog (issue4945)
The bundlerepository have to do some special magic to handle linkrev of the
bundlerepo filerev. That logic was done from a repoview and obsolescence marker
affecting bundled changeset could lead to a crash. We now ensure we operate on
unfiltered repository.
2016-02-22 18:35:40 +01:00
Yuya Nishihara
bcd39cd70f revset: define "pat" variable unconditionally in subrepo()
It's a source of UnboundLocalError to define and use local variables
conditionally. As getstring() always returns a str, "pat" can be initialized
to None.
2016-02-13 20:13:45 +09:00
Thomas Arendsen Hein
cd14774b5e help: hg.intevation.de is new primary name of hg.intevation.de (and new cert)
Adjust the examples (prefix and hostfingerprints) in help/config.txt

https://hg.intevation.de/ is now served with a new certificate that is signed
by a commercial CA, so all nearly all browsers will accept it automatically.

Listing both names, hg.intevation.de and hg.intevation.org, in the section
[hostfingerprints] allows using both without configuring web.cacerts and
without changing existing https URLs in the [paths] section.
2016-02-01 12:36:28 +01:00
Rainer Woitok
da96edeb0a doc: correct example concerning "hg purge" alias in man page "hgrc.5"
The "hg purge" alias as currently described in "hgrc.5" only works, if
the caller's current working directory is identical to the repository's
root directory.

This patch slightly modifies the example by adding an empty pattern as a
file argument to the "hg status" command, thus forcing this command to
list the affected files relative to the current directory.
2016-02-20 17:32:26 +01:00
Matt Harbison
0fa9e4d8ca fileset: fix copy/paste in eol() error message 2016-02-18 22:32:18 -05:00
FUJIWARA Katsunori
bf3b0554e8 setup: avoid procedure related to hg.exe at setup.py --pure
Before this patch, "setup.py --pure" fails on Windows, because
hgbuildscripts.run() tries to copy "hg.exe", which doesn't generated
at "setup.py --pure".

At that time, run_command('build_hgexe') invoked in
hgbuildscripts.run() does nothing and returns successfully. Therefore,
subsequent procedure assuming existence of "hg.exe" fails.

This patch avoids procedure related to "hg.exe" (= all of
hgbuildscripts.run() except for build_scripts.run() invocation) at
"setup.py --pure".
2016-02-08 21:12:13 +09:00
Yuya Nishihara
ec5b4c4575 help: update template examples to use reST literal syntax
This should prevent processing backslashes as reST syntax elements. Before
this patch, '\' was lost in HTML and man pages.
2016-02-05 23:17:07 +09:00
Yuya Nishihara
02e214117d ui: fix crash by non-interactive prompt echo for user name
Since we've dropped a str cast at write() by 7dbd3db608c5, ui.prompt() should
convert default to '' if it is None. Otherwise, write() would fail with
"TypeError: object of type 'NoneType' has no len()".

This patch includes the tests for both interactive and non-interactive cases
because "ui.askusername" was never tested.
2016-02-06 20:43:20 +09:00
Yuya Nishihara
61b45241f5 zeroconf: forward all arguments passed to ui.configitems() wrapper
cf6cc5344afa added 'ignoresub' argument to ui.configitems(), but zeroconf
wrapper wasn't updated. It caused the following crash:

  Traceback (most recent call last):
    File "bin/hg", line 43, in <module>
      mercurial.dispatch.run()
    File "lib/python/mercurial/dispatch.py", line 54, in run
      sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
    File "lib/python/mercurial/dispatch.py", line 120, in dispatch
      ret = _runcatch(req)
    File "lib/python/mercurial/dispatch.py", line 191, in _runcatch
      return _dispatch(req)
    File "lib/python/mercurial/dispatch.py", line 924, in _dispatch
      cmdpats, cmdoptions)
    File "lib/python/mercurial/dispatch.py", line 681, in runcommand
      ret = _runcommand(ui, options, cmd, d)
    File "lib/python/mercurial/extensions.py", line 195, in closure
      return func(*(args + a), **kw)
    File "lib/python/hgext/zeroconf/__init__.py", line 180, in cleanupafterdispatch
      return orig(ui, options, cmd, cmdfunc)
    File "lib/python/mercurial/dispatch.py", line 1055, in _runcommand
      return checkargs()
    File "lib/python/mercurial/dispatch.py", line 1015, in checkargs
      return cmdfunc()
    File "lib/python/mercurial/dispatch.py", line 921, in <lambda>
      d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
    File "lib/python/mercurial/util.py", line 991, in check
      return func(*args, **kwargs)
    File "lib/python/mercurial/commands.py", line 5405, in paths
      pathitems = sorted(ui.paths.iteritems())
    File "lib/python/mercurial/util.py", line 723, in __get__
      result = self.func(obj)
    File "lib/python/mercurial/ui.py", line 619, in paths
      return paths(self)
    File "lib/python/mercurial/ui.py", line 1099, in __init__
      for name, loc in ui.configitems('paths', ignoresub=True):
    File "lib/python/mercurial/extensions.py", line 195, in closure
      return func(*(args + a), **kw)
  TypeError: configitems() got an unexpected keyword argument 'ignoresub'

We have no test coverage for zeroconf, so I've added a minimal test that
could reproduce this problem.
2016-02-10 22:53:17 +09:00
timeless
2c0eb26137 rebase: update working directory when aborting (issue5084) 2016-02-05 01:56:46 +00:00
Yuya Nishihara
6b8c99a6d3 revset: flatten chained 'list' operations (aka function args) (issue5072)
Internal _matchfiles() function can take bunch of arguments, which would
lead to a maximum recursion depth error. This patch avoids the excessive
stack use by flattening 'list' nodes beforehand.

Since getlist() no longer takes a nested 'list' nodes, _parsealiasdecl()
also needs to flatten argument list, "aliasname($1, $2, ...)".
2016-02-02 23:49:49 +09:00
André Sintzoff
7d205ba10a help: fix typo in backgroundclose documentation 2016-02-05 19:40:57 +01:00
Matt Mackall
14c6be5d46 Added signature for changeset 48d3cfe1ba91 2016-02-03 16:00:00 -06:00
Siddharth Agarwal
69360ef583 rebase: don't preserve most extra fields
This backs out changeset 5293d4f88aef.

See the previous patches for why.
2016-02-03 09:23:31 -08:00