Commit Graph

28223 Commits

Author SHA1 Message Date
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
timeless
d54666f50a setup: create a module for the modulepolicy
Instead of rewriting __init__ to define the modulepolicy,
write out a __modulepolicy__.py file like __version__.py

This should work for both system-wide installation and in-place build. Therefore
we can avoid relying on two separate modulepolicy rules, '@MODULELOADPOLICY@'
and 'mercurial/modulepolicy'.
2016-03-09 15:47:01 +00:00
Kostia Balytskyi
69abdd68e4 rebase: turn rebaseskipobsolete on by default
Consider the following use case. User has a set of commits he wants to rebase
onto some destination. Some of the commits in the set are already rebased
and their new versions are now among the ancestors of destination. Traditional
rebase behavior would make the rebase and effectively try to apply older
versions of these commits on top of newer versions, like this:

    a` --> b --> a`

(where both 'a`' and 'a``' are rebased versions of 'a')

This is not desired since 'b' might have made changes to 'a`' which can now
result in merge conflicts. We can avoid these merge conflicts since we know
that 'a``' is an older version of 'a`', so we don't even need to put it on top
of 'b'. Rebaseskipobsolete allows us to do exactly that.

Another undesired effect of a pure rebase is that now 'a`' and 'a``' are both
successors to 'a' which is a divergence. We don't want that and not rebasing
'a' the second time allows to avoid it.

This was not enabled by default initially because we wanted to have some more
experience with it. After months of painless usages in multiple places, we are
confident enough to turn it on my default.
2016-03-09 08:08:27 -08:00
Yuya Nishihara
3e3e4eca75 graphlog: bring back color to node symbol template
Follows up 64cf8f39aac2. A ui object is required to render labels.
2016-03-09 23:57:15 +09:00
Yuya Nishihara
0703170780 revset: add inspection data to max() and min() functions
We are likely to be interested in how these functions build a result set.
2016-02-16 21:44:13 +09:00
Yuya Nishihara
80f2bcf6b5 revset: add inspection data to limit() and last() functions
We are likely to be interested in how these functions calculate a result set.
2016-02-16 21:43:51 +09:00
Yuya Nishihara
654d7bc89a revset: stub to add extra data to baseset for better inspection
We sometimes construct a baseset from filtering result. In that case, a
baseset can provide more precise information how it is constructed.
2016-02-16 21:32:00 +09:00
Yuya Nishihara
5ec1f7ff3f revset: add inspection data to all filter() calls
This is useful for debugging revset construction.
2016-02-13 20:05:57 +09:00
Yuya Nishihara
587a07dd40 revset: add extra data to filteredset for better inspection
A filteredset is heavily used, but it cannot provide a printable information
how given set is filtered because a condition is an arbitrary callable object.

This patch adds an optional "condrepr" object that is used only by repr(). To
minimize the maintaining/runtime overhead of "condrepr", its type is overloaded
as follows:

  type      example
  --------  ---------------------------------
  tuple     ('<not %r>', other)
  str       '<branch closed>'
  callable  lambda: '<branch %r>' % sorted(b)
  object    other
2016-02-13 19:25:11 +09:00
timeless
7846832020 zeroconf: replace reduce+add with itertools.chain 2016-03-01 10:18:47 +00:00
timeless
a2c7933e41 zeroconf: replace has_key with in 2016-03-01 10:22:10 +00:00
timeless
a36c36a4d9 zeroconf: compare singleton using is 2016-03-01 09:59:58 +00:00
timeless
9c4fb14309 zeroconf: remove camelcase in identifiers 2016-03-01 09:57:45 +00:00
timeless
8236c6ab8f setup: switch to with open as
We're leaving the modulepolicy bit alone, because it's being
rewritten in the next commit.
2016-03-09 15:35:57 +00:00
timeless
2194aed867 win32mbcs: use absolute_import 2016-03-02 21:50:35 +00:00
timeless
78f32a823b notify: use absolute_import 2016-03-02 21:48:08 +00:00
timeless
3d3cc1c01c patchbomb: use absolute_import 2016-03-02 21:42:42 +00:00
timeless
0d9e787fe4 convert: __init__ use absolute_import 2016-03-02 16:34:43 +00:00
timeless
798be7b824 convert: cvs use absolute_import 2016-03-02 16:41:35 +00:00
timeless
2ac9193926 convert: transport use absolute_import 2016-03-02 16:37:50 +00:00
timeless
4bcfa639ac convert: bzr use absolute_import 2016-03-02 16:32:52 +00:00
timeless
d982b75f31 convert: common use absolute_import 2016-03-02 16:26:35 +00:00
timeless
d9aed31d36 convert: convcmd use absolute_import 2016-03-02 16:23:28 +00:00
timeless
d35bed319b convert: subversion use absolute_import 2016-03-02 16:13:05 +00:00
timeless
57b0b61ecb blackbox: guard against recursion from dirty check 2016-03-08 20:34:59 +00:00
timeless
189e3f9aca tests: divorce blackbox test from test-dispatch.py
I used test-dispatch.py to demonstrate what would happen if
a log file changed from being readonly to writable, by
having it replace a directory (proxy for readonly/not-writable)
with a log file in between transactions of a running python
process (proxy for Mercurial).

This commit makes it easier for people to follow what the test
is doing, by creating a real file that people can read.
2016-03-08 20:52:57 +00:00
timeless
8a88474c92 tests: test-dispatch use print_function 2016-03-08 20:57:40 +00:00
timeless
e113808b95 tests: test-dispatch use absolute_import 2016-03-08 20:57:15 +00:00
timeless
4ff3d8a36b templater: ignore orig/rej files
If your mercurial/templates/ directory is dirty, then the template system would
otherwise import duplicate templates from the .orig files and potentially try to
parse .rej files.

Since editing/reverting these templates isn't an unexpected action, and since
they're in .hgignore, it's best that the template system know to skip them."
2016-03-02 05:27:07 +00:00
timeless
1fcd9b7563 resolve: when pats do not match, hint about path:
Suggest a command that would probably work.
2015-12-24 04:31:34 +00:00
liscju
5a50693a7e shelve: changes getting opts values by get method
When shelve is used by another extension that doesn't
provide all necessary values in opts shelve raises
KeyError exception. This patch fixes this by getting
values from opts dictionary with get method.
2016-03-09 08:21:57 +01:00
Gregory Szorc
443b14a872 contrib: remove references to 2to3
The custom porting fixers are removed. A comment related to 2to3
has been removed from the import checker.

After this patch, no references to 2to3 remain.
2016-02-27 21:15:16 -08:00
Gregory Szorc
3e662313cc check-code: remove redundant import style check
We have a dedicated tool that checks for import conventions. Remove
a redundant and less powerful check.
2016-02-27 21:14:17 -08:00
Gregory Szorc
0a19894b15 setup: remove support for 2to3
We want to run unaltered source on multiple Python versions. We
won't be using 2to3 for Python 3 support.
2016-02-27 21:11:24 -08:00
Gregory Szorc
426b834415 run-tests: remove 2to3 support
Our goal is to have 1 code base that works on 2.6, 2.7, and 3.5+.
2to3 won't be used. Stop passing it to setup.py.
2016-02-27 21:08:37 -08:00