A Scalable, User-Friendly Source Control System.
Go to file
Jun Wu a4129f8d53 configparser: use pest to parse config files
Summary:
[pest](https://github.com/pest-parser/pest) is an elegant Rust library for
parsing text.

A navie benchmark on a 1MB config file shows pest is about 1.5 to 2x slower.
But the better error message and cleaner code seems worth it.

Practically, in a VirtualBox VM, parsing a set of our config files takes 3-7ms.
The overhead seems to be opening too many files. Reducing it to one file makes
parsing complete in 2-4ms.

Unfortunately the buck build has issues with the elegant syntax
`#[grammar = "spec.pest"]`, because "spec.pest" cannot be located by pest_derive.
Therefore a workaround is used to generate the parser.

The motivation behind this is because I noticed multi-line value can not be
taken as a plain Bytes slice. For example:

  [section]
  foo = line1
    line2

"foo" should be "line1\nline2", instead of "line1\n  line2". It does not make a
difference on configlist. But it affects templates. Rather than making the
parser more complex, it seems better to just adopt a reasonbly fast parsing
library.

Reviewed By: DurhamG

Differential Revision: D8960876

fbshipit-source-id: 2fa04e38b706f7126008512732c9efa168f84cc7
2018-08-08 17:20:00 -07:00
contrib perfdatapack: fix tests 2018-08-07 08:49:47 -07:00
distutils_rust distutils_rust: move download_vendored_crates to fb/ 2018-07-20 17:37:57 -07:00
doc Update to 18.6b1 2018-06-05 22:19:55 -07:00
exec/scm_daemon scmdaemon: use io::Write on osx 2018-07-30 11:36:51 -07:00
hgdemandimport Fix conflict with RLock 2018-07-25 10:21:05 -07:00
hgext lock: use flock on POSIX 2018-08-08 16:20:21 -07:00
hgext3rd codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
i18n Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
lib configparser: use pest to parse config files 2018-08-08 17:20:00 -07:00
mercurial configparser: add a way to clone configs 2018-08-08 17:20:00 -07:00
tests configparser: use pest to parse config files 2018-08-08 17:20:00 -07:00
.editorconfig move scm/hg/.clang-format to scm/hg/mercurial/ 2018-05-25 14:35:51 -07:00
.flake8 codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
.gitignore setup: make GitHub export build 2018-07-09 15:08:05 -07:00
.hgsigs Added signature for changeset f51ae48a3fd9 2017-12-01 13:49:47 -06:00
.jshintrc hgweb: add .jshintrc with some basic rules 2017-11-22 22:18:06 +08:00
.watchmanconfig watchman: add an empty .watchmanconfig 2018-04-13 21:50:54 -07:00
CONTRIBUTING contributing: add new file with a pointer to the wiki 2016-10-08 10:39:00 -04:00
CONTRIBUTORS Add note to CONTRIBUTORS file 2007-11-07 21:10:30 -06:00
COPYING COPYING: refresh with current address from fsf.org 2011-06-02 11:17:02 -05:00
gen_version.py generate __version__.py during the buck build 2018-06-25 15:52:25 -07:00
hg chg: use a separate entry point 2018-05-08 17:02:22 -07:00
hgeditor spelling: trivial spell checking 2015-10-17 00:58:46 +02:00
hgweb.cgi urls: bulk-change primary website URLs 2015-09-30 15:43:49 -05:00
Makefile lfs: fix lfs pointer paths 2018-07-19 14:21:04 -07:00
README.rst doc: rename README to README.rst 2017-09-26 08:37:17 +02:00
setup.py configparser: expose interface to Python world 2018-08-08 17:20:00 -07:00

Mercurial
=========

Mercurial is a fast, easy to use, distributed revision control tool
for software developers.

Basic install::

 $ make            # see install targets
 $ make install    # do a system-wide install
 $ hg debuginstall # sanity-check setup
 $ hg              # see help

Running without installing::

 $ make local      # build for inplace usage
 $ ./hg --version  # should show the latest version

See https://mercurial-scm.org/ for detailed installation
instructions, platform-specific notes, and Mercurial user information.