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
F18925972: D21392.id.diff
Nov 9 2025, 7:15 PM
F18907425: D21392.diff
Nov 8 2025, 11:27 PM
F18798158: D21392.diff
Oct 17 2025, 5:56 AM
F18758638: D21392.id50922.diff
Oct 5 2025, 11:02 PM
F18742461: D21392.id.diff
Oct 2 2025, 7:24 PM
F18739983: D21392.diff
Oct 1 2025, 11:47 PM
F18696387: D21392.diff
Sep 27 2025, 7:27 AM
F18653673: D21392.id50921.diff
Sep 21 2025, 3:21 PM
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
Branch
hg2
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24740
Build 34118: Run Core Tests
Build 34117: arc lint + arc unit