Commit Graph

19753 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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