diff tests/testlib/retain-extras-ext.py @ 6493:e36883d88108

evolve: add a test to capture the expected behavior of retaining extras
author Jason R. Coombs <jaraco@jaraco.com>
date Thu, 25 May 2023 00:52:54 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/testlib/retain-extras-ext.py	Thu May 25 00:52:54 2023 +0200
@@ -0,0 +1,16 @@
+"""
+Wrap 'retained_extras_on_rebase' (from either mercurial or evolve) to retain
+the "useful" extra.
+"""
+
+from mercurial import rewriteutil
+
+try:
+    rewriteutil.retained_extras_on_rebase
+except AttributeError:
+    # install the compatibility layer on older version
+    from hgext3rd.evolve import compat
+    compat.retained_extras_on_rebase # silence linter
+
+def extsetup(ui):
+    rewriteutil.retained_extras_on_rebase.add(b'useful')