A Scalable, User-Friendly Source Control System.
Go to file
Jordi Gutiérrez Hermoso 8eb132f5ea style: kill ersatz if-else ternary operators
Although Python supports `X = Y if COND else Z`, this was only
introduced in Python 2.5. Since we have to support Python 2.4, it was
a very common thing to write instead `X = COND and Y or Z`, which is a
bit obscure at a glance. It requires some intricate knowledge of
Python to understand how to parse these one-liners.

We change instead all of these one-liners to 4-liners. This was
executed with the following perlism:

    find -name "*.py" -exec perl -pi -e 's,(\s*)([\.\w]+) = \(?(\S+)\s+and\s+(\S*)\)?\s+or\s+(\S*)$,$1if $3:\n$1    $2 = $4\n$1else:\n$1    $2 = $5,' {} \;

I tweaked the following cases from the automatic Perl output:

    prev = (parents and parents[0]) or nullid
    port = (use_ssl and 443 or 80)
    cwd = (pats and repo.getcwd()) or ''
    rename = fctx and webutil.renamelink(fctx) or []
    ctx = fctx and fctx or ctx
    self.base = (mapfile and os.path.dirname(mapfile)) or ''

I also added some newlines wherever they seemd appropriate for readability

There are probably a few ersatz ternary operators still in the code
somewhere, lurking away from the power of a simple regex.
2015-03-13 17:00:06 -04:00
contrib style: kill ersatz if-else ternary operators 2015-03-13 17:00:06 -04:00
doc spelling: fixes from proofreading of spell checker issues 2015-01-18 02:38:57 +01:00
hgext style: kill ersatz if-else ternary operators 2015-03-13 17:00:06 -04:00
i18n style: kill ersatz if-else ternary operators 2015-03-13 17:00:06 -04:00
mercurial style: kill ersatz if-else ternary operators 2015-03-13 17:00:06 -04:00
tests style: kill ersatz if-else ternary operators 2015-03-13 17:00:06 -04:00
.hgignore hgignore: ignore the PyCharm workspace folder 2014-10-13 11:46:04 +02:00
.hgsigs Added signature for changeset f515b8dd4d3f 2015-03-02 10:29:45 -06: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
hg hg: add support for HGUNICODEPEDANTRY environment variable 2014-06-23 09:33:07 -04:00
hgeditor Fixed a bashism with the use of $RANDOM in hgeditor. 2010-05-19 18:06:35 +02:00
hgweb.cgi mq: add a warning about uncommitted changes for qfinish 2011-11-10 15:40:34 -06:00
Makefile Makefile: allow setting HGTESTFLAGS in shell environment for TESTFLAGS 2015-02-04 15:17:13 -05:00
README readme: mention how to run in-place 2012-03-02 21:43:55 +02:00
setup.py manifest.c: new extension code to lazily parse manifests 2015-01-13 14:31:38 -08: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 http://mercurial.selenic.com/ for detailed installation
instructions, platform-specific notes, and Mercurial user information.