Commit Graph

34421 Commits

Author SHA1 Message Date
Boris Feld
4ec25dd5f8 configitems: register the 'merge.preferancestor' config 2017-06-30 03:43:13 +02:00
Boris Feld
a27db1fe3f configitems: register the 'email.from' config 2017-06-30 03:39:10 +02:00
Boris Feld
76fddb75bd configitems: register the 'smtp.port' config 2017-06-30 03:44:24 +02:00
Boris Feld
1e6c1ea742 configitems: register the 'phases.new-commit' config 2017-06-30 03:43:48 +02:00
Boris Feld
e2c066c1d2 configitems: register the 'experimental.histeditng' config 2017-06-30 03:41:23 +02:00
Boris Feld
c5961e53a9 configitems: register the 'experimental.histedit.autoverb' config 2017-06-30 03:41:19 +02:00
Boris Feld
3511ff1228 configitems: register the 'histedit.singletransaction' config 2017-06-30 03:42:40 +02:00
Boris Feld
232028d78c configitems: register the 'histedit.linelen' config 2017-06-30 03:42:39 +02:00
Boris Feld
320e358126 configitems: register the 'histedit.dropmissing' config 2017-06-30 03:42:38 +02:00
Boris Feld
c8792151c9 configitems: register the 'histedit.defaultrev' config 2017-06-30 03:42:37 +02:00
Boris Feld
d5b4ab79b8 configitems: register the 'transplant.log' config 2017-06-30 03:44:30 +02:00
Boris Feld
4c15dbe270 configitems: register the 'transplant.filter' config 2017-06-30 03:44:29 +02:00
Augie Fackler
271f9f69f9 urllibcompat: move some adapters from pycompat to urllibcompat
These are all the httpserver and urllib.* aliases. They seem to make
more sense in the slightly-more-specific urllibcompat package than the
general-purpose pycompat.

Differential Revision: https://phab.mercurial-scm.org/D935
2017-10-04 11:58:00 -04:00
Augie Fackler
321287c10b cleanup: use urllibcompat for renamed methods on urllib request objects
Differential Revision: https://phab.mercurial-scm.org/D891
2017-10-01 12:14:21 -04:00
Augie Fackler
4337c21943 urllibcompat: new library to help abstract out some python3 urllib2 stuff
Doing a new file instead of pycompat because I'm starting to feel like
pycompat is getting a little enormous in terms of scope.

Differential Revision: https://phab.mercurial-scm.org/D890
2017-10-01 10:45:03 -04:00
Saurabh Singh
93c6f3667f test-devel-warnings: make the test compatible with chg
The test fails when run with the "--chg" option. Therefore, this
commit makes it compatible with chg.

Test Plan:
Ran the test "test-devel-warnings.t' with and without the "--chg"
option

Differential Revision: https://phab.mercurial-scm.org/D915
2017-10-04 10:42:55 -07:00
Gregory Szorc
38e83867e1 fsmonitor: use configitem
We might as well get this out of the way.

Differential Revision: https://phab.mercurial-scm.org/D893
2017-10-01 22:26:24 +01:00
Gregory Szorc
e554f0b9a9 fsmonitor: access copymap in new location
fsmonitor has been busted since 00d68e462d1d due to moving
self._copymap. Fix it.

Differential Revision: https://phab.mercurial-scm.org/D892
2017-10-01 23:47:16 +01:00
Yuya Nishihara
41fead32d1 extdata: use subprocess so we don't have to chdir() manually 2017-10-01 12:12:56 +01:00
Yuya Nishihara
ccfb5e786c extdata: just use iterator to read lines one by one 2017-10-01 11:58:27 +01:00
Yuya Nishihara
810071518d extdata: ignore ambiguous identifier as well 2017-10-01 11:56:41 +01:00
Yuya Nishihara
a5c1e61fda templater: add experimental support for extdata
This is minimal and non-controversial implementation of extdata() template
function. Originally extdata sources were exposed to the keyword namespace,
but I've changed it to a plain function for simplicity.
2017-10-01 11:13:09 +01:00
Yuya Nishihara
235c46722f revset: add experimental support for extdata
This is minimal and non-controversial implementation of extdata() revset.
Originally extdata sources were exposed to the symbol namespace, but I've
changed it to a plain function for simplicity.
2017-10-01 10:50:00 +01:00
Matt Mackall
21e38b9770 extdata: add extdatasource reader
This adds basic support for extdata, a way to add external data
sources for revsets and templates. An extdata data source is simply a
list of lines of the form:

<revision identifier>[<space><freeform text>]\n

