# HG changeset patch # User Matt Harbison # Date 1577726222 18000 # Node ID 5bbd770d13243434f95ff6bcb37aaf14eef0fd13 # Parent f9d29e1d3354e595a70f01faf3d5cba7373c5ef0 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 diff -r f9d29e1d3354 -r 5bbd770d1324 hgext/mq.py --- 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', {}))