Page MenuHomePhabricator

Allow "hg arc-ls-markers" to run under Python 2 or Python 3
ClosedPublic

Authored by epriestley on Jul 6 2020, 10:29 PM.
Tags
None
Referenced Files
F13922120: D21392.diff
Fri, Oct 11, 4:52 AM
Unknown Object (File)
Wed, Oct 9, 1:39 PM
Unknown Object (File)
Wed, Oct 9, 1:39 PM
Unknown Object (File)
Wed, Oct 9, 1:39 PM
Unknown Object (File)
Mon, Oct 7, 10:19 PM
Unknown Object (File)
Tue, Sep 17, 2:06 PM
Unknown Object (File)
Sun, Sep 15, 6:19 AM
Unknown Object (File)
Sep 6 2024, 8:21 AM
Subscribers
None

Details

Summary

Ref T13546. See PHI1805. Currently, the "arc-ls-markers" extension doesn't run under Python 3:

  • some stuff needs "b'...'" to mark it as a byte string;
  • "dict.iteritems()" is gone in Python 3, and "mercurial.pycompat" isn't always available;
  • in Python 3, "json" refuses to print byte strings; and
  • the compiler caching behavior in Python 3 has changed.

Try to get these things working in the same way under Python 2 and Python 3.

Test Plan

Ran this command (with python as Python 2, locally):

$ python /usr/local/bin/hg --config 'extensions.arc-hg=/Users/epriestley/dev/core/lib/arcanist/support/hg/arc-hg.py' arc-ls-markers --

...and this command:

$ python3 /usr/local/bin/hg --config 'extensions.arc-hg=/Users/epriestley/dev/core/lib/arcanist/support/hg/arc-hg.py' arc-ls-markers --

..and saw the same output in both cases (previously, python3 ... fataled in various ways).

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable