Commit Graph

28399 Commits

Author SHA1 Message Date
timeless
1e52ec82b3 transplant: switch to using nodemod for hex+short 2016-03-11 16:07:22 +00:00
timeless
4f987db82a convert: bzr use absolute_import 2016-03-02 16:32:52 +00:00
Jun Wu
b98b0254ad chgserver: include [extdiff] in confighash
extdiff's uisetup will register new commands. If we do not include it in
confighash, changes to [extdiff] will not get new commands registered.
This patch adds extdiff to confighash and makes it possible for chg to pass
test-extdiff.t.
2016-03-11 13:00:20 +00:00
Jun Wu
e46af71471 chg: silently inherit server exit code
If chgserver aborts during startup, for example, error.ParseError when parsing
a config file, chg client probably just wants to exit with a same exit code
without printing other unrelated text. This patch changes the text "cmdserver
exited with status" from abortmsg to debugmsg and exits with a same exit code.
2016-03-11 02:52:06 +00:00
Pulkit Goyal
6eac74ace4 debugshell: use absolute_import 2016-03-06 03:19:08 +05:30
Yuya Nishihara
ef5269e2e1 test: make check-py3-compat.py ignore empty code more reliably
It couldn't exclude an empty file containing comments. That's why
hgext/__init__.py had been listed in test-check-py3-compat.t before
"hgext: officially turn 'hgext' into a namespace package".
2016-03-11 10:26:58 +09:00
Anton Shestakov
adaa0d801e patchbomb: specify unit for ui.progress when sending emails 2016-03-11 22:30:43 +08:00
Anton Shestakov
245ded8e7d streamclone: specify unit for ui.progress when handling data 2016-03-11 22:28:27 +08:00
Anton Shestakov
a65379c3ff churn: specify unit for ui.progress when analyzing revisions 2016-03-11 22:30:29 +08:00
Anton Shestakov
67f0dab5d3 convert: specify unit for ui.progress when scanning paths 2016-03-11 22:30:04 +08:00
Anton Shestakov
5b22fe48fb convert: specify unit for ui.progress when operating on files 2016-03-11 22:29:51 +08:00
timeless
75bebd4286 tests: stabilize svn output
With 1.9.3 extra bits were appearing...
2016-03-11 05:47:39 +00:00
Anton Shestakov
e850090773 similar: specify unit for ui.progress when operating on files 2016-03-11 22:29:20 +08:00
Anton Shestakov
edb97f0e4a verify: specify unit for ui.progress when checking files 2016-03-11 20:18:41 +08:00
Anton Shestakov
e4ad4cc290 repair: specify unit for ui.progress in rebuildfncache() 2016-03-11 20:44:40 +08:00
Anton Shestakov
9c0d085179 repair: use 'rebuilding' progress topic in rebuildfncache() 2016-03-11 20:39:29 +08:00
Anton Shestakov
f67064214c largefiles: use revisions as a ui.progress unit
Using plural form is consistent with other progress units, and "1 out of 5
revisions" sounds more correct. Also, tests don't show this, but if you have
'speed' item in progress.format config, it shows e.g. '100 revisions/sec',
which also seems better.
2016-03-11 22:26:06 +08:00
Anton Shestakov
a30859be56 largefiles: specify unit for ui.progress when operating on files
Also make it available for translation. It could already be translated, because
it's used as a unit in archival.py and subrepo.py, for example.
2016-03-11 22:21:43 +08:00
Yuya Nishihara
823c900008 templater: make label() just fail if ui object isn't available
Silent failure hides bugs and makes it harder to track down the issue. It's
worse than raising exception.

In future patches, I plan to sort out template functions that require 'ui',
'ctx', 'fctx', etc. so that incompatible functions are excluded and the doc can
say in which context these functions are usable.

  @templatefunc('label', requires=('ui',))
  def label(context, mapping, args):
      ...
