changeset 5094:a2391f919141 stable

evolve: compatibility with copies.graftcopies() from hg 5.3
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 23 Jan 2020 19:33:40 +0700
parents fd1d12497fdb
children 2fcaee044a8c
files hgext3rd/evolve/evolvecmd.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/evolvecmd.py	Fri Nov 15 08:14:06 2019 -0800
+++ b/hgext3rd/evolve/evolvecmd.py	Thu Jan 23 19:33:40 2020 +0700
@@ -1009,8 +1009,12 @@
             repo.setparents(dest.node(), orig.node())
             repo.dirstate.write(tr)
             # fix up dirstate for copies and renames
-            copies.duplicatecopies(repo, repo[None], dest.rev(),
-                                   orig.p1().rev())
+            if util.safehasattr(copies, 'graftcopies'):
+                copies.graftcopies(repo[None], dest, orig.p1())
+            else:
+                # hg <= 5.2 (2f0a44c69e07)
+                copies.duplicatecopies(repo, repo[None], dest.rev(),
+                                       orig.p1().rev())
             dirstatedance(repo, dest, orig.node(), None)
         hint = _(b"see 'hg help evolve.interrupted'")
         raise error.InterventionRequired(_(b"unresolved merge conflicts"),