diff mercurial/registrar.py @ 45880: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 6a0e7bf73bb2
children 89a2afe31e82
line wrap: on
line diff
--- a/mercurial/registrar.py	Sat Nov 07 16:36:19 2020 -0800
+++ b/mercurial/registrar.py	Sun Nov 08 16:23:35 2020 -0500
@@ -234,6 +234,12 @@
             self._table[name] = func, list(options)
         return func
 
+    def rename(self, old, new):
+        """rename a command. Used to add aliases, debugstrip ->
+        debugstrip|strip
+        """
+        self._table[new] = self._table.pop(old)
+
 
 INTENT_READONLY = b'readonly'