Commit Graph

34279 Commits

Author SHA1 Message Date
Yuya Nishihara
db07c1fcd9 templatekw: make experimental {peerpaths} return a single-level dict (BC)
This was planned as in 2bcc691583ec, "{peerpaths.default.pushurl} will be
translated to peerpaths['default'].makemap()['pushurl'], which means
{peerpaths} should be a single-level dict and sub-options should be
makemap()-ed."
2017-09-18 23:31:01 +09:00
Yuya Nishihara
3d25496222 templatekw: fix scope of peerpath url bound to generator
I had to explicitly bind 'd' to the generator. Otherwise, the last 'd' would
be used.
2017-09-18 23:49:05 +09:00
Yuya Nishihara
2a17199870 templater: extend dot operator as a short for get(dict, key) 2017-09-18 23:07:17 +09:00
Yuya Nishihara
6215164ca2 templater: add dot operator to easily access a sub item
This and the next patch will allow us to access a deeply-nested item
by foo.bar.baz syntax.
2017-09-09 19:32:56 +09:00
Yuya Nishihara
366ad4616f templater: wrap get/min/max result so map operation can apply to element
See the test for usage example.

wraphybridvalue() takes a key/value pair because a hybrid dict passes a key
to its makemap() function. Since makemap() of showmanifest() doesn't need
a key, it's set to None.
2017-09-09 19:13:25 +09:00
Yuya Nishihara
f412c69557 dispatch: move initialization of sys.std* files
I'll add another Python 3 hack.
2017-10-02 07:18:24 +01:00
Yuya Nishihara
5362d4999c py3: work around the scope of exception variable in dispatch.run()
https://stackoverflow.com/questions/29268892/
2017-10-02 06:52:10 +01:00
Yuya Nishihara
bac3fece2c chg: just forward --time to command server
Since we've removed the use of atexit in ee4f321cd621, --time just works.
2017-10-07 22:07:10 +09:00
Kostia Balytskyi
830885ea92 windows: add an experimental option for long paths support
This commit adds an experimental --long-paths-support flag to build_hgexe
on Windows. It is off by default, but when supplied, causes setup.py to
embed some XML into the generated hg.exe, which in turn tells Windows to
allow this exe to use long paths (given that the appropriate registry setting
is enabled as well).
This was tested on Windows 10 14393 and 15063.

This commit introduces a badly-named initialize_options function, but its name
is dictated by distutils, rather than chosen.

# no-check-commit
2017-10-09 02:30:23 -07:00
Boris Feld
ef49af43a4 configitems: register the 'experimental.graphstyle.grandparent' config 2017-10-08 22:07:47 +02:00
Boris Feld
6cc61934ba configitems: register the 'experimental.graphstyle.missing' config 2017-10-08 22:07:21 +02:00
Boris Feld
cfcda827e5 configitems: register the 'experimental.graphstyle.parent' config 2017-10-08 22:06:35 +02:00
Boris Feld
d4002dd1cf configitems: register the 'devel.empty-changegroup' config 2017-10-08 21:41:37 +02:00
Boris Feld
5726c2856c configitems: register the 'devel.cache-vfs' config 2017-10-08 21:41:22 +02:00
Boris Feld
e9fb6c7c88 configitems: register the 'devel.warn-config-default' config 2017-10-08 21:36:26 +02:00
Boris Feld
4181ce9d65 configitems: register the 'devel.warn-config' config 2017-10-08 21:41:10 +02:00
Boris Feld
40e88b2e2b configitems: register 'merge.checkunknown' and 'merge.checkignored'
They both use the same function defining a default, so we need to update them at
the same time.
2017-10-08 21:48:40 +02:00
Boris Feld
2063677b32 configitems: register the 'diff.*' config
All the config were already using a unified function with a forced default, so,
registering them all at once seems safe.
2017-10-08 21:47:14 +02:00
Boris Feld
8d053639dd configitems: register the 'experimental.mmapindexthreshold' config 2017-10-08 20:43:46 +02:00
Boris Feld
ea847730ea configitems: register the 'experimental.maxdeltachainspan' config 2017-10-08 20:42:19 +02:00
Boris Feld
5aa999bedd configitems: register the 'commands.show.aliasprefix' config 2017-10-08 20:16:09 +02:00
Boris Feld
7aa1eb1de7 configitems: register the 'blackbox.track' config 2017-10-08 20:11:34 +02:00
Pulkit Goyal
2251d97e92 copies: add docs for config experimental.copytrace.sourcecommitlimit
This patch adds documentation for the config option. The config name does not
convey much and hence documentation was required.

Differential Revision: https://phab.mercurial-scm.org/D986
2017-10-08 04:39:42 +05:30
Augie Fackler
0c9dc5bb90 hgweb: extract function for loading style from request context
Also make it work on Python 3.

Differential Revision: https://phab.mercurial-scm.org/D970
2017-10-05 14:29:13 -04:00
Augie Fackler
0f33c5f4f4 request: coerce content-type to native str
Again, required by WSGI.

Differential Revision: https://phab.mercurial-scm.org/D969
2017-10-05 14:27:21 -04:00
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