Augie Fackler <augie@google.com> [Tue, 29 Jan 2019 18:46:11 -0500] rev 41509
histedit: add templating support to histedit's rule file generation
This will allow users to customize the display of the rule list for the
free-form segment that we don't interpret. We've had users want to add things
like bookmark names or similar to the rule list as a convenience, which seems
reasonable.
Differential Revision: https://phab.mercurial-scm.org/D5742
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 01 Feb 2019 17:03:51 -0800] rev 41508
py3: account for demand import difference between Python versions
Our lazy importer for Python 3 will validate that modules are
loadable before returning a stub module object. This is different
from Python 2, which will always return a stub module object.
While we could change behavior of the Python 3 demand importer,
that seems like a problem for another day.
This commit teaches test-extension.t about that difference in
behavior.
Differential Revision: https://phab.mercurial-scm.org/D5798
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 01 Feb 2019 13:20:13 -0800] rev 41507
tests: use unimported modules in test-demandimport.py
contextlib isn't a good module to test because it is likely already
imported by code above. Let's use modules that shouldn't have been
imported. And let's verify that with asserts.
Differential Revision: https://phab.mercurial-scm.org/D5797
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 01 Feb 2019 16:47:29 -0800] rev 41506
py3: conditionalize test-demandimport.py for Python 3
The Python 3 lazy importer uses the LazyLoader that is part of
importlib.
On Python 3 and later, LazyLoader is implemented using a custom module
type that defines a __getattribute__ which triggers module loading.
Furthermore, there are additional differences as well. For example,
it appears that Python 3 will return an existing sys.modules
entry instead of constructing a new module object.
This commit adds additional test coverage for lazy importing
behavior to cover the differences between Python 2 and 3. This
reveals that the test and some lazy import functionality is kinda
busted. For example, the test assumes "contextlib" will be lazy.
But in reality an import before it has already imported contextlib!
There's definitely room to improve the behavior of the demand
importer code, both for Python 2 and 3. But at least the test
passes on Python 3 now.
Differential Revision: https://phab.mercurial-scm.org/D5796
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 01 Feb 2019 12:09:05 -0800] rev 41505
py3: replace print() with assert in test-demandimport.py
Behavior of demand imports behaves differently between Python 2 and 3.
.out files do not support conditional output the way that .t files do.
In order to make this test work on Python 3, we'll need to make the
test itself conditional.
The first step of this is to port the test to not use a .out file
to compare output.
Unfortunately, we can't easily use the unittest framework for
defining this test because putting import statements in functions
changes the behavior of the demand importer (at least on Python 2).
So, we effectively replace a bunch of print() with assert statements.
This makes the test a bit annoying to debug, as the test will
stop at first assertion failure. But we don't exactly have
a good alternative.
Differential Revision: https://phab.mercurial-scm.org/D5795
Pulkit Goyal <pulkit@yandex-team.ru> [Sat, 02 Feb 2019 04:49:42 +0530] rev 41504
py3: pass str into grp.getgrnam
grp.getgrnam expects str on Python 3.
This fixes test-acl.t on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5794
Pulkit Goyal <pulkit@yandex-team.ru> [Wed, 30 Jan 2019 03:50:31 +0530] rev 41503
montone: fix addition to list by using .append() instead of '+'
Differential Revision: https://phab.mercurial-scm.org/D5739
Augie Fackler <augie@google.com> [Wed, 30 Jan 2019 17:04:26 -0500] rev 41502
tests: give up and make setsockopt() calls optional in the output
I can't figure out what causes these calls to happen or not, and I
weary of dealing with them. End the madness for now by marking them
all as optional lines of output.
Differential Revision: https://phab.mercurial-scm.org/D5762
Augie Fackler <augie@google.com> [Thu, 31 Jan 2019 11:12:59 -0500] rev 41501
py3: fix test-remotefilelog-repack.t
This is uglier, but more obviously correct in my opinion. I guess
Python 3 doesn't hang on to the exception as long, which seems
reasonable.
Differential Revision: https://phab.mercurial-scm.org/D5781
Augie Fackler <augie@google.com> [Wed, 30 Jan 2019 19:43:43 -0500] rev 41500
tests: alter email `From` line to a value that's consistently parsed
Python2:
>>> email.header.decode_header('=?UTF-8?q?Rapha=C3=ABl=20Hertzog?= <hertzog@debian.org>')
[('Rapha\xc3\xabl Hertzog', 'utf-8'), ('<hertzog@debian.org>', None)]
Python3:
>>> email.header.decode_header('=?UTF-8?q?Rapha=C3=ABl=20Hertzog?= <hertzog@debian.org>')
[(b'Rapha\xc3\xabl Hertzog', 'utf-8'), (b' <hertzog@debian.org>', None)]
So alter the input to an input that parses to the same result
consistently. After skimming the relevant RFC (1342), I'm not sure if
what we had was valid, or how I could modify it to be more consistent.
Differential Revision: https://phab.mercurial-scm.org/D5769
Martin von Zweigbergk <martinvonz@google.com> [Thu, 31 Jan 2019 16:51:52 -0800] rev 41499
diff: drop duplicate filter of copies by destination
I'm pretty sure we don't need to filter copies by destination, at
least since the previous patch.
Differential Revision: https://phab.mercurial-scm.org/D5790
Martin von Zweigbergk <martinvonz@google.com> [Thu, 31 Jan 2019 16:32:54 -0800] rev 41498
diff: use match.intersectmatchers()
Differential Revision: https://phab.mercurial-scm.org/D5789
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 01 Feb 2019 09:13:39 -0800] rev 41497
tests: convert ParseError arguments to str on Python 3
Arguments internally are bytes. Printing the exception on Python 3
will include b'' prefixes. This test file uses a .out file, which
doesn't support conditional output. The easiest way to get this to
pass on Python 3 is to normalize the exception before printing so
there are no b'' prefixes.
Differential Revision: https://phab.mercurial-scm.org/D5793
Matt Harbison <matt_harbison@yahoo.com> [Thu, 31 Jan 2019 22:01:09 -0500] rev 41496
tests: quote $PYTHON for py3 support on Windows
Matt Harbison <matt_harbison@yahoo.com> [Thu, 31 Jan 2019 21:54:38 -0500] rev 41495
py3: byteify the --retest path of run-tests.py
Augie Fackler <augie@google.com> [Wed, 30 Jan 2019 19:18:20 -0500] rev 41494
subrepo: clean up lingering bytes/str issues in svn support
Path encoding is a little suspect in here, but it's not worse than it
was when we were on Python 2 only.
Subversion subrepo tests now pass in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5774
Martin von Zweigbergk <martinvonz@google.com> [Wed, 30 Jan 2019 16:14:39 -0800] rev 41493
tweakdefaults: set ui.relative-paths instead of command.status.relative
Differential Revision: https://phab.mercurial-scm.org/D5775
Martin von Zweigbergk <martinvonz@google.com> [Tue, 29 Jan 2019 15:37:35 -0800] rev 41492
status: introduce higher-level ui.relative-paths
The existing commands.status.relative trumps the new config. We need
to keep the existing config around for compatibility. However, I don't
think we need to introduce similar command-specific options for other
commands when they learn to respec ui.relative-paths.
Differential Revision: https://phab.mercurial-scm.org/D5746
Martin von Zweigbergk <martinvonz@google.com> [Tue, 29 Jan 2019 15:37:14 -0800] rev 41491
status: extract helper for producing relative or absolute path for UI
I put the helper in scmutil so it can be used by most modules. I would
have put it in utils.pathutil, but I think that's supposed to be
unaware of repos.
Differential Revision: https://phab.mercurial-scm.org/D5745
Navaneeth Suresh <navaneeths1998@gmail.com> [Thu, 31 Jan 2019 18:17:02 +0530] rev 41490
tags: avoid generating commit for an already deleted tag (
issue5752)
`$ hg tag --remove <tagname>` will keep on generating commits
regardless of checking whether the tag is deleted or not. I added a
a fix for `global` tags by aborting if `nullid` is already mapped
to the tag that is to be deleted.
Differential Revision: https://phab.mercurial-scm.org/D5780
Boris Feld <boris.feld@octobus.net> [Fri, 21 Dec 2018 17:10:07 +0100] rev 41489
watchman: detect nested mercurial repositories and abort
Disable fsmonitor on nested mercurial repositories. Only depth one
repositories are detected at the moment.
Differential Revision: https://phab.mercurial-scm.org/D5587
Boris Feld <boris.feld@octobus.net> [Fri, 21 Dec 2018 17:12:31 +0100] rev 41488
watchman: add verbose config knob
This new config knob allows to silent watchman log and warning messages when
watchman is unavailable.
Differential Revision: https://phab.mercurial-scm.org/D5586
Ludovic Chabant <ludovic@chabant.com> [Tue, 29 Jan 2019 22:59:15 -0800] rev 41487
extdiff: add --per-file and --confirm options
The new options lets the user control how the external program is run.
By default, Mercurial passes the 2 snapshot directories as usual, but
it can also run the program repeatedly on each file's snapshot pair,
and optionally prompt the user each time.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 30 Jan 2019 19:20:31 -0500] rev 41486
run-tests: sort the skip, failure and error lists in the final output
This will help keep the lists consistent, for comparison across runs.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 30 Jan 2019 17:07:58 -0800] rev 41485
tests: add Python 3 output for test-remotefilelog-gc.t
Python 3 raises a slightly different error on invalid paths.
Differential Revision: https://phab.mercurial-scm.org/D5773
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 30 Jan 2019 17:22:07 -0800] rev 41484
hg: raise Abort on invalid path
Currently, some os.path functions when opening repositories may
raise an uncaught TypeError or ValueError if the path is invalid.
Let's catch these exceptions and turn them into an Abort for
convenience.
Differential Revision: https://phab.mercurial-scm.org/D5772
Augie Fackler <augie@google.com> [Wed, 30 Jan 2019 19:29:32 -0500] rev 41483
subrepo: bytes/str cleanups on Git support
Git subrepo tests now pass on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5768
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 30 Jan 2019 16:54:34 -0800] rev 41482
tests: compare against a bytes in test-lock.py
skip-blame: just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5771
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 30 Jan 2019 16:53:12 -0800] rev 41481
tests: perform a shallow copy instead of a deep copy
Python 3 can't perform a deep copy because it looks like symbols
in the locals() namespace are not deep-copyable. For the curious,
somehow the deepcopy() is attempting to copy objects attached to
the unittest.* functions for the running test!
We don't use deepcopy() anywhere in the code base and a shallow
object copy should be sufficient to test lock copying.
Actually, I'm not sure why we even test this, as I couldn't find
copy.copy() being used for lock copying either. Who knows.
Differential Revision: https://phab.mercurial-scm.org/D5770
Augie Fackler <augie@google.com> [Wed, 30 Jan 2019 18:49:17 -0500] rev 41480
tests: make and use a new `svnurlof.py` helper for constructing svn urls
The previous trick of a Python oneliner and some subshells is too hard
to make portable, and this lets us consolidate some Windows-specific
logic down to a single place.
Differential Revision: https://phab.mercurial-scm.org/D5766
Augie Fackler <augie@google.com> [Wed, 30 Jan 2019 17:24:57 -0500] rev 41479
server: skip logging of ECONNRESET
I believe this was exposed by
5492dc20, because the sending of the 500
would have already failed and prevented this logging. On Python 3,
this will be a ConnectionResetError, which is a subtype of OSError,
which is why we check for both OSError and socket.error.
Bonus: this fixes a race in test-hgweb.t where sometimes the
ECONNRESET wouldn't happen, because now we just don't log those
errors.
Differential Revision: https://phab.mercurial-scm.org/D5764
Augie Fackler <augie@google.com> [Wed, 30 Jan 2019 18:32:11 -0500] rev 41478
git: a little pycompat.bytestring() love to make this code work in py3
Differential Revision: https://phab.mercurial-scm.org/D5765