changeset 5986:5578f21b43c1 stable

compat: use movedirstate() from core if on hg 5.9+
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 04 Aug 2021 00:46:06 +0300
parents b7cb6e46c9c6
children e97fbded40a5 056033a7689f
files hgext3rd/evolve/compat.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/compat.py	Wed Aug 04 00:45:25 2021 +0300
+++ b/hgext3rd/evolve/compat.py	Wed Aug 04 00:46:06 2021 +0300
@@ -12,6 +12,7 @@
     cmdutil,
     context,
     copies as copiesmod,
+    dirstate,
     hg,
     logcmdutil,
     merge as mergemod,
@@ -435,7 +436,9 @@
         return logcmdutil.changesetdisplayer(ui, repo,
                                              {b'template': default_spec}).show
 
-if True:
+if util.safehasattr(dirstate.dirstate, 'set_clean'):
+    movedirstate = scmutil.movedirstate
+else:  # hg <= 5.8 (8a50fb0784a9)
     # TODO: call core's version once we've dropped support for hg <= 4.9
     def movedirstate(repo, newctx, match=None):
         """Move the dirstate to newctx and adjust it as necessary.