Closed Bug 1281920 Opened 4 years ago Closed 4 years ago

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


(Developer Services :: Mercurial: configwizard, defect)

Not set


(Not tracked)



(Reporter: jdm, Assigned: gps)



(Keywords: regression)


(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, 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
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:
See other reviews:
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:
See other reviews:
Component: General → Mercurial: configwizard
Version: unspecified → Trunk
Duplicate of this bug: 1280401
Comment on attachment 8764783 [details]
configwizard: implement ui.hasconfig (bug 1281920);
Attachment #8764783 - Flags: review?(glob) → review+
Comment on attachment 8764784 [details]
configwizard: backport util.versiontuple (bug 1281920);
Attachment #8764784 - Flags: review?(glob) → review+
Pushed by
configwizard: implement ui.hasconfig ; r=glob
configwizard: backport util.versiontuple ; r=glob
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.