2016-03-09 23:59:26 +09:00
FUJIWARA Katsunori
08147e9705 convert: fix "stdlib import follows local import" problem in transport
Before this patch, import-checker reports error below for importing
subversion python binding libraries.

    stdlib import "svn.*" follows local import: mercurial
2016-03-11 21:55:44 +09:00
FUJIWARA Katsunori
8afa478806 convert: fix relative import of stdlib module in subversion
Before this patch, import-checker reports "relative import of stdlib
module" error for importing Pool and SubversionException from svn.core
in subversion.py.

To fix this relative import of stdlib module, this patch adds prefix
'svn.core.' to Pool and SubversionException in source.

These 'svn.core.' relative accessing shouldn't cause performance
impact, because there are much more code paths accessing to
'svn.core.' relative properties.

BTW, in transport.py, this error is avoided by assignment below.

    SubversionException = svn.core.SubversionException

But this can't be used in subversion.py case, because:

  - such assignment in indented code block causes "don't use camelcase
    in identifiers" error of check-code.py

  - but it should be placed in indented block, because svn is None at
    failure of importing subversion python binding libraries (=
    examination of 'svn' is needed)
2016-03-11 21:55:44 +09:00
FUJIWARA Katsunori
b75e95ce01 convert: make subversion import transport locally
Introducing "absolute_import" feature in previous patch caused failure
of importing local module "transport".
2016-03-11 21:55:44 +09:00
Christian Ebert
131615fd5b keyword: compact writing of temporary kwdemo hgrc 2016-03-11 08:27:11 +00:00
Anton Shestakov
78963e34c6 dockerdeb: add Ubuntu Trusty
One problem reported by lintian is "bad-distribution-in-changes-file unstable"
in changelog, but the current changelog for the official package in Ubuntu also
uses that distribution name (unstable), because they import from Debian. This
certainly doesn't stop the build process.
2016-03-10 23:46:19 +08:00
Nathan Goldbaum
c0c761b27a pushoperation: fix language issues in docstring 2016-03-10 17:31:38 -06:00
Jun Wu
10d32ae3a0 chg: do not write pidfile
Current pidfile logic will only keep the pid of the newest server, which is
not very useful if we want to kill all servers, and will become outdated if
the server auto exits after being idle for too long.

Besides, the server-side pidfile writing logic runs before chgserver gets
confighash so it's not trivial to append confighash to pidfile basename like
we did for socket file.

This patch removes --pidfile from the command starting chgserver and switches
to an alternative way (unlink socket file) to stop the server.
2016-03-10 00:19:55 +00:00
Jun Wu
bac9bcbc56 chg: remove manual reload logic
chgserver now validates and reloads configs automatically. Manually reloading
is no longer necessary. Besides, we are deprecating pid files since the server
will periodically check its ownership of the socket file and exit if it does
not own the socket file any longer, which works more reliable than a pid file.
This patch removes the SIGHUP reload logic from both chg server and client.
2016-03-10 00:12:33 +00:00
Jun Wu
c1d58463c7 chg: use --daemon-postexec chdir:/ instead of --cwd /
The chgserver is designed to load repo config from current directory. "--cwd /"
will prevent chgserver from loading repo config and generate a wrong
confighash, which will result in a redirect loop. This patch removes "--cwd /"
and uses "--daemon-postexec chdir:/" instead.
2016-03-09 01:20:57 +00:00
Jun Wu
df2c932cf1 serve: add chdir command for --daemon-postexec
For chgserver, it probably needs a chdir to /. This patch adds chdir command
support for --daemon-postexec so chg client can make use of it.
2016-03-09 01:17:02 +00:00
Jun Wu
704e54e1c7 serve: accept multiple values for --daemon-postexec
The next patch will add another postexec command: chdir, which can be used
together with unlink. This patch changes the option type of --daemon-postexec
from string to list to accept multiple commands. The error message of invalid
--daemon-postexec value is also changed to include the actual invalid value.
2016-03-09 02:07:40 +00:00
Pierre-Yves David
cc59112ca7 hgext: officially turn 'hgext' into a namespace package
Actually since Python 2.3, there is some way to turn top level package into
"namespace package" so that multiple subpackage installed in different part of
the path can still be imported transparently. This feature was previously
thought (at least by myself) to be only provided by some setuptool black magic.

