comparison hgext/mq.py @ 44019:5bbd770d1324

mq: avoid using `__file__` to compare modules This fixes ~70 tests when using an oxidized executable, bringing the current failure count down to 92 (with 110 skips) when templates/ is copied next to the executable. Differential Revision: https://phab.mercurial-scm.org/D7778
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 30 Dec 2019 12:17:02 -0500
parents ce37b35d4843
children 2f290136b7d6
comparison
equal deleted inserted replaced
44018:f9d29e1d3354 44019:5bbd770d1324
66 66
67 import errno 67 import errno
68 import os 68 import os
69 import re 69 import re
70 import shutil 70 import shutil
71 import sys
71 from mercurial.i18n import _ 72 from mercurial.i18n import _
72 from mercurial.node import ( 73 from mercurial.node import (
73 bin, 74 bin,
74 hex, 75 hex,
75 nullid, 76 nullid,
4275 entry = extensions.wrapcommand(cmdtable, cmd, mqcommand) 4276 entry = extensions.wrapcommand(cmdtable, cmd, mqcommand)
4276 entry[1].extend(mqopt) 4277 entry[1].extend(mqopt)
4277 4278
4278 dotable(commands.table) 4279 dotable(commands.table)
4279 4280
4281 thismodule = sys.modules["hgext.mq"]
4280 for extname, extmodule in extensions.extensions(): 4282 for extname, extmodule in extensions.extensions():
4281 if extmodule.__file__ != __file__: 4283 if extmodule != thismodule:
4282 dotable(getattr(extmodule, 'cmdtable', {})) 4284 dotable(getattr(extmodule, 'cmdtable', {}))
4283 4285
4284 4286
4285 colortable = { 4287 colortable = {
4286 b'qguard.negative': b'red', 4288 b'qguard.negative': b'red',