changeset 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 f9d29e1d3354
children ac3cb5e05a38
files hgext/mq.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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', {}))