Pulkit Goyal <7895pulkit@gmail.com> [Sat, 23 Dec 2017 17:50:42 +0530] rev 36061
remotenames: introduce a class to lazily resolve remotnames
remotenames may take time to load and in next patch we are going to introduce
namespaces related to them. So let's introduce a class making them load lazily.
This is a part of moving hgremotenames extension to core.
hgremotenames: https://bitbucket.org/seanfarley/hgremotenames
Differential Revision: https://phab.mercurial-scm.org/D1757
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 23 Dec 2017 00:19:09 +0530] rev 36060
remotenames: introduce class to encapsulate remotenames info in an extension
This patch adds a new extension remotenames in which features from hgremotenames
extension (https://bb/seanfarley/hgremotenames) will be added incrementally.
This patch introduces a basic class to encapsulate the remotenames information.
Differential Revision: https://phab.mercurial-scm.org/D1756
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 23 Dec 2017 20:27:41 +0530] rev 36059
logexchange: introduce helper function to get remote path name
This patch moves chunk of activepath function from hgremotenames extension
(https://bitbucket.org/seanfarley/hgremotenames/) to core. Before moving
rest of the part, there needs to be some refactoring done to schemes which
will be done as a separate series.
Differential Revision: https://phab.mercurial-scm.org/D1755
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 10:36:59 -0500] rev 36058
charencode: adjust clang-format enable/disable comments
We're pretty close to being able to let clang-format manage most of
these files.
Differential Revision: https://phab.mercurial-scm.org/D2180
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 10:31:17 -0500] rev 36057
diffhelpers: allow clang-format oversight
One trailing comma!
Differential Revision: https://phab.mercurial-scm.org/D2179
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 10:29:02 -0500] rev 36056
pathencode: allow clang-format oversight
Only had to add two trailing commas to make the file format acceptably!
Differential Revision: https://phab.mercurial-scm.org/D2178
Augie Fackler <augie@google.com> [Mon, 12 Feb 2018 10:21:44 -0500] rev 36055
bdiff: add to clang-format oversight
This file didn't require any complex fixes, so we may as well enable
clang-format while I'm editing it.
Differential Revision: https://phab.mercurial-scm.org/D2177
Matt Harbison <matt_harbison@yahoo.com> [Sun, 11 Feb 2018 20:59:35 -0500] rev 36054
test-merge-tools: stabilize for Windows
This masks the Windows argument parsing insanity[1], so it needs a bit of
explanation. (The security reference in the footnote is probably useful to keep
in mind if we ever whitelist certain in-repo config settings.)
9037c29e9f53 introduced tests that were failing on Windows with an unbalanced
double quote[2]. What ends up happening here is util.shellquote() is double
quoting the file path, but the shell script is placing this ->": "<- right next
to it. So cmd.exe gets launched with 'lb:base": ""c:\...\f~base.xyz"', which
got interpreted as 'lb:base: "c:\...\f~base.xyz'. If the test is adjusted to
quote like "lb:$labelbase: $base", then MSYS runs interference and strips the
'\' characters. I was able to get the expected result by dropping the quotes
from '": "', and changing the space to underscore. But since we need to glob
away the C: part anyway, just glob away the quote and leave the test unchanged.
[1] https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
[2] https://buildbot.mercurial-scm.org/builders/Win7%20x86_64%20hg%20tests/builds/441/steps/run-tests.py%20%28python%202.7.13%29/logs/stdio
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:17:05 +0530] rev 36053
py3: replace file() with open() in test-convert-hg-source.t
file() is not present in Python 3.
It also makes sure we read and write in bytes mode on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2132
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:15:45 +0530] rev 36052
py3: replace file() with open() in test-encoding-align.t
file() is not present in Python 3.
This patch also makes sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2131
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:14:59 +0530] rev 36051
py3: replace file() with open() in test-encoding.t
file() is not present in Python 3.
This also makes sure we write things in bytes mode in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2130
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 16:17:17 +0530] rev 36050
py3: make sure we return str from __repr__
Differential Revision: https://phab.mercurial-scm.org/D2109
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 14:30:44 -0800] rev 36049
py3: check for bytes instead of str in hg.share()
Differential Revision: https://phab.mercurial-scm.org/D2151
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 14:29:30 -0800] rev 36048
py3: port metaedit extension to Python 3
Without these changes, this extension is responsible for a test of
test failures.
Differential Revision: https://phab.mercurial-scm.org/D2150
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 14:25:10 -0800] rev 36047
py3: pass system string to email.message.Message.set_type()
Python 3 insists the type is a str.
Differential Revision: https://phab.mercurial-scm.org/D2149
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 14:18:27 -0800] rev 36046
py3: open temporary file in binary mode
Otherwise things fail later when we write bytes to the handle.
Differential Revision: https://phab.mercurial-scm.org/D2148
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 14:17:23 -0800] rev 36045
py3: use email parser that operates on bytes
email.parser.Parser() operates on str in both Python 2 and 3.
Python 3.2 introduced the email.parser.BytesParser(), which works
like Parser except it accepts bytes.
We implement the pycompat helper as a function so we lazily
import the "email" module.
Differential Revision: https://phab.mercurial-scm.org/D2147
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 13:32:18 -0800] rev 36044
py3: port ext-phase-report.py extension
The custom module importer doesn't run on Python files in the
tests directory. So we need the source to be compatible with
both Python 2 and 3.
Differential Revision: https://phab.mercurial-scm.org/D2145
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 13:23:26 -0800] rev 36043
py3: more robustly cast UUID to bytes
The UUID type only has __str__ implemented. So we need to cast to
bytes on Python 3.
We need an actual bytes instance here (bytestr won't do) because
the re.escape() later iterates over characters and characters
need to behave like ints, not bytes instances of length 1.
Differential Revision: https://phab.mercurial-scm.org/D2144
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 13:09:16 -0800] rev 36042
py3: use bytes() to cast context instances
__str__ and __bytes__ are both implemented on context types. However,
__str__ behaves differently on Python 2 and 3.
Differential Revision: https://phab.mercurial-scm.org/D2143
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 13:06:01 -0800] rev 36041
py3: convert __doc__ to bytes
Differential Revision: https://phab.mercurial-scm.org/D2142
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 14:21:44 -0800] rev 36040
py3: cast repr() result to bytes
Differential Revision: https://phab.mercurial-scm.org/D2141
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 13:00:00 -0800] rev 36039
py3: fix file i/o in test-status.t
Use raw string literal for open() mode and pass the proper data
type to write().
Differential Revision: https://phab.mercurial-scm.org/D2140
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 12:55:50 -0800] rev 36038
py3: pass system string to socket.getservbyname
Differential Revision: https://phab.mercurial-scm.org/D2139
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 12:42:10 -0800] rev 36037
run-tests: report tests that exception occurred in
We now record the test that an exception occurred in. We put this
information to use by aggregating the count of failures in each
test. For each exception, the exception report now prints the total
number of tests having that exception and the test with the least
number of exceptions exhibiting that failure. The exception list
is now sorted by (total count, tests impacted, count of failures
in least failing test).
This allows us to:
* Assess how widespread a failure is. Some exceptions occur a lot
in a few tests. Others occur over many tests.
* Easily run a test exhibiting an exception without having to find
a failure in test output.
* Find and fix low hanging fruit (e.g. exceptions that are the
only failure in a test).
Here's an example of the new output:
199 (4 tests) /home/gps/src/hg/hgext/blackbox.py:191: %b requires a bytes-like object, or an object that implements __bytes__, not 'str' (test-devel-warnings.t - 1 total)
142 (19 tests) /home/gps/src/hg/hgext/mq.py:655: list indices must be integers or slices, not bytes (test-hardlinks.t - 1 total)
140 (20 tests) /home/gps/src/hg/mercurial/patch.py:296: string argument expected, got 'bytes' (test-audit-subrepo.t - 1 total)
101 (15 tests) /home/gps/src/hg/hgext/convert/convcmd.py:60: encode() argument 1 must be str, not bytes (test-convert-clonebranches.t - 1 total)
90 (2 tests) /home/gps/src/hg/hgext/mq.py:456: can't concat str to bytes (test-mq-qqueue.t - 1 total)
87 (2 tests) /home/gps/src/hg/mercurial/branchmap.py:380: %b requires a bytes-like object, or an object that implements __bytes__, not 'FileNotFoundError' (test-branches.t - 2 total)
85 (22 tests) /home/gps/src/hg/mercurial/sshpeer.py:223: cannot convert 'UUID' object to bytes (test-bundle2-pushback.t - 1 total)
1 (1 tests) /home/gps/src/hg/mercurial/formatter.py:254: %b requires a bytes-like object, or an object that implements __bytes__, not 'str' (test-debugextensions.t - 2 total)
1 (1 tests) /home/gps/src/hg/hgext/convert/convcmd.py:420: startswith first arg must be str or a tuple of str, not bytes (test-convert-authormap.t - 2 total)
1 (1 tests) /home/gps/src/hg/mercurial/revlog.py:797: '>=' not supported between instances of 'NoneType' and 'int' (test-unionrepo.t - 1 total)
1 (1 tests) /home/gps/src/hg/hgext/show.py:129: %b requires a bytes-like object, or an object that implements __bytes__, not 'str' (test-show.t - 1 total)
Differential Revision: https://phab.mercurial-scm.org/D2138
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 10:52:13 -0800] rev 36036
py3: use raw string for file open mode
Otherwise the module importer rewrites it to bytes on Python 3,
which angers Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2137
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 11 Feb 2018 10:49:00 -0800] rev 36035
py3: convert content-type to bytes
This fixes the exception:
TypeError: %b requires a bytes-like object, or an object that
implements __bytes__, not 'str'
On the line:
ui.debug('Content-Type: %s\n' % content_type)
And it prevents additional exceptions that use the content_type
variable later.
Differential Revision: https://phab.mercurial-scm.org/D2136
Josef 'Jeff' Sipek <jeffpc@josefsipek.net> [Sun, 11 Feb 2018 18:32:37 -0500] rev 36034
gpg: print unknown key IDs in their entirety
Shortening the key is nice in theory but it results in ambiguity which can
be exploited. Therefore, when encountering an unknown key ID we should
print the whole ID returned by gpg. This may or may not be the whole key,
however it will match the user preference set in gpg configuration.
Furthermore, the key ID shortening had a couple of issues:
(1) it truncated the key ID (dropping the last digit and outputting only 15
hex digits) making it very hard to find the correct key on a key server
(2) since only 15 digits were fed into shortkey(), it always emitted the
ui.debug() warning
Denis Laxalde <denis@laxalde.org> [Sun, 11 Feb 2018 14:35:35 +0100] rev 36033
tests: fix check for --graph option in test-log-linerange.t
Previous test about incompatibility of --line-range and --graph options
was problematic because, even without --graph option, the command would
have failed because specified path (dir/baz) did not exist as it got
dropped in previous test statements. New test statements should work
without --graph. This prepares for making --line-range compatible with
--graph option.
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:25:53 +0530] rev 36032
py3: use "%d" instead of "%s" for integers
Differential Revision: https://phab.mercurial-scm.org/D2135
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:19:07 +0530] rev 36031
py3: replace file() with open() in test-contrib.t
file() is not present in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2134
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:14:00 +0530] rev 36030
py3: replace file() with open() in test-eol.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2129
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:13:11 +0530] rev 36029
py3: replace file() with open() in test-extdiff.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2128
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:12:28 +0530] rev 36028
py3: replace file() with open() in test-fileset.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2127
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:11:45 +0530] rev 36027
py3: replace file() with open() in test-import-bypass.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2126
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:53:47 +0530] rev 36026
py3: replace file() with open() in test-import-eol.t
file() is not present in Python 3.
This patch also adds b'' prefixes to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2125
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:09:37 +0530] rev 36025
py3: replace file() with open() in test-import-git.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2124
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:08:40 +0530] rev 36024
py3: replace file() with open() in test-import.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2123
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:07:09 +0530] rev 36023
py3: replace file() with open() in test-mactext.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2122
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:06:04 +0530] rev 36022
py3: replace file() with open() in test-mq-missingfiles.t
file() is not present in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2121
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:04:21 +0530] rev 36021
py3: replace file() with open() in test-mq-qimport.t
file() is not present in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2120
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:03:50 +0530] rev 36020
py3: replace file() with open() in test-patch-offset.t
file() is not present in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2119
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:03:17 +0530] rev 36019
py3: replace file() with open() in test-relink.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2118
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:02:14 +0530] rev 36018
py3: replace file() with open() in test-subrepo-missing.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2117
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:01:25 +0530] rev 36017
py3: replace file() with open() in test-tag.t
file() is not present in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2116
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:00:21 +0530] rev 36016
py3: replace file() with open() in test-transplant.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2115
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 16:59:35 +0530] rev 36015
py3: replace file() with open() in test-walk.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2114
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 16:58:22 +0530] rev 36014
py3: replace file() with open() in test-win32text.t
This patch also adds b'' prefix to make sure we write bytes on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2113
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 16:56:47 +0530] rev 36013
py3: replace file() with open() in test-convert-p4-filetypes.t
file() is not present in Python 3. While I was here, I added b'' prefix to make
sure we write things correctly in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2112
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:30:42 +0530] rev 36012
py3: replace file() with open() in test-convert-mtn.t
While I was here, I added b'' prefixes to make sure we write things correctly in
bytes mode on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2111
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 11 Feb 2018 17:30:21 +0530] rev 36011
py3: replace file() with open() in test-clone.t
While I was here, I made sure we write things correctly in bytes mode.
Differential Revision: https://phab.mercurial-scm.org/D2110
Yuya Nishihara <yuya@tcha.org> [Tue, 06 Feb 2018 22:55:02 +0900] rev 36010
merge: cut import cycle at merge -> extensions
This seems less bad because checking fsmonitor looks like a temporary hack,
and cmdutil -> mergemod should be a valid dependency.
Yuya Nishihara <yuya@tcha.org> [Tue, 06 Feb 2018 22:36:38 +0900] rev 36009
subrepo: split non-core functions to new module
Resolves import cycle caused by subrepo -> cmdutil. Still we have another
cycle, cmdutil -> context -> subrepo, but where I think importing context
is wrong. Perhaps we'll need repo.makememctx().
Yuya Nishihara <yuya@tcha.org> [Wed, 07 Feb 2018 23:22:53 +0900] rev 36008
diff: remove fp.write() wrapper which drops label argument
It's no longer needed since we've split labeled write() from file-like
write().
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Jan 2018 15:54:18 +0900] rev 36007
log: pack filematcher and hunksfilter into changesetdiffer object
This is just a way of getting rid of clumsy makefilematcher/makehunksfilter
arguments. There might be a better abstraction, but I don't think this is bad.
This makes filematcher and hunksfilter available by default, but that should
be fine.
Yuya Nishihara <yuya@tcha.org> [Sun, 21 Jan 2018 15:50:24 +0900] rev 36006
log: drop dead code to concatenate --line-range patterns and pats
It's disabled since
2e45bbd3db7b, and the current implementation is unlikely
to be reused.