Turning hgext into such namespace package allows third extensions to install
themselves inside the "hgext" namespace package to avoid polluting the global
python module namespace. They will now be able to do so without making it a pain
to use a Mercurial "installed" in a different way/location than these
extensions.

The only constrains is that the extension ship a 'hgext/__init__.py' containing
the same call to 'pkgutil.extend_path' and nothing else. This seems realistic.

The main question that remains is: should we introduce a dedicated namespace for
third party extension (hgext3rd?) to make a clearer distinction between what is
officially supported and what is not? If so, this will be introduced in a follow
up patch.
2016-02-27 12:56:26 +01:00
Matt Mackall
6d2484af42 merge with stable 2016-03-11 15:24:27 -06:00
FUJIWARA Katsunori
13e7cbee4b fileset: replace predicate by filesetpredicate of registrar (API)
To make all built-in predicates be known to hggettext, loading
built-in predicates by loadpredicate() should be placed before fixing
i18nfunctions but after all of predicate decorating.
2016-03-11 04:14:54 +09:00
FUJIWARA Katsunori
f997d054b1 registrar: add filesetpredicate to mark a function as fileset predicate
filesetpredicate is used to replace fileset.predicate in subsequent
patch.

This patch also adds loadpredicate() to fileset, because this
combination helps to figure out how the name of "status caller" (or
"existing caller") predicate is put into _statuscallers (or
_existingcallers).

Listing up loadpredicate() in dispatch.extraloaders causes implicit
loading fileset predicate functions at loading (3rd party) extension.
2016-03-11 04:14:54 +09:00
FUJIWARA Katsunori
e8fc6a5935 registrar: remove useless base classes (API)
Previous patches make these classes useless by removing classes
derived from them.
2016-03-11 04:14:54 +09:00
FUJIWARA Katsunori
bd921cd006 revset: remove useless extpredicate class (API)
Previous patch makes this classes useless by replacing it with
revsetpredicate of registrar.

BTW, extpredicate itself has already been broken by that patch,
because revsetpredicate of registrar doesn't have compatibility with
original predicate (derived from funcregistrar of registrar), in fact.
2016-03-11 04:14:54 +09:00
Siddharth Agarwal
e2cd615690 hook: filter out unstable output in tests
This output is different between Python 2.6 and Python 2.7. It's also pretty
irrelevant, so just filter it out.
2016-03-10 10:12:23 -08:00
Martijn Pieters
b1494940de fsmonitor: hook up state-enter, state-leave signals
Keeping the codebase in sync with upstream:

Watchman 4.4 introduced an advanced settling feature that allows publishing
tools to notify subscribing tools of the boundaries for important filesystem
operations.

https://facebook.github.io/watchman/docs/cmd/subscribe.html#advanced-settling
has more information about how this feature works.

This diff connects a signal that we're calling `hg.update` to the mercurial
update function so that mercurial can indirectly notify tools (such as IDEs or
build machinery) when it is changing the working copy.  This will allow those
tools to pause their normal actions as the files are changing and defer them
until the end of the operation.

In addition to sending the enter/leave signals for the state, we are able to
publish useful metadata along the same channel.  In this case we are passing
the following pieces of information:

1. destination revision hash
2. An estimate of the distance between the current state and the target state
3. A success indicator.
4. Whether it is a partial update

The distance is estimate may be useful to tools that wish to change their
strategy after the update has complete.  For example, a large update may be
efficient to deal with by walking some internal state in the subscriber rather
than feeding every individual file notification through its normal (small)
delta mechanism.

We estimate the distance by comparing the repository revision number.  In some
cases we cannot come up with a number so we report 0.  This is ok; we're
offering this for informational purposes only and don't guarantee its accuracy.

