# HG changeset patch # User Anton Shestakov # Date 1606308637 -3600 # Node ID 716063c7a37204077cf05ac96e1bffa388300d2c # Parent e5d91fd1f319cc4ec6adbc1b31f602f3a42d36e7 compat: wrap debugstrip from core hg if it exists Since the debugstrip command from core and strip command from the hgext.strip extension is now the same thing, we don't have to wrap them separately. Unless, of course, users have a copy of old (from hg 5.6 and earlier) hgext.strip laying around that they specifically want to use, but I don't think we want to support that use case. diff -r e5d91fd1f319 -r 716063c7a372 hgext3rd/evolve/__init__.py --- a/hgext3rd/evolve/__init__.py Thu Nov 19 08:28:45 2020 -0800 +++ b/hgext3rd/evolve/__init__.py Wed Nov 25 13:50:37 2020 +0100 @@ -1179,7 +1179,17 @@ finally: lockmod.release(tr, lock, wlock) -@eh.wrapcommand(b'strip', extension=b'strip', opts=[ +try: + from mercurial import strip + strip + stripcmd = b'debugstrip' + stripext = None +except ImportError: + # hg <= 5.6 (d7a508a75d72) + stripcmd = b'strip' + stripext = b'strip' + +@eh.wrapcommand(stripcmd, extension=stripext, opts=[ (b'', b'bundle', None, _(b"delete the commit entirely and move it to a " b"backup bundle")), ])