# HG changeset patch # User Kevin Bullock # Date 1500468701 18000 # Node ID 857876ebaed4e315f63157bd157d6ce553c7ab73 # Parent c1994c986d77f071e338de35a2c69d7bb87e39a3# Parent 9a944e908ecf9ac3aabf30a24406513370eeebe7 merge default into stable for code freeze diff -r c1994c986d77 -r 857876ebaed4 .hgignore --- a/.hgignore Wed Jul 05 11:24:22 2017 -0400 +++ b/.hgignore Wed Jul 19 07:51:41 2017 -0500 @@ -55,14 +55,6 @@ locale/*/LC_MESSAGES/hg.mo hgext/__index__.py -# files installed with a local --pure build -mercurial/base85.py -mercurial/bdiff.py -mercurial/diffhelpers.py -mercurial/mpatch.py -mercurial/osutil.py -mercurial/parsers.py - # Generated wheels wheelhouse/ diff -r c1994c986d77 -r 857876ebaed4 Makefile --- a/Makefile Wed Jul 05 11:24:22 2017 -0400 +++ b/Makefile Wed Jul 19 07:51:41 2017 -0500 @@ -64,7 +64,6 @@ -$(PYTHON) setup.py clean --all # ignore errors from this command find contrib doc hgext hgext3rd i18n mercurial tests \ \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';' - rm -f $(addprefix mercurial/,$(notdir $(wildcard mercurial/pure/[a-z]*.py))) rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err rm -f mercurial/__modulepolicy__.py if test -d .hg; then rm -f mercurial/__version__.py; fi @@ -177,6 +176,14 @@ # location of our own. install -d build/mercurial/usr/local/hg/contrib/ install -m 0644 contrib/bash_completion build/mercurial/usr/local/hg/contrib/hg-completion.bash + make -C contrib/chg \ + HGPATH=/usr/local/bin/hg \ + PYTHON=/usr/bin/python2.7 \ + HG=/usr/local/bin/hg \ + HGEXTDIR=/Library/Python/2.7/site-packages/hgext \ + DESTDIR=../../build/mercurial \ + PREFIX=/usr/local \ + clean install mkdir -p $${OUTPUTDIR:-dist} HGVER=$$((cat build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py; echo 'print(version)') | python) && \ OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \ diff -r c1994c986d77 -r 857876ebaed4 contrib/bdiff-torture.py --- a/contrib/bdiff-torture.py Wed Jul 05 11:24:22 2017 -0400 +++ b/contrib/bdiff-torture.py Wed Jul 19 07:51:41 2017 -0500 @@ -5,8 +5,7 @@ import sys from mercurial import ( - bdiff, - mpatch, + mdiff, ) def reducetest(a, b): @@ -42,10 +41,10 @@ sys.exit(0) def test1(a, b): - d = bdiff.bdiff(a, b) + d = mdiff.textdiff(a, b) if not d: raise ValueError("empty") - c = mpatch.patches(a, [d]) + c = mdiff.patches(a, [d]) if c != b: raise ValueError("bad") diff -r c1994c986d77 -r 857876ebaed4 contrib/check-code.py --- a/contrib/check-code.py Wed Jul 05 11:24:22 2017 -0400 +++ b/contrib/check-code.py Wed Jul 19 07:51:41 2017 -0500 @@ -116,6 +116,7 @@ (r'printf.*[^\\]\\x', "don't use printf \\x, use Python"), (r'\$\(.*\)', "don't use $(expr), use `expr`"), (r'rm -rf \*', "don't use naked rm -rf, target a directory"), + (r'\[[^\]]+==', '[ foo == bar ] is a bashism, use [ foo = bar ] instead'), (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w', "use egrep for extended grep syntax"), (r'/bin/', "don't use explicit paths for tools"), @@ -137,6 +138,7 @@ "put a backslash-escaped newline after sed 'i' command"), (r'^diff *-\w*[uU].*$\n(^ \$ |^$)', "prefix diff -u/-U with cmp"), (r'^\s+(if)? diff *-\w*[uU]', "prefix diff -u/-U with cmp"), + (r'[\s="`\']python\s(?!bindings)', "don't use 'python', use '$PYTHON'"), (r'seq ', "don't use 'seq', use $TESTDIR/seq.py"), (r'\butil\.Abort\b', "directly use error.Abort"), (r'\|&', "don't use |&, use 2>&1"), @@ -144,6 +146,7 @@ (r'\bsed\b.*[^\\]\\n', "don't use 'sed ... \\n', use a \\ and a newline"), (r'env.*-u', "don't use 'env -u VAR', use 'unset VAR'"), (r'cp.* -r ', "don't use 'cp -r', use 'cp -R'"), + (r'grep.* -[ABC] ', "don't use grep's context flags"), ], # warnings [ @@ -298,8 +301,10 @@ "comparison with singleton, use 'is' or 'is not' instead"), (r'^\s*(while|if) [01]:', "use True/False for constant Boolean expression"), + (r'^\s*if False(:| +and)', 'Remove code instead of using `if False`'), (r'(?:(?|int|bool|list)\( + # First argument. + ['"](?P
\S+)['"],\s* + # Second argument + ['"](?P