run-tests: convert the remaining os.system() call to Unicode
I wasn't able to hit this path in
543a788eea2d, but I have now when I
accidentally left off `--local`.
py3: partially fix pager spawning on Windows
Previously, spinning up the pager crashed because the command and environment
was in bytes. (See also
543a788eea2d.) Now it aborts with an invalid handle:
$ HGMODULEPOLICY=py py -3 ../hg --traceback --config extensions.evolve=!
Traceback (most recent call last):
File "c:\Users\Matt\projects\hg\mercurial\ui.py", line 967, in _write
self.fout.write(''.join(msgs))
File "c:\Users\Matt\projects\hg\mercurial\windows.py", line 173, in write
self.fp.write(s[start:end])
OSError: [WinError 6] The handle is invalid
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Users\Matt\projects\hg\mercurial\scmutil.py", line 164, in callcatch
return func()
File "c:\Users\Matt\projects\hg\mercurial\dispatch.py", line 350, in _runcatchfunc
return _dispatch(req)
File "c:\Users\Matt\projects\hg\mercurial\dispatch.py", line 930, in _dispatch
return commands.help_(ui, 'shortlist')
File "c:\Users\Matt\projects\hg\mercurial\commands.py", line 2930, in help_
ui.write(formatted)
File "c:\Users\Matt\projects\hg\mercurial\ui.py", line 948, in write
self._writenobuf(*args, **opts)
File "c:\Users\Matt\projects\hg\mercurial\ui.py", line 960, in _writenobuf
self._write(*msgs, **opts)
File "c:\Users\Matt\projects\hg\mercurial\ui.py", line 969, in _write
raise error.StdioError(err)
mercurial.error.StdioError: [Errno 9] The handle is invalid
abort: The handle is invalid
The interesting bit here is that the abort message is marked with ANSI color,
but the OSError is not.
censor: rename loop variable to silence pyflakes warning
hgext/censor.py:92: list comprehension redefines 'c' from line 88
py3: add b'' prefixes in tests/test-hgweb-no-request-uri.t
# skip-blame because just b'' prefixes.
Differential Revision: https://phab.mercurial-scm.org/D4611
py3: add b'' prefixes in tests/test-hgweb-no-path-info.t
# skip-blame because just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D4610
py3: add b'' prefixes in tests/test-hgweb-non-interactive.t
# skip-blame because just b'' prefix
Differential Revision: https://phab.mercurial-scm.org/D4609
py3: use codecs.encode() to encode in rot-13 encoding
The other occurence will need some more love as description is bytes by default
and we need to decode it and then encode it.
Differential Revision: https://phab.mercurial-scm.org/D4608
py3: add two passing tests to whitelist found by buildbot
The buildbot found these two new passing tests on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D4607
phabricator: mark extension as experimental for now
I don't want us to commit to this having a stable interface just yet.
Differential Revision: https://phab.mercurial-scm.org/D4605
phabricator: fix templating bug by using hybriddict
Differential Revision: https://phab.mercurial-scm.org/D4604
phabricator: add tests of templatekeyword
Having tests is paying off: I found a bug and now it'll be easy to
fix!
Differential Revision: https://phab.mercurial-scm.org/D4603
phabricator: move extension from contrib to hgext
It's well-enough tested now and widely enough used I think we should
ship it.
Differential Revision: https://phab.mercurial-scm.org/D4602
tests: add some basic tests of phabricator interactions
This uses the vcr library to avoid hitting phabricator on every test
execution. In order to generate new recordings (vcr calls them
cassettes) just remove the appropriate json file, and the test will
regenerate it. It's not my favorite way to test things, but it'll let
us have test coverage on the phabricator extension that'll make it
resilient to refactors in core and let us move it to hgext.
In the future, it'd probably be better to have a docker container we
can spin up for creating the vcr recordings, but for now this is
enough better than nothing I'm going to declare victory.
Coverage reports about 73% of the extension is now covered.
Differential Revision: https://phab.mercurial-scm.org/D4601
phabricator: add support for using the vcr library to mock interactions
I'll use this in an upcoming test. The decorator dancing in this is
more complicated than I'd like, but it beats repeating all this code
everywhere.
Differential Revision: https://phab.mercurial-scm.org/D4600
keepalive: work around slight deficiency in vcr
VCR's response type doesn't define the will_close attribute. Let's
just have keepalive default to closing the socket if the will_close
attribute is missing.
Differential Revision: https://phab.mercurial-scm.org/D4599