sapling/mercurial
Yuya Nishihara c51267a286 parser: add stub class that will host alias parsing and expansion
This class will keep syntax rules that are necessary to parse and expand
aliases. The implementations will be extracted from the revset module. In
order to make the porting easier, this class keeps parsedecl and parsedefn
separately, which will be unified later. Also, getlist and funcnode will
be refactored by future patches for better handling of the template aliases.

The following public functions will be added:

  aliasrules.build(decl, defn) -> aliasobj
    parse decl and defn into an object that keeps alias name, arguments
    and replacement tree.
  aliasrules.buildmap(aliasitems) -> aliasdict
    helper to build() a dict of alias objects from a list of (decl, defn)
  aliasrules.expand(aliasdict, tree) -> tree
    expand aliases in tree recursively

Because these functions aren't introduced by this series, there would remain
a few wrapper functions in the revset module. These ugly wrappers should be
eliminated by the next series.

This class is considered an inheritable namespace, which will host only
class/static methods. That's because it won't have no object-scope variables.
I'm not a big fan of using class as a syntax sugar, but I admit it can improve
code readability at some level. So let's give it a try.
2016-04-03 16:55:23 +09:00
..
default.d mergetools.rc: find OSX FileMerge in the new location inside Xcode 4.3 2015-10-16 11:37:34 +02:00
help help: remove references to "Python 2.6 or later" 2016-04-10 10:58:47 -07:00
hgweb pycompat: switch to util.stringio for py3 compat 2016-04-10 20:55:37 +00:00
httpclient pycompat: switch to util.stringio for py3 compat 2016-04-10 20:55:37 +00:00
pure pycompat: switch to util.stringio for py3 compat 2016-04-10 20:55:37 +00:00
templates compact: add color labels to -Tcompact 2016-04-08 16:05:52 +00:00
__init__.py mercurial: use pure Python module policy on Python 3 2016-03-12 13:19:19 -08:00
ancestor.py ancestor: use absolute_import 2015-08-07 19:45:48 -07:00
archival.py pycompat: switch to util.stringio for py3 compat 2016-04-10 20:55:37 +00:00
base85.c base85: fix comparison of an int and a long 2015-08-21 14:29:42 -04:00
bdiff.c bdiff: avoid a memory error on malloc failure 2013-10-30 16:03:42 -05:00
bookmarks.py with: use context manager for wlock in _writeactive 2016-01-15 13:14:45 -08:00
branchmap.py cache: rebuild branch cache from scratch when inconsistencies are detected 2016-03-13 02:06:23 +01:00
bundle2.py bundle: remove obsolete (and duplicate) comment 2016-03-29 10:21:05 -07:00
bundlerepo.py bundle: warn when update to revision existing only in a bundle (issue5004) 2016-03-23 08:55:22 +01:00
byterange.py byterange: use absolute_import 2015-12-21 21:42:14 -08:00
changegroup.py bundle: move writebundle() from changegroup.py to bundle2.py (API) 2016-03-28 14:41:29 -07:00
changelog.py changelog: avoid slicing raw data until needed 2016-03-06 15:40:20 -08:00
cmdutil.py pycompat: switch to util.stringio for py3 compat 2016-04-10 20:55:37 +00:00
commands.py obsstore: move delete function from obsstore class to repair module 2016-04-12 04:06:50 -07:00
commandserver.py cmdserver: write early exception to 'e' channel in 'unix' mode 2016-03-12 22:03:30 +09:00
config.py config: add hasconfig method and supporting plumbing 2016-01-07 19:45:03 -08:00
context.py context: use changelogrevision 2016-03-06 13:26:37 -08:00
copies.py copies: fix detection of divergent directory renames 2016-01-13 10:10:05 -06:00
crecord.py pycompat: switch to util.stringio for py3 compat 2016-04-10 20:55:37 +00:00
dagparser.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
dagutil.py dagutil: use absolute_import 2015-08-08 19:04:09 -07:00
demandimport.py demandimport: add _imp to ignore list 2016-02-25 22:35:11 -08:00
destutil.py destutil: show message and hint at updating to the closed head as warning 2016-03-29 23:59:32 +09:00
diffhelpers.c diffhelpers: fix botched return statement from e48d70075d8a 2015-01-28 13:34:20 -05:00
dirs.c dirs._addpath: reinstate use of Py_CLEAR 2015-04-07 20:43:04 -07:00
dirstate.py dirstate: add a way to get the ignore file/line matching an ignored file 2016-01-05 07:52:04 -08:00
discovery.py bookmarks: don't allow pushing new head for existing mark with -B (issue4400) 2015-10-21 16:21:27 -05:00
dispatch.py pycompat: switch to util.stringio for py3 compat 2016-04-10 20:55:37 +00:00
dummycert.pem ssl: on OS X, use a dummy cert to trick Python/OpenSSL to use system CA certs 2014-09-26 02:19:48 +02:00
encoding.py encoding: use range() instead of xrange() 2016-03-11 21:27:26 -08:00
error.py error: make InterventionRequired take a hint 2015-12-23 08:52:52 +00:00
exchange.py exchange: make _pushb2ctx() look more like _getbundlechangegrouppart() 2016-03-25 16:13:28 -07:00
exewrapper.c exewrapper: add comments about PYTHONHOME 2015-10-14 12:23:49 +02:00
extensions.py extensions: also search for extension in the 'hgext3rd' package 2016-03-11 10:30:08 +00:00
fancyopts.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
filelog.py filelog: use absolute_import 2015-08-08 19:11:42 -07:00
filemerge.py filemerge: use revset notation for p1/p2 of local/other descriptions 2016-03-17 00:36:01 +00:00
fileset.py fileset: fix copy/paste in eol() error message 2016-02-18 22:32:18 -05:00
formatter.py templater: relax unquotestring() to fall back to bare string 2016-03-26 18:12:12 +09:00
graphmod.py graphmod: set default edge styles for ascii graphs (BC) 2016-03-23 13:34:47 -07:00
hbisect.py with: use context manager in bisect save_state 2016-01-15 13:14:49 -08:00
help.py help: report source of aliases 2016-04-08 18:35:49 +00:00
hg.py hg: perform update after pulling during clone with share (issue5103) 2016-03-25 10:47:49 -07:00
hook.py dirstate: don't write repo.currenttransaction to repo.dirstate if repo 2015-12-03 01:38:21 +01:00
httpconnection.py httpconnection: remove obsolete comment about open() 2016-03-14 14:08:28 -07:00
httppeer.py bundle: move writebundle() from changegroup.py to bundle2.py (API) 2016-03-28 14:41:29 -07:00
i18n.py py3: handle ugettext + unicode in i18n 2016-03-29 17:22:08 +00:00
keepalive.py keepalive: use print function 2015-06-21 23:14:54 -07:00
localrepo.py localrepo: drop force check from checkcommitpatterns 2016-04-06 18:08:38 +00:00
lock.py lock: turn a lock into a Python context manager 2016-01-15 13:14:45 -08:00
lsprof.py lsprof: use print function 2016-01-02 11:40:53 -08:00
lsprofcalltree.py lsprofcalltree: use print function 2016-01-02 11:45:29 -08:00
mail.py mail: use print function 2016-01-02 11:47:07 -08:00
manifest.c lazymanifest: check more return values in filtercopy 2015-12-31 13:31:42 -05:00
manifest.py treemanifest: rework lazy-copying code (issue4840) 2015-09-25 22:54:46 -04:00
match.py spelling: trivial spell checking 2015-10-17 00:58:46 +02:00
mdiff.py mdiff: don't emit a diff header for empty trivial deltas 2016-01-11 22:00:07 -05:00
merge.py merge: save merge part labels for later reuse 2016-03-19 18:37:10 -07:00
minirst.py minirst: change hgrole to use single quotes 2016-01-12 06:03:36 +00:00
mpatch.c mpatch: unify mpatchError (issue5182) 2016-03-31 02:05:28 +00:00
namespaces.py namespaces: fix name/node confusion 2016-03-16 23:12:43 +00:00
node.py node: use byte literals to construct nullid and wdirid 2016-03-12 14:04:57 -08:00
obsolete.py obsstore: move delete function from obsstore class to repair module 2016-04-12 04:06:50 -07:00
osutil.c osutil: stop using strcpy 2016-03-19 20:02:19 -04:00
parser.py parser: add stub class that will host alias parsing and expansion 2016-04-03 16:55:23 +09:00
parsers.c parsers: fix istat macro to work with single line if statement 2016-04-05 10:43:43 -04:00
patch.py pycompat: switch to util.stringio for py3 compat 2016-04-10 20:55:37 +00:00
pathencode.c pathencode: check result of .digest() method in sha1hash 2015-08-18 16:32:41 -04:00
pathutil.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
peer.py peer: add an iterbatcher interface 2016-03-01 18:39:25 -05:00
phases.py with: use context manager for transaction in pushphase 2016-01-15 13:14:49 -08:00
posix.py posix: fix test-permissions regression 2015-11-09 15:53:11 -06:00
progress.py spelling: trivial spell checking 2015-10-17 00:58:46 +02:00
pushkey.py pushkey: use absolute_import 2015-08-08 19:57:27 -07:00
pvec.py pvec: use absolute_import 2015-12-21 21:32:58 -08:00
py3kcompat.py py3compat: use absolute_import 2015-12-21 21:31:57 -08:00
pycompat.py pycompat: add util.stringio to handle py3 divergence 2016-04-06 20:31:31 +00:00
registrar.py registrar: add templatefunc to mark a function as template function (API) 2016-03-30 02:10:44 +09:00
repair.py obsstore: move delete function from obsstore class to repair module 2016-04-12 04:06:50 -07:00
repoview.py hideablerevs: expand docstring to warn about possible traps 2016-04-02 15:56:47 -07:00
revlog.py revlog: fix bad indentation (replace tab by space) 2015-12-18 20:54:41 -08:00
revset.py parser: add stub class that will host alias parsing and expansion 2016-04-03 16:55:23 +09:00
scmposix.py scmposix: use absolute_import 2015-12-21 21:24:49 -08:00
scmutil.py scmutil: use util.queue/util.empty for py3 compat 2016-04-06 20:07:51 +00:00
scmwindows.py windows: read all global config files, not just the first (issue4491) (BC) 2015-10-12 20:13:12 +02:00
setdiscovery.py setdiscovery: use iterbatch interface instead of batch 2016-03-01 17:44:41 -05:00
similar.py similar: specify unit for ui.progress when operating on files 2016-03-11 22:29:20 +08:00
simplemerge.py simplemerge: move conflict warning message to filemerge 2015-10-09 13:54:52 -07:00
sshpeer.py wireproto: make iterbatcher behave streamily over http(s) 2016-03-01 18:41:43 -05:00
sshserver.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
sslutil.py sslutil: document and slightly refactor validation logic 2016-04-10 11:02:58 -07:00
statichttprepo.py statichttprepo: implement __enter__ and __exit__ on httprangeheader 2016-01-02 15:33:01 -08:00
store.py l10n: use %d instead of %s for numbers 2015-10-14 22:29:03 -04:00
streamclone.py streamclone: fix error when store files grow while stream cloning 2016-03-13 02:29:11 +01:00
strutil.py strutil: use absolute_import 2015-08-08 20:01:40 -07:00
subrepo.py merge with stable 2016-03-29 12:29:00 -05:00
tagmerge.py tagmerge: use absolute_import 2015-08-08 20:10:46 -07:00
tags.py tags: create new sortdict for performance reasons 2015-11-12 13:16:04 -08:00
templatefilters.py templatefilters: use templatefilter to mark a function as template filter 2016-03-30 02:10:44 +09:00
templatekw.py templatekw: use templatekeyword to mark a function as template keyword 2016-03-13 05:17:06 +09:00
templater.py templater: drop deprecated handling of KeyError from changeset_templater 2016-04-03 11:23:31 +09:00
transaction.py transaction: allow running file generators after finalizers 2016-04-07 14:10:49 -07:00
treediscovery.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
ui.py edit: allow to configure the suffix of the temporary filename 2016-03-20 13:55:41 -04:00
unionrepo.py unionrepo: properly handle hidden linkrev in revlog (issue5070) 2016-02-22 23:36:04 +01:00
url.py pycompat: switch to util.stringio for py3 compat 2016-04-10 20:55:37 +00:00
util.h util: fix the check for non-C99 compilers (issue4605) 2015-04-20 22:21:57 -05:00
util.py util: add doctest to datestr() 2016-04-11 19:46:50 +02:00
verify.py verify: specify unit for ui.progress when checking files 2016-03-11 20:18:41 +08:00
win32.py win32: use absolute_import 2015-08-08 18:52:59 -07:00
windows.py windows: insert file positioning call between reads and writes 2015-09-27 18:46:53 -07:00
wireproto.py bundle: move writebundle() from changegroup.py to bundle2.py (API) 2016-03-28 14:41:29 -07:00
worker.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00