An extdata source is configured thusly:

[extdata]
name = <a url or path>

urls of the form shell: are launch shell commands to generate data.

This patch is slightly modified by Yuya Nishihara as follows:

 - fix typo
 - remove unused function
 - remove future expansion point for parameter (which can be added later
   as the extdata revset/template are experimental)

You can see the original patch at
https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-September/088426.html
2016-09-13 14:14:05 -05:00
Denis Laxalde
ca0e3377b8 tests: change to parent directory before all "hg init" in test-log.t
Add a "cd .." before the second "hg init" so that all repositories are on top
level of test directory. Makes inspection of test directory easier.
2017-10-04 10:02:15 +02:00
Jun Wu
e296c0748d config: add a missing preparewrite() call
Thanks Yuya for pointing this out in D808.

Differential Revision: https://phab.mercurial-scm.org/D924
2017-10-03 12:00:07 -07:00
Saurabh Singh
ea7132319b test-strip: make test compatible with chg
The test was using reposetup which had the logic for stripping
commits. This leads to a situation where if the reposetup was called twice for
an extension (which can happen with chg running), the stripped node would not
be found the second time. Therefore, this commit changes the test to put the
stripping logic inside commands instead of the reposetup. This ensures that the
stripping logic is invoked only when the command is invoked and thus, avoids
any problems.

Test Plan:
Ran the test 'test-strip.t' with and without the '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D928
2017-10-03 16:59:17 -07:00
Saurabh Singh
fd92abf61e test-hook: make test compatible with chg
The test uses the 'print' method instead of writing to stdout using
'ui.write' which leads to incompatibility with chg. This commit modifies the
test to use 'ui' instead which fixes the problem.

Test Plan:
Ran the test 'test-hook.t' with and without '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D927
2017-10-03 14:35:24 -07:00
Saurabh Singh
15210308cf test-setdiscovery: make test compatible with chg
The test checks the output of the blackbox extension which will
contain logs corresponding to chg in case chg is running. Therefore, this
commit modifies the test to take chg into consideration while working with the
blackbox extension.

Test Plan:
Ran the test 'test-setdiscovery.t' with and without the '--chg'
option.

Differential Revision: https://phab.mercurial-scm.org/D926
2017-10-03 13:30:36 -07:00
Saurabh Singh
31fe1e97ae test-merge-subrepos: make test compatible with chg
The test checks the output of '.hg/blackbox.log' which will contain
logs corresponding to chg in case chg is running. Therefore, this commit
modifies the test to take chg into consideration while checking the
blackbox.log contents.

Test Plan:
Ran the test 'test-merge-subrepos.t' with and without the '--chg'
option.

Differential Revision: https://phab.mercurial-scm.org/D925
2017-10-03 13:05:58 -07:00
Saurabh Singh
8bb0e0f54f test-convert-cvs: make test compatible with chg
The test uses the 'print' method instead of writing to stdout using
'ui.write' which leads to incompatibility with chg. This commit modifies the
test to use the 'ui' object instead which fixes the problem.

Test Plan:
Ran the test 'test-convert-cvs.t' with and without '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D923
2017-10-03 12:49:28 -07:00
Saurabh Singh
04d7964be4 test-basic: make test compatible with chg
The error codes returned when writing to /dev/full are different after
the first failure with and without '--chg' option. Therefore, this commit
conditionally handles the error codes as appropriate.

Test Plan:
Ran the test 'test-basic.t' with and without '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D922
2017-10-03 12:09:23 -07:00
Jun Wu
02fcca0577 zeroconf: do not crash if socket being read is closed by another thread
In zeroconf/__init__.py, there is:

    server = Zeroconf.Zeroconf(ip)
    l = listener()
    Zeroconf.ServiceBrowser(server, "_hg._tcp.local.", l)
    time.sleep(1)
    server.close()

`server.close()` closes the underlying socket while the `ServiceBrowser` may
still have a background thread reading the socket. There could be a race
condition where the reading thread reads the closed socket, resulting in
EBADF crash. This patch catches the exception.

This makes test-paths.t pass with chg.

Differential Revision: https://phab.mercurial-scm.org/D919
2017-10-02 20:23:25 -07:00
Jun Wu
372ecf5929 test-revlog-mmapindex: make it compatible with chg
The test misses an explicit flush().

Differential Revision: https://phab.mercurial-scm.org/D918
2017-10-02 19:31:33 -07:00
Jun Wu
9dd2be2e99 test-profile: gate chg-incompatible part with '#if chg'
chg has a different extension loading logic, which affects the profiler
extension test case. Gate the block with '#if chg' so the test passes with
chg.

