Commit Graph

34554 Commits

Author SHA1 Message Date
Augie Fackler
437290aeb9 request: use trivial iterator over dictionary keys
Differential Revision: https://phab.mercurial-scm.org/D968
2017-10-05 14:26:09 -04:00
Augie Fackler
02378a67e1 hgweb: when constructing or adding to a wsgi environ dict, use native strs
That's what's required of us to work with the WSGI API on Python 3.

Differential Revision: https://phab.mercurial-scm.org/D967
2017-10-05 14:22:02 -04:00
Augie Fackler
70bdecfdf5 hgweb: produce native string for etag value
Also use %d since we know mtime is numeric.

Differential Revision: https://phab.mercurial-scm.org/D966
2017-10-05 14:17:50 -04:00
Augie Fackler
395bba3900 hgweb: in protocol adapter, look for bytes instances, not str
Differential Revision: https://phab.mercurial-scm.org/D963
2017-10-05 14:13:20 -04:00
Augie Fackler
38c5b420ba hgweb: in protocol adapter, avoid control reaching end of non-void function
This greatly confounded some Python 3 porting work, once it was
managing to get this far.

Differential Revision: https://phab.mercurial-scm.org/D962
2017-10-05 14:12:51 -04:00
Saurabh Singh
bacb1366fc test-check-code: fail new commits which use 'atexit' instead of 'ui.atexit'
Callbacks registered with 'atexit' are sometimes not called (like when
hg aborts and calls os._exit). On the other hand, callbacks registered with
'ui.atexit' are called in most cases. Therefore, encouraging the use of
'ui.atexit' by failing the test 'test-check-code.t' appropriately.

Test Plan:
Ran the test 'test-check-code.t' after importing 'atexit' in one of
the py files and confirmed that the test fails.

Differential Revision: https://phab.mercurial-scm.org/D961
2017-10-05 14:18:55 -07:00
Saurabh Singh
4d1fce7aa0 test-push-race: use 'ui.atexit' instead of python's 'atexit'
Callbacks registered with 'atexit' are sometimes not called (like when a
process is killed by the SIGTERM signal). Therefore, this commit replaces it
with 'ui.atexit' which ensures that the callbacks are always called. This also
makes the test compatible with chg.

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

Differential Revision: https://phab.mercurial-scm.org/D957
2017-10-05 20:46:49 +00:00
Pulkit Goyal
fbd5da487b py3: use '%d' for integers instead of '%s'
Differential Revision: https://phab.mercurial-scm.org/D973
2017-10-02 04:48:06 +05:30
Pulkit Goyal
8cf2ab1237 py3: fix keyword arguments handling in mq
This patch fixes the handling of keyword arguments to functions on Python 3. On
python3, the keys of keyword arguments need to str which is unicode. So any
keyword argument will get will have str keys and any dictionary we pass as
kwargs must have all the keys as str.

This patch uses pycompat.(strkwargs|byteskwargs) to do so conversion between
bytes keys and str keys and use r'' if there are very less uses and conversion
can be prevented.

Differential Revision: https://phab.mercurial-scm.org/D972
2017-10-02 04:46:17 +05:30
Jun Wu
8ad49ae972 test-rebase-base: clarify it is about the "--base" flag
It happened several times that people use `test-rebase-base.t` as a general
purposed test file for rebase. But it is intended to be only related to the
`--base` flag. This patch split, renamed the test, and added a note to
clarify.

Differential Revision: https://phab.mercurial-scm.org/D975
2017-10-05 20:41:50 -07:00
Boris Feld
4a1873b535 configitems: register the 'convert.p4.encoding' config 2017-06-30 03:36:10 +02:00
Boris Feld
5fb986dcec configitems: register the 'gpg.key' config 2017-06-30 03:42:34 +02:00
Boris Feld
7f0ad7dd52 configitems: register the 'gpg.cmd' config 2017-06-30 03:42:33 +02:00
Boris Feld
64d1b101d3 configitems: register the 'keywordset.svn' config 2017-06-30 03:42:50 +02:00
Boris Feld
22ea1c5ccd configitems: register the 'hgk.path' config 2017-06-30 03:42:35 +02:00
Boris Feld
846857f96b configitems: register the 'share.poolnaming' config 2017-06-30 03:44:18 +02:00
Boris Feld
324e2e48c4 configitems: register the 'share.pool' config 2017-06-30 03:44:17 +02:00
Boris Feld
d1938932c9 configitems: register the 'shelve.maxbackups' config 2017-06-30 03:44:19 +02:00
Boris Feld
db25c9b563 configitems: register the 'pager.attend' config 2017-06-30 03:43:33 +02:00
Boris Feld
43de0b805b configitems: register the 'perf.stub' config 2017-06-30 03:43:46 +02:00
Boris Feld
a37fa16d39 configitems: register the 'commands.rebase.requiredest' config 2017-06-30 03:32:25 +02:00
Boris Feld
529a966468 configitems: register the 'experimental.rebaseskipobsolete' config 2017-06-30 03:42:06 +02:00
Boris Feld
112417d22c configitems: register the 'experimental.nonnormalparanoidcheck' config 2017-06-30 03:41:49 +02:00
Boris Feld
9d0cb965ed configitems: register the 'experimental.allowdivergence' config 2017-06-30 03:39:44 +02:00
Saurabh Singh
ffc1ad2f09 histedit: removing the experimental config 'histeditng'
This config has been around for about 2 years now. So, it can be
assumed to be stable. Therefore, I am removing the config. This also makes the
test 'test-histedit-base.t' compatible with chg.

