changeset 4522:001eb0f11bcd stable

topic: add compatibility for writing copy metadata in changelog.add() As seen in hg 0e41f40b01cc.
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 17 Apr 2019 18:46:41 +0800
parents 5303b9128714
children 93c49ff40981 f6099a171a9d
files hgext3rd/topic/__init__.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Wed Apr 17 16:18:22 2019 +0800
+++ b/hgext3rd/topic/__init__.py	Wed Apr 17 18:46:41 2019 +0800
@@ -567,12 +567,18 @@
             self._extra[constants.extrakey] = ''
 
 def wrapadd(orig, cl, manifest, files, desc, transaction, p1, p2, user,
-            date=None, extra=None):
+            date=None, extra=None, p1copies=None, p2copies=None):
     if constants.extrakey in extra and not extra[constants.extrakey]:
         extra = extra.copy()
         del extra[constants.extrakey]
+    # hg <= 4.9 (0e41f40b01cc)
+    kwargs = {}
+    if p1copies is not None:
+        kwargs['p1copies'] = p1copies
+    if p2copies is not None:
+        kwargs['p2copies'] = p2copies
     return orig(cl, manifest, files, desc, transaction, p1, p2, user,
-                date=date, extra=extra)
+                date=date, extra=extra, **kwargs)
 
 # revset predicates are automatically registered at loading via this symbol
 revsetpredicate = topicrevset.revsetpredicate