Closed Bug 1281920 Opened 4 years ago Closed 4 years ago

mercurial-setup yields AttributeError: 'colorui' object has no attribute 'hasconfig'

Categories

(Developer Services :: Mercurial: configwizard, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jdm, Assigned: gps)

References

Details

(Keywords: regression)

Attachments

(3 files)

Attached file Console output
When I run `./mach mercurial-setup`, I consistently hit a python error after it updates version-control-tools.

jdm@nightblogger:~/mozilla-central$ hg --version
Mercurial Distributed SCM (version 3.6)

jdm@nightblogger:~/mozilla-central$ uname -a
Linux nightblogger 3.19.0-56-generic #62~14.04.1-Ubuntu SMP Fri Mar 11 11:03:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
According to https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-January/078022.html, hasconfig was added about a month after 3.6 was released. We should either enforce a minimum supported mercurial version or monkeypatch to add it.
In fact, configwizard claims MINIMUM_SUPPORTED_VERSION is 3.5.0 (but OLDEST_NON_LEGACY_VERSION is 3.7.3), but this exception happens before we get to the version checks.
Having monkeypatched hasconfig, ironically I'm now hitting the same problem with versiontuple which apparently didn't make it into 3.6.
Fallout from rewriting the config wizard in bug 1277406. I'll code up some patches.
Assignee: nobody → gps
Status: NEW → ASSIGNED
Component: mach → General
Depends on: 1277406
Keywords: regression
Product: Core → Developer Services
ui.hasconfig() was added in 3.7. Rather than port consumers to use
old APIs, just implement the function when it isn't present.

This fixes a number of test failures on 3.5 and 3.6 but exposes
another test failure related to versiontuple being missing.

Review commit: https://reviewboard.mozilla.org/r/60484/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/60484/
Attachment #8764783 - Flags: review?(glob)
Attachment #8764784 - Flags: review?(glob)
util.versiontuple was added in Mercurial 3.7. The lack of it was
causing test failures when executed on hg < 3.7. Backport it if
necessary so the config wizard runs on older hg versions.

With this change, tests appear to pass on 3.5 and 3.6 with only
cosmetic differences (whitespace differences after prompt text
for reasons unknown to me).

Review commit: https://reviewboard.mozilla.org/r/60486/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/60486/
Component: General → Mercurial: configwizard
Version: unspecified → Trunk
Duplicate of this bug: 1280401
Comment on attachment 8764783 [details]
configwizard: implement ui.hasconfig (bug 1281920);

https://reviewboard.mozilla.org/r/60484/#review57568
Attachment #8764783 - Flags: review?(glob) → review+
Comment on attachment 8764784 [details]
configwizard: backport util.versiontuple (bug 1281920);

https://reviewboard.mozilla.org/r/60486/#review57570
Attachment #8764784 - Flags: review?(glob) → review+
Pushed by gszorc@mozilla.com:
https://hg.mozilla.org/hgcustom/version-control-tools/rev/fe53e3588370
configwizard: implement ui.hasconfig ; r=glob
https://hg.mozilla.org/hgcustom/version-control-tools/rev/64fecad4858e
configwizard: backport util.versiontuple ; r=glob
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.