Test Plan:
 - Ran the test 'test-histedit-base.t' with and without '--chg' option.
 - Ran all the other tests without '--chg' option.
 - Checked the output of 'hg help histedit'.

Differential Revision: https://phab.mercurial-scm.org/D942
2017-10-05 21:56:25 +00:00
Saurabh Singh
abf69172aa convert: fix the RevisionSpec import in the bzr module
This import was failing (because its invalid) which was resulting in
the following tests failing with chg running:

 - test-convert-bzr.t
 - test-convert-bzr-directories.t
 - test-convert-bzr-ghosts.t
 - test-convert-bzr-treeroot.t
 - test-convert-bzr-114.t
 - test-convert-bzr-merges.t

This commit fixes the import which in turn fixes the tests.

Test Plan:
Ran the aforementioned tests with and without '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D936
2017-10-05 00:48:44 +00:00
Augie Fackler
49deaca739 test-annotate: fix up expected output for pure
This is just a side effect of surfacing the "revisions were skipped"
state in the blame output.

Differential Revision: https://phab.mercurial-scm.org/D956
2017-10-05 15:12:11 -04:00
Alex Gaynor
88c328dbf9 style: never use a space before a colon or comma
Differential Revision: https://phab.mercurial-scm.org/D954
2017-09-29 15:48:34 +00:00
Jun Wu
bcceeef325 eol: make [eol] config section sensitive for chg confighash
The eol extension may mangle the [eol] config section and that means chg is
unable to detect config file change (because it re-applies setconfig
changes).

This makes test-eol.t pass with chg.

Differential Revision: https://phab.mercurial-scm.org/D917
2017-10-02 19:25:11 -07:00
Jun Wu
0802429abd test-alias: make it compatible with chg
ad1bdea (dispatch: defer environment variable resolution in alias commands
(BC), 2016-05-06) made environment variables lazily resolved. But after
D805 (alias: make alias command lazily resolved 2017-09-23), alias
resolution happened after uisetup, which breaks the test for chg.

`uisetup` is known to behave different in chg. Let's verify the feature
without using `*setup`.

Differential Revision: https://phab.mercurial-scm.org/D912
2017-10-02 16:48:58 -07:00
Saurabh Singh
c06453cd30 serve: make tests compatible with chg
chg only supports 'hg serve' when the options to the serve command
follow the 'hg serve'. For example, 'hg -R <repo> serve ..' is unsupported.
This leads to issues with chg running for the following tests:

 - test-bundle2-exchange.t
 - test-clone-uncompressed.t
 - test-hgweb-csp.t
 - test-http-bad-server.t
 - test-http-bundle1.t
 - test-http-protocol.t
 - test-http.t

There was an effort made earlier to fix this issue for chg and the tests were
fixed to confirm to the compatible pattern. But the new tests did not take care
of the same and hence, fail. Hopefully, there will be continuous build setup
for chg after all tests are made compatible with chg so that we can avoid such
issues.

Test Plan:
Ran the aforementioned tests with and without '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D946
2017-10-04 18:39:26 -07:00
Augie Fackler
ffcbb8d170 ui: convert to/from Optional[bytes] to Optional[str] in password manager
This password manager proxy is roughly the right-looking layer to
convert between strings and bytes. Many of these arguments can be
None, so we have a helper method to make the conversion preserve Nones
without exploding.

Differential Revision: https://phab.mercurial-scm.org/D886
2017-10-01 12:10:48 -04:00
Boris Feld
568bdc4e58 configitems: register the 'debug.dirstate.delaywrite' config 2017-06-30 03:37:05 +02:00
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