Differential Revision: https://phab.mercurial-scm.org/D916
2017-10-02 19:10:32 -07:00
Jun Wu
5c5bc340e6 test-logtoprocess: make it compatible with chg
chg runs more commands and outputs more lines. This patch matches them.

Differential Revision: https://phab.mercurial-scm.org/D914
2017-10-02 18:22:43 -07:00
Saurabh Singh
f6be9e54c3 test-globalopts: make the test compatible with chg
The test fails when run with the '--chg' option. Therefore, this
commit modifies the test to make it compatible with chg.

Test Plan:
Ran 'test-globalopts.t' with and without the '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D913
2017-10-03 11:10:03 -07:00
Jun Wu
08d7c65ce8 test-pager: make it compatible with chg
chg's runpager implementation is different. It behaves differently for the
"shell=False, command not found" case.

Differential Revision: https://phab.mercurial-scm.org/D911
2017-10-02 16:11:57 -07:00
Gregory Szorc
6329605d9f changelog: use a Factory for default value for files
The default value is compiled into the generated type. This means
that default values are shared between instances. For immutable types
like bool, str, int, and tuple, this is fine. But for mutable types
like list and dict, we need to use attr.Factory()  to instantiate a
new instance of the default for each object.

Differential Revision: https://phab.mercurial-scm.org/D901
2017-10-02 11:03:53 +01:00
Gregory Szorc
ce576c3b19 cext: wrap before brace for functions
This is our prevailing style.

Differential Revision: https://phab.mercurial-scm.org/D910
2017-10-02 19:28:41 +01:00
Gregory Szorc
5397128d04 cext: put case statements on separate line
This seems to be the prevailing style, even though it is a bit more
verbose for very simple switch statements.

Differential Revision: https://phab.mercurial-scm.org/D909
2017-10-02 19:09:52 +01:00
Gregory Szorc
a9a915a1bf cext: reorder #include
We mostly abide by this style.

In one case, a blank line was inserted to prevent a local
`#include "file"` from coming before a `#include <file>`.

Differential Revision: https://phab.mercurial-scm.org/D908
2017-10-02 19:06:00 +01:00
Gregory Szorc
1e024e0e3a cext: move braces for control statements to same line
This seems to be the prevailing style in the code by a wide margin.

Differential Revision: https://phab.mercurial-scm.org/D907
2017-10-02 19:02:43 +01:00
Saurabh Singh
786710798c registrar: fixing typo in comment
I was just going through the module and noticed the typo. This commit
fixes 'onfalure' -> 'onfailure'.

Differential Revision: https://phab.mercurial-scm.org/D906
2017-10-02 19:17:04 +01:00
Alex Gaynor
dd422bc1d6 style: never put multiple statements on one line
Differential Revision: https://phab.mercurial-scm.org/D905
2017-09-29 15:49:20 +00:00
Siddharth Agarwal
ba2d76cf38 annotate: mark lines affected by skip-annotate with *
This is to prevent weird surprises from happening with skips being attributed
to the wrong changeset.

.. feature::

   `hg annotate --skip` now prints a `*` on lines with skipped revisions

Differential Revision: https://phab.mercurial-scm.org/D900
2017-10-02 18:18:57 +01:00
Siddharth Agarwal
45633c900e annotate: track whether a particular annotation was the result of a skip
We're going to expose this information in the UI in an upcoming patch.

Differential Revision: https://phab.mercurial-scm.org/D899
2017-10-02 02:34:47 -07:00
Siddharth Agarwal
ca691a7bec annotate: introduce attr for storing per-line annotate data
We're going to extend this a bit -- at first by simply adding whether this was
a skipped child. We're well on our way to outgrowing tuples, though -- adding
more and more fields to tuples becomes annoying very quickly.

Differential Revision: https://phab.mercurial-scm.org/D898
2017-10-02 02:34:47 -07:00
Siddharth Agarwal
26ea4c9f32 context: rename local 'attr' to 'attr_'
In the next diff we're going to import mercurial.thirdparty.attr, and pyflakes
complains about this if this rename isn't done.

Differential Revision: https://phab.mercurial-scm.org/D897
2017-10-02 02:34:47 -07:00
Siddharth Agarwal
87602d16ba annotate: move annotatepair unit tests to a separate file
In upcoming patches the output is going to be significantly longer than it is
today, and doctests don't allow wrapping the output.

Differential Revision: https://phab.mercurial-scm.org/D896
2017-10-02 02:34:47 -07:00