# HG changeset patch # User Anton Shestakov # Date 1606308637 -3600 # Node ID fdc540a9b94bebb9458ce3f8c5f2c021a8fe82c6 # Parent 581203686284245a8f3a1083909e1ee845670897 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 581203686284 -r fdc540a9b94b hgext3rd/evolve/__init__.py --- a/hgext3rd/evolve/__init__.py Mon Nov 16 13:08:08 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")), ])