diff hgext/mq.py @ 45865:d7a508a75d72

strip: move into core As discussed at the 5.2 sprint, replace strip extension by a core command, debugstrip. Obviously, the extension stays for backwards compatibility. As an implementation note, I moved the strip file as is into core, which is not done elsewhere, AFAIK. I could have inlined it into debugcommands, but that doesn't sound great. Differential Revision: https://phab.mercurial-scm.org/D9285
author Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
date Sun, 08 Nov 2020 16:23:35 -0500
parents 8c466bcb0879
children 89a2afe31e82
line wrap: on
line diff
--- a/hgext/mq.py	Sat Nov 07 16:36:19 2020 -0800
+++ b/hgext/mq.py	Sun Nov 08 16:23:35 2020 -0500
@@ -100,6 +100,7 @@
     revsetlang,
     scmutil,
     smartset,
+    strip,
     subrepoutil,
     util,
     vfs as vfsmod,
@@ -138,7 +139,7 @@
 
 # force load strip extension formerly included in mq and import some utility
 try:
-    stripext = extensions.find(b'strip')
+    extensions.find(b'strip')
 except KeyError:
     # note: load is lazy so we could avoid the try-except,
     # but I (marmoute) prefer this explicit code.
@@ -149,9 +150,9 @@
         def log(self, event, msgfmt, *msgargs, **opts):
             pass
 
-    stripext = extensions.load(dummyui(), b'strip', b'')
-
-strip = stripext.strip
+    extensions.load(dummyui(), b'strip', b'')
+
+strip = strip.strip
 
 
 def checksubstate(repo, baserev=None):