Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/extensions.py @ 40515:cfa564037789
extensions: include current version in "invalid version" message
It is "not so rare" for the mercurial version to be badly detected at build
time. In such case, version check for extensions gets confused.
To help pinpoint the error, we now include the Mercurial's version number in
the error message.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Fri, 20 Apr 2018 18:08:54 +0200 |
parents | 09a37a5d8f5d |
children | c93d046d4300 |
comparison
equal
deleted
inserted
replaced
40514:6e2a24550b7e | 40515:cfa564037789 |
---|---|
187 # compatibility. This gives extension authors a mechanism to have their | 187 # compatibility. This gives extension authors a mechanism to have their |
188 # extensions short circuit when loaded with a known incompatible version | 188 # extensions short circuit when loaded with a known incompatible version |
189 # of Mercurial. | 189 # of Mercurial. |
190 minver = getattr(mod, 'minimumhgversion', None) | 190 minver = getattr(mod, 'minimumhgversion', None) |
191 if minver and util.versiontuple(minver, 2) > util.versiontuple(n=2): | 191 if minver and util.versiontuple(minver, 2) > util.versiontuple(n=2): |
192 ui.warn(_('(third party extension %s requires version %s or newer ' | 192 msg = _('(third party extension %s requires version %s or newer ' |
193 'of Mercurial; disabling)\n') % (shortname, minver)) | 193 'of Mercurial (current: %s); disabling)\n') |
194 ui.warn(msg % (shortname, minver, util.version())) | |
194 return | 195 return |
195 log(' - validating extension tables: %s\n', shortname) | 196 log(' - validating extension tables: %s\n', shortname) |
196 _validatetables(ui, mod) | 197 _validatetables(ui, mod) |
197 | 198 |
198 _extensions[shortname] = mod | 199 _extensions[shortname] = mod |