Martin von Zweigbergk <martinvonz@google.com> [Fri, 01 Feb 2019 22:28:55 -0800] rev 41575
config: introduce a new value for ui.relative-paths getting old behavior
The few places I've modified so far to respect ui.relative-paths have
traditionally defaulted showing the path from the repo root. However,
some commands (at least `hg files`) default to showing paths relative
to the cwd. Let's allow a special value for ui.relative-paths to
preserve the old behavior, so we can use that as default value for
it. I don't expect that anyone would want to set this value, so
perhaps we could have relied on it being unset, but I don't really
like behaviors that can only be achieved by a unset config option.
Differential Revision: https://phab.mercurial-scm.org/D5800
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 05 Feb 2019 21:31:33 +0300] rev 41574
py3: use pycompat.bytestr() on extra values because it can be int
One such example is {'close': 1} which marks a branch as closed.
This makes test-convert-mtn.t pass on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5864
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 05 Feb 2019 21:30:30 +0300] rev 41573
py3: add some b'' prefixes in hgext/convert/monotone.py
# skip-blame because just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5863
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 05 Feb 2019 21:29:55 +0300] rev 41572
py3: use '%d' for integers instead of '%s'
I think this is the last of these occurences because I have got the test passing
on python3 in a later patch.
Differential Revision: https://phab.mercurial-scm.org/D5862
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 05 Feb 2019 21:17:46 +0300] rev 41571
py3: add 1 new passing test found by buildbot
This will make py3 buildbot green again.
Differential Revision: https://phab.mercurial-scm.org/D5861
Martin von Zweigbergk <martinvonz@google.com> [Mon, 04 Feb 2019 21:23:44 -0800] rev 41570
merge: don't unnecessarily calculate absolute path
I think this also makes the code clearer (and prepares for a later
patch that replaces origpath()).
Differential Revision: https://phab.mercurial-scm.org/D5849
Martin von Zweigbergk <martinvonz@google.com> [Mon, 04 Feb 2019 21:21:55 -0800] rev 41569
merge: don't unnecessarily calculate backup path
Differential Revision: https://phab.mercurial-scm.org/D5848
Martin von Zweigbergk <martinvonz@google.com> [Sun, 03 Feb 2019 22:49:28 -0800] rev 41568
largefiles: drop "rel" prefix from filename variables
The prefixes were meant to indicate that these paths are repo-relative
as opposed to absolute. However, that's what the majority of paths in
our code base are, so "rel" made me think they were instead
cwd-relative. Let's just drop the prefixes.
Differential Revision: https://phab.mercurial-scm.org/D5847
Martijn Pieters <mj@octobus.net> [Mon, 21 Jan 2019 17:41:59 +0000] rev 41567
branchmap: add some clarifications and clean up flow
- Remove indentation where it is not needed.
- Swap the subset test branches to follow along logically and put the 'empty'
case last.
Differential Revision: https://phab.mercurial-scm.org/D5637
Martijn Pieters <mj@octobus.net> [Mon, 21 Jan 2019 16:37:23 +0000] rev 41566
branchmap: updating triggers a write
Rather than separate updating and writing, create a subclass that doesn't write
on update. This minimises chances we forget to write out updates somewhere.
This also makes refactoring and improving the branchmap functionality easier.
Differential Revision: https://phab.mercurial-scm.org/D5636
Martijn Pieters <mj@octobus.net> [Mon, 21 Jan 2019 16:04:48 +0000] rev 41565
branchmap: make branchcache responsible for reading
Encapsulate reading in a classmethod, to make it clear what kind of object is
being handled.
This is part of a stack of refactoring changes to help performance improvements
down the line.
Differential Revision: https://phab.mercurial-scm.org/D5635
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:10:07 -0800] rev 41564
attr: make some docstrings raw strings
This avoids a SyntaxWarning in Python 3.8 due to invalid
\ escapes.
Differential Revision: https://phab.mercurial-scm.org/D5817
Yuya Nishihara <yuya@tcha.org> [Sun, 27 Jan 2019 13:37:37 +0900] rev 41563
revset: leverage getintrange() helper in relation-subscript operation (API)
Now a range expression is parsed by a relation function itself since the
upper layer have no knowledge about the default first/last bounds.
Yuya Nishihara <yuya@tcha.org> [Sun, 27 Jan 2019 13:28:45 +0900] rev 41562
revset: allow to parse single integer as a range
Even though this wouldn't be any useful in followlines(), it helps to unify
range processing.
Yuya Nishihara <yuya@tcha.org> [Sun, 27 Jan 2019 13:18:53 +0900] rev 41561
revset: extract a helper to parse integer range
It's getting common. As a first step, this patch adds getintrange() and
makes followlines() use it.
I wanted to unify the error messages to make the function interface simple,
but I failed to phrase it briefly.
Kyle Lippincott <spectral@google.com> [Thu, 31 Jan 2019 14:47:34 -0800] rev 41560
commit: if interactive, look elsewhere for whitespace settings (BC)
Previously, when doing `commit -i`, we respected `diff.ignorews` and other
whitespace-related settings, which is probably unexpected. The primary reason
for this is to support hgext.record's commandline options, it's probably
accidental that the `[diff]` settings were also considered. See comments on
issue6042 and D5490. This can cause problems (
issue5839,
issue6042).
It is assumed by the author that the `[diff]` section is primarily for *viewing*
diffs, and that it is unlikely what people intend when attempting to commit or
revert.
With this change, if a user wants the behavior, they can clone their `[diff]`
settings to `commands.commit.interactive.<setting>`. This is thus a mild BC
change, but one I suspect is not going to be relied on by anyone.
Note: while doing a partial commit/revert, we do not know what command the user
is actually running. This means that the split extension, which ends up calling
into this code, will respect the `commands.commit.interactive.<setting>`
settings, and not a hypothetical `commands.split.interactive.<setting>`. This
*also* means that setting `commands.commit.interactive.ignoreblanklines`, for
example, will still cause
issue5839. Considering the highly unlikely chance that
a user actually sets `commands.commit.interactive.<setting>`, the author deems
this risk acceptable.
Differential Revision: https://phab.mercurial-scm.org/D5834
Kyle Lippincott <spectral@google.com> [Thu, 31 Jan 2019 14:29:24 -0800] rev 41559
diff: when looking for diff configs, support a configurable prefix
In a future commit, I want to make it possible to have the diff options pulled
from (as an example) `commands.commit.interactive.ignorews`; previously we only
supported this for customizable sections (so this would have needed a
`commit-interactive` section and been named `commit-interactive.ignorews`, which
felt a bit weird.
Differential Revision: https://phab.mercurial-scm.org/D5833
Kyle Lippincott <spectral@google.com> [Thu, 31 Jan 2019 14:27:25 -0800] rev 41558
config: extract diff-related coreconfigitem()s to a helper method
We already have 'annotate' and 'diff' that use the same set of options, and I
want to add more in a followup commit, so I'm attempting to reduce maintenance
burden and duplication by making it possible to register all of them at once.
Differential Revision: https://phab.mercurial-scm.org/D5832
Kyle Lippincott <spectral@google.com> [Mon, 28 Jan 2019 18:05:05 -0800] rev 41557
commit: ignore diff whitespace settings when doing `commit -i` (
issue5839)
Previously, we respected options like `diff.ignoreblanklines` and
`diff.ignorews`. This can cause problems when the user is attempting to
actually commit the blank line change. Specifically, the split extension can get
into an infinite loop because it detects that the working copy is not clean, but
when we get the diff we don't see the changes, so it just skips popping up the
chunk selection flow, saying there's no changes to record.
These options are primarily meant for viewing diffs; it is highly unlikely that
someone is actually intending to add extraneous whitespace and have it ignored
if they attempt to interactively commit (but *not* ignored if they
non-interactively commit).
Differential Revision: https://phab.mercurial-scm.org/D5744
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 14:43:26 -0800] rev 41556
tests: add syntax warnings on Python 3.8 in python-zstandard
These are warnings from upstream test code. Let's just acknowledge them
for now. These should go away in a future python-zstandard release :)
Differential Revision: https://phab.mercurial-scm.org/D5846
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 14:38:23 -0800] rev 41555
check-py3-compat: manually format and print warnings
The warnings mechanism may print to stderr on Python 3. Independent buffering
of stdout and stderr can lead to warnings output not being printed properly.
This commit traps warnings when executing individual files and prints
warnings to stdout so output is deterministic.
Differential Revision: https://phab.mercurial-scm.org/D5845
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 14:25:00 -0800] rev 41554
check-py3-compat: provide filename to ast.parse()
This ensures any warning/error messages print a valid filename instead of
potentially '<unknown>'.
Differential Revision: https://phab.mercurial-scm.org/D5844
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 14:22:50 -0800] rev 41553
doc: escape backslash
This avoids a SyntaxWarning on Python 3.8 due to invalid \ escape.
Differential Revision: https://phab.mercurial-scm.org/D5843
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 14:16:52 -0800] rev 41552
testparseutil: escape backslash in docstring
This is funky. This inline Python code is part of a docstring, which
means the string is interpreted first. So any backslashes need double
escaping. So even though this is already a br'', we still need to escape.
Differential Revision: https://phab.mercurial-scm.org/D5842
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 14:14:25 -0800] rev 41551
tests: use raw strings in test-help.t
This avoids SyntaxWarning on Python 3.8 due to invalid \ escapes.
Differential Revision: https://phab.mercurial-scm.org/D5841
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 14:10:10 -0800] rev 41550
tests: escape backslash in makepatch.py inline file
This avoids some SyntaxWarning on Python 3.8 due to unescaped \.
Differential Revision: https://phab.mercurial-scm.org/D5840
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 14:05:26 -0800] rev 41549
tests: use raw strings in test-cbor.py
To avoid SyntaxWarning on Python 3.8 due to invalid \ escape.
Differential Revision: https://phab.mercurial-scm.org/D5839
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 14:03:15 -0800] rev 41548
showstack: use raw docstring
Avoids a SyntaxWarning on Python 3.8 due to invalid \ escape.
Differential Revision: https://phab.mercurial-scm.org/D5838
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 14:00:57 -0800] rev 41547
tests: use raw string in test-check-code.t
To avoid a SyntaxWarning on Python 3.8 due to invalid \ escape.
Differential Revision: https://phab.mercurial-scm.org/D5837
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:47:13 -0800] rev 41546
run-tests: set attributes in sorted order
Python 3.8 preserves insertion order in serialized output
(https://bugs.python.org/
issue34160). Older Pythons serialized
in sorted order.
Let's make insertion order sorted so behavior is consistent across
Python versions.
Differential Revision: https://phab.mercurial-scm.org/D5831
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:41:10 -0800] rev 41545
revetbenchmarks: use raw string for regular expression with escapes
This avoids a SyntaxWarning on Python 3.8.
Differential Revision: https://phab.mercurial-scm.org/D5830
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:38:33 -0800] rev 41544
check-code: use raw string
This avoids a SyntaxWarning in Python 3.8.
Differential Revision: https://phab.mercurial-scm.org/D5829
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:37:09 -0800] rev 41543
tests: use raw strings for regular expressions with escapes
Avoids SyntaxWarning on Python 3.8.
Differential Revision: https://phab.mercurial-scm.org/D5828
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:35:55 -0800] rev 41542
drawdag: use raw strings for docstrings
Avoids SyntaxWarning for invalid \ escape on Python 3.8.
Differential Revision: https://phab.mercurial-scm.org/D5827
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:34:11 -0800] rev 41541
check-config: use raw strings for regular expressions
This avoids SyntaxWarning on Python 3.8 for invalid \ escapes.
Differential Revision: https://phab.mercurial-scm.org/D5826
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:32:30 -0800] rev 41540
run-tests: use raw strings for regular expressions
Avoids SyntaxWarning due to invalid \ escape on Python 3.8.
Differential Revision: https://phab.mercurial-scm.org/D5825
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:31:19 -0800] rev 41539
check-commit: use raw string for regular expression
Avoids SyntaxWarning on Python 3.8.
Differential Revision: https://phab.mercurial-scm.org/D5824
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:13:05 -0800] rev 41538
configitems: use raw strings for hidden-{command,topic} items
These strings are regular expressions. The "\." needs to be
string escaped. We use raw strings to avoid doing that and the
SyntaxWarning we'd receive otherwise on Python 3.8.
Differential Revision: https://phab.mercurial-scm.org/D5822
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:03:10 -0800] rev 41537
convert: use raw string for regular expressions
This avoids a SyntaxWarning on Python 3.8.
Differential Revision: https://phab.mercurial-scm.org/D5821
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:01:49 -0800] rev 41536
graphmod: use raw string
Needed to avoid a SyntaxWarning due to unescaped \ in Python 3.8.
Differential Revision: https://phab.mercurial-scm.org/D5820
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:00:52 -0800] rev 41535
crecord: use raw string for regular expression
\s emits a SyntaxWarning in Python 3.8. Use a raw string to
avoid escaping the \.
Differential Revision: https://phab.mercurial-scm.org/D5819
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 08:59:11 -0800] rev 41534
patch: properly escape \ in string literals
Python 3.8 will emit a SyntaxWarning for str/bytes with invalid
escapes. This commit addresses 4 occurrences where we had a bare
\ in a str/bytes.
Differential Revision: https://phab.mercurial-scm.org/D5818
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:07:00 -0800] rev 41533
global: make some docstrings raw strings
Python 3.8 emits a SyntaxWarning when a str/bytes contains invalid
\ escapes. Various docstrings in our code base contain invalid
\ escapes.
This commit turns those docstrings into raw strings.
Differential Revision: https://phab.mercurial-scm.org/D5816
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 08:54:30 -0800] rev 41532
global: use raw strings for regular expressions with escapes
Escape sequences like \w, \s, and \d are technically invalid
in str/bytes. This became a deprecation warning in Python 3.6
(https://bugs.python.org/
issue27364). Python 3.8 bumps it to
a SyntaxWarning (https://bugs.python.org/
issue32912), which is
non-silent by default.
This commit changes a number of regular expressions to use
br'' so regular expression special sequences don't need \\
literals. This fixes roughly half of the SyntaxWarning we
see in the code base with Python 3.8.
Differential Revision: https://phab.mercurial-scm.org/D5815
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:29:25 -0800] rev 41531
tests: add optional Python 2.7 deprecation output
pip 19 will emit a Python 2.7 deprecation warning when used with
Python 2.7. Let's add that as optional output to our pip test.
Differential Revision: https://phab.mercurial-scm.org/D5823
Augie Fackler <augie@google.com> [Mon, 04 Feb 2019 17:06:22 -0500] rev 41530
tests: fix test-match.py on Python3
# skip-blame just b prefixes
Differential Revision: https://phab.mercurial-scm.org/D5835
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 04 Feb 2019 20:35:21 +0300] rev 41529
merge with stable
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 04 Feb 2019 18:14:03 +0300] rev 41528
match: teach diffmatcher.visitdir() to return 'all' if possible
This patch teaches differencematcher.visitdir() to return 'all' when
m1.visitdir() returns 'all' and m2 does not matches.
Before this patch, from a differencematcher.visitdir(), we always returned
either True or False. We never returned 'all' even when we can. This causes
problem when m1 and m2 of a differencematcher are themselves differencematcher.
In that case, we try to check:
`if self._m2_.visitdir(dir) == 'all'`
which will never be 'all' even though it can be.
This leads to iterating over a lot of sub-directory manifest, even though we
don't want to while extending a narrow clone. I am yet to measure the impact of
this but calculating manifest was taking ~50-60 seconds, so this should
definitely save some of time there.
Differential Revision: https://phab.mercurial-scm.org/D5814
Boris Feld <boris.feld@octobus.net> [Sun, 03 Feb 2019 10:01:43 +0100] rev 41527
py3: use integer division instead of `int(...)` call
Changeset
38a82e0333c9 and
7f853549823b introduced explicit conversion to
integer to work around the division behavior change from python2 to python3.
Using the integer division operator is a simpler and clearer way to achieve
this.
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 03 Feb 2019 17:15:11 +0530] rev 41526
py3: add some b'' prefixes in test-notify.t
# skip-blame as just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5811
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 03 Feb 2019 17:05:47 +0530] rev 41525
py3: use pycompat.long in hgext/convert/monotone.py
Differential Revision: https://phab.mercurial-scm.org/D5810
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 03 Feb 2019 16:59:46 +0530] rev 41524
py3: add three new passing tests found by buildbot
Differential Revision: https://phab.mercurial-scm.org/D5809
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 03 Feb 2019 16:38:47 +0530] rev 41523
py3: do a fsdecode(), fsencode() dance in posix.py
We have to use `fsdecode()` instead of sysstr() because they are abusing
`PyUnicode_EncodeFSDefault()` to get back bytes.
Differential Revision: https://phab.mercurial-scm.org/D5808
Taapas Agrawal <taapas2897@gmail.com> [Sun, 03 Feb 2019 01:02:24 +0530] rev 41522
revert: add prompt before undeleting a file in -i (
issue6008)
This adds a prompt that asks whether or not a removed file is to be undeleted
in `hg revert -i`.
Differential Revision: https://phab.mercurial-scm.org/D5803
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Feb 2019 13:16:46 -0800] rev 41521
py3: add alternate output on Python 3
This is basically the same deal as D5806. Python 3's exception
printing output is different.
We had to tweak the regular expression to match appropriately,
hence the added line of output.
Differential Revision: https://phab.mercurial-scm.org/D5807
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Feb 2019 13:13:22 -0800] rev 41520
py3: add Python 3 output for test-flagprocessor.t
The exception is being generated from ui.traceback(), which
simply calls traceback.format_*() to format exceptions. Since
the output from the standard library has changed, there is
seemingly not much we can do about it. So this commit adds
conditional output depending on the Python version.
I'm not thrilled about b'' appearing in user-facing output.
Can we do something better here?
Differential Revision: https://phab.mercurial-scm.org/D5806
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Feb 2019 11:49:26 -0800] rev 41519
zeroconf: Python 3 porting of vendored library
A quick glance through this module reveals that most of it "just works"
on Python 3 with the source transformer active. There are a few
places where we need to ensure we're using str.
Differential Revision: https://phab.mercurial-scm.org/D5804
Anton Shestakov <av6@dwimlabs.net> [Tue, 22 Jan 2019 14:22:25 +0800] rev 41518
relnotes: more improvements
Yuya Nishihara <yuya@tcha.org> [Sat, 02 Feb 2019 15:26:51 +0900] rev 41517
py3: don't use universal_newlines in svnsubrepo
On Python 3, it means text=True without any specific encoding, which is
pretty bad. Instead, use util.fromnativeeol() to translate CR+LF to LF
without encoding conversion.
Yuya Nishihara <yuya@tcha.org> [Sat, 02 Feb 2019 15:21:35 +0900] rev 41516
py3: remove unneeded fsencode() from gitsubrepo
Here p.stdout isn't a TextIO. read() must return bytes.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 25 Jan 2019 14:41:53 -0800] rev 41515
debugcommands: add a debugpathcopies command
I've been working on storing copy metadata in the changelog instead of
the filelog and this has been useful for debugging.
Do we usually add tests for these?
Differential Revision: https://phab.mercurial-scm.org/D5791
Augie Fackler <augie@google.com> [Fri, 01 Feb 2019 20:21:04 -0500] rev 41514
py3: record several more passes from the buildbot ratchet
Differential Revision: https://phab.mercurial-scm.org/D5799
Martin von Zweigbergk <martinvonz@google.com> [Wed, 30 Jan 2019 17:05:09 -0800] rev 41513
grep: respect ui.relative-paths
Differential Revision: https://phab.mercurial-scm.org/D5777
Martin von Zweigbergk <martinvonz@google.com> [Wed, 30 Jan 2019 16:59:31 -0800] rev 41512
grep: move writing of path outside of column loop
This will make the next patch simpler.
Differential Revision: https://phab.mercurial-scm.org/D5776