The success indicator is only really meaningful when we generate the
state-leave notification; it indicates the overall success of the update.
2016-03-10 16:04:09 +00:00
liscju
24726136ad largefiles: add abstract methods in remotestore class
Methods _put, _get, _stat were used in remotestore class as
abstract expecting that subclass would implement them. This
commit makes this fact explicit.
2016-03-10 10:56:02 +01:00
Sébastien Brissaud
ab917f03d2 test-parse-date: defines explicit start/end dates for DST
Prior to this patch, DST times where tested by specifying a custom TZ
environment variable that didn't defined DST transition times.

Due to a bug in glibc, the test fail on 32bits platforms that use timezone
files generated by zic from tzcode >= 2014c (glibc >= 2.20).

See https://sourceware.org/bugzilla/show_bug.cgi?id=19738

By defining explicit transition times for DST in the TZ environment variable,
the test is now independant to how the system guess those transition times.
2016-02-14 18:18:57 +01:00
timeless
c4098a81cc debuginstall: convert to formatter
commit editor now reports its editor
default template is now reported

a broken vi editor (vi not in path) is still not considered a problem (!!)
2016-03-09 18:58:51 +00:00
Augie Fackler
f277693a68 largefiles: use iterbatch instead of batch
This actually makes the code a little cleaner to read.
2016-03-02 13:13:05 -05:00
Augie Fackler
af1601947d wireproto: make iterbatcher behave streamily over http(s)
Unfortunately, the ssh and http implementations are slightly different
due to differences in their _callstream implementations, which
prevents ssh from behaving streamily. We should probably introduce a
new batch command that can stream results over ssh at some point in
the near future.

The streamy behavior of batch over http(s) is an enormous win for
remotefilelog over http: in my testing, it's saving about 40% on file
fetches with a cold cache against a server on localhost.
2016-03-01 18:41:43 -05:00
Augie Fackler
b6dda02542 setdiscovery: use iterbatch interface instead of batch
It's a little more concise, and gives us some simple test coverage.
2016-03-01 17:44:41 -05:00
Augie Fackler
19d5a9a428 peer: add an iterbatcher interface
This is very much like ordinary batch(), but it will let me add a mode
for batch where we have pathologically large requests which are then
handled streamily. This will be a significant improvement for things
like remotefilelog, which may want to request thousands of entities at
once.
2016-03-01 18:39:25 -05:00
Augie Fackler
44da57a9e4 wireproto: document quirk of _callstream between http and ssh
This tripped me up when trying to use it, so it feels like we should
document this to avoid future pain.
2016-03-02 14:18:43 -05:00
Augie Fackler
13fce12876 peer: raise NotImplementedError for abstract submit() method
Nothing should ever call this submit method directly as it should be
overridden by concrete batcher implementations.
2016-03-01 16:37:56 -05:00
Martijn Pieters
34a3e2eb62 fsmonitor: new experimental extension
Extension to plug into a Watchman daemon, speeding up hg status calls by
relying on OS events to tell us what files have changed.

Originally developed at https://bitbucket.org/facebook/hgwatchman
2016-03-03 14:29:19 +00:00
Martijn Pieters
64a4b2e8cf fsmonitor: dependencies for new experimental extension
In preparation for the filesystem monitor extension, include the pywatchman
library. The fbmonitor extension relies on this library to communicate with
the Watchman service. The library is BSD licensed and is taken from
https://github.com/facebook/watchman/tree/master/python.

This package has not been updated to mercurial code standards.
2016-03-02 16:25:12 +00:00
timeless
b4b94546a3 setup: show how to set the module policy for imports
This is not technically needed, since mercurial.__version__
does not exist as a native module, but, without this style wrappings,
if something else had a native flavor, the module loader would get
upset.

In principle, the `env` object is trying to set HGMODULEPOLICY for
children, so, conceptually we should set it for this in-process
child.
2016-01-12 04:45:29 +00:00