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
--- a/hgext/mq.py Tue Dec 31 16:24:38 2019 -0500
+++ b/hgext/mq.py Mon Dec 30 12:17:02 2019 -0500
@@ -68,6 +68,7 @@
import os
import re
import shutil
+import sys
from mercurial.i18n import _
from mercurial.node import (
bin,
@@ -4277,8 +4278,9 @@
dotable(commands.table)
+ thismodule = sys.modules["hgext.mq"]
for extname, extmodule in extensions.extensions():
- if extmodule.__file__ != __file__:
+ if extmodule != thismodule:
dotable(getattr(extmodule, 'cmdtable', {}))