test-compat: merge mercurial-4.5 into mercurial-4.4 mercurial-4.4
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 03 Sep 2018 22:59:19 +0200
branchmercurial-4.4
changeset 4081 20dcc92c285f
parent 4076 f9a850018daa (current diff)
parent 4080 7567b58390d7 (diff)
child 4082 185770c10a4e
child 4113 5b35899b9173
test-compat: merge mercurial-4.5 into mercurial-4.4
tests/test-evolve-issue5832.t
tests/test-grab.t
--- a/hgext3rd/topic/__init__.py	Mon Sep 03 22:06:12 2018 +0200
+++ b/hgext3rd/topic/__init__.py	Mon Sep 03 22:59:19 2018 +0200
@@ -134,6 +134,7 @@
     registrar,
     scmutil,
     templatefilters,
+    templatekw,
     util,
 )
 
@@ -227,7 +228,9 @@
                       default=None,
             )
 
+# we need to do old style declaration for <= 4.5
 templatekeyword = registrar.templatekeyword()
+post45template = 'requires=' in templatekeyword.__doc__
 
 def _contexttopic(self, force=False):
     if not (force or self.mutable()):
@@ -350,6 +353,8 @@
 
     cmdutil.summaryhooks.add('topic', summaryhook)
 
+    if not post45template:
+        templatekw.keywords['topic'] = topickw
     # Wrap workingctx extra to return the topic name
     extensions.wrapfunction(context.workingctx, '__init__', wrapinit)
     # Wrap changelog.add to drop empty topic
@@ -521,11 +526,16 @@
             'topics', 'topic', namemap=_namemap, nodemap=_nodemap,
             listnames=lambda repo: repo.topics))
 
-@templatekeyword('topic', requires={'ctx'})
-def topickw(context, mapping):
-    """:topic: String. The topic of the changeset"""
-    ctx = context.resource(mapping, 'ctx')
-    return ctx.topic()
+if post45template:
+    @templatekeyword('topic', requires={'ctx'})
+    def topickw(context, mapping):
+        """:topic: String. The topic of the changeset"""
+        ctx = context.resource(mapping, 'ctx')
+        return ctx.topic()
+else:
+    def topickw(**args):
+        """:topic: String. The topic of the changeset"""
+        return args['ctx'].topic()
 
 def wrapinit(orig, self, repo, *args, **kwargs):
     orig(self, repo, *args, **kwargs)
--- a/tests/test-evolve-issue5832.t	Mon Sep 03 22:06:12 2018 +0200
+++ b/tests/test-evolve-issue5832.t	Mon Sep 03 22:59:19 2018 +0200
@@ -192,7 +192,7 @@
   $ echo l > l
   $ hg ci -Aqm "added l"
   $ hg pick -r 1b24879c5c3c
-  grabbing 1:1b24879c5c3c "added a"
+  picking 1:1b24879c5c3c "added a"
 
   $ hg up bde1d2b6b5e5
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
@@ -337,7 +337,7 @@
   $ echo l > l
   $ hg ci -Aqm "added l"
   $ hg pick -r 1b24879c5c3c
-  grabbing 1:1b24879c5c3c "added a"
+  picking 1:1b24879c5c3c "added a"
 
   $ hg up bde1d2b6b5e5
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
--- a/tests/test-grab.t	Mon Sep 03 22:06:12 2018 +0200
+++ b/tests/test-grab.t	Mon Sep 03 22:59:19 2018 +0200
@@ -107,7 +107,7 @@
 Grabbing a revision
 
   $ hg pick 7c3bad9141dc
-  grabbing 1:7c3bad9141dc "add b"
+  picking 1:7c3bad9141dc "add b"
   $ hg glog
   @  5:7c15c05db6fa add b
   |