test-compat: merge mercurial-4.8 into mercurial-4.7 mercurial-4.7
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 20 Apr 2019 03:55:07 +0200
branchmercurial-4.7
changeset 4549 dcaf340841ef
parent 4548 d3cc1b55ad0a (diff)
parent 4512 7a779a288793 (current diff)
child 4550 160fa01e832b
child 4559 c67a6998b8ba
test-compat: merge mercurial-4.8 into mercurial-4.7
tests/test-options.t
tests/test-topic.t
tests/test-wireproto.t
--- a/.hgtags	Thu Apr 11 22:41:41 2019 +0200
+++ b/.hgtags	Sat Apr 20 03:55:07 2019 +0200
@@ -77,3 +77,4 @@
 7edc5c148df0150087832b861966d658df0b601e 8.3.2
 97b18934d6db9e7e7eaa3fb656c0411d7f43af26 8.3.3
 8c4289d0e91e95b3281c378e1ac3f4ff4678b4d3 8.4.0
+33c617626fd90a0a00e831b4762f64fecb609317 8.5.0
--- a/CHANGELOG	Thu Apr 11 22:41:41 2019 +0200
+++ b/CHANGELOG	Sat Apr 20 03:55:07 2019 +0200
@@ -1,29 +1,38 @@
 Changelog
 =========
 
-8.5.0 - in progress
+8.5.1 - in progress
 -------------------
 
-  * evolve: fix an recoverable state (issue6053)
-  * evolve: share evolve related cache between `shares`
+  * evolve: make sure we use upstream merge code with 5.0,
+  * topic: compatibility with mercurial-5.0,
+  * topic: improve extensions isolation (issue6121).
+
+8.5.0 -- 2019-04-23
+-------------------
+
+  * evolve: fix an recoverable state (issue6053),
+  * evolve: share evolve related cache between `shares`,
+  * evolve: make sure the extensions are only active on repository that
+            enables it (issue6057).
   * evolve: improved compatibility with narrow repositories,
   * evolve: preserve --[no-]update value over --continue,
-  * evolve: make sure the extensions are only active on repository that
-            enables it. Double check your server configuration (issue6057)
-  * evolve: make sure divergence resolution don't replace the initial author
-            (issue6113)
+  * evolve: make sure divergence resolution keep the initial author (issue6113),
   * evolve: improved support for content-divergence with public changesets,
-  * pick: align working dir branch with the one from the pick result (issue6089)
+  * pick: align working dir branch with the one from the pick result (issue6089),
   * pick: add the standard `--tool` option,
-  * prune: fix error message when pruning public changesets
-  * split: preserve phases (issue6048)
-  * stack: improved and speed --children flag up,
-  * stack: mention all divergences too.
+  * prune: fix error message when pruning public changesets,
+  * split: preserve phases (issue6048),
+  * touch: fix error message when touching public changesets,
+  * uncommit: abort if an explicitly given file cannot be uncommitted.
+
+topic 0.14.0
+
   * stack: support ranges in revsets indexing,
-  * touch: fix error message when touching public changesets
-  * uncommit: abort if an explicitly given file cannot be uncommitted
+  * stack: mention divergences unstability,
+  * stack: improved and speed --children flag up.
 
-8.4.0 -- 2019-12-22
+8.4.0 -- 2019-01-22
 -------------------
 
   * compat: add compatibility with Mercurial 4.9
--- a/debian/changelog	Thu Apr 11 22:41:41 2019 +0200
+++ b/debian/changelog	Sat Apr 20 03:55:07 2019 +0200
@@ -1,3 +1,9 @@
+mercurial-evolve (8.5.0-1) UNRELEASED; urgency=medium
+
+  * new upstream release
+
+ -- Pierre-Yves David <pierre-yves.david@ens-lyon.org>  Fri, 12 Apr 2019 02:16:23 +0200
+
 mercurial-evolve (8.4.0-1) unstable; urgency=medium
 
   * new upstream release
--- a/hgext3rd/evolve/compat.py	Thu Apr 11 22:41:41 2019 +0200
+++ b/hgext3rd/evolve/compat.py	Sat Apr 20 03:55:07 2019 +0200
@@ -418,7 +418,7 @@
     return copy, movewithdir, diverge, renamedelete, dirmove
 
 # hg <= 4.9 compat (7694b685bb10)
-fixupstreamed = util.safehasattr(scmutil, '_movedirstate')
+fixupstreamed = util.safehasattr(scmutil, 'movedirstate')
 if not fixupstreamed:
     copies._fullcopytracing = fixedcopytracing
 
--- a/hgext3rd/evolve/metadata.py	Thu Apr 11 22:41:41 2019 +0200
+++ b/hgext3rd/evolve/metadata.py	Sat Apr 20 03:55:07 2019 +0200
@@ -5,7 +5,7 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-__version__ = '8.5.0.dev'
+__version__ = '8.5.1.dev'
 testedwith = '4.4.2 4.5.2 4.6.2 4.7 4.8 4.9'
 minimumhgversion = '4.4'
 buglink = 'https://bz.mercurial-scm.org/'
--- a/hgext3rd/serverminitopic.py	Thu Apr 11 22:41:41 2019 +0200
+++ b/hgext3rd/serverminitopic.py	Sat Apr 20 03:55:07 2019 +0200
@@ -159,8 +159,13 @@
 
     def copy(self):
         """return an deep copy of the branchcache object"""
-        new = self.__class__(self, self.tipnode, self.tiprev, self.filteredhash,
-                             self._closednodes)
+        if util.safehasattr(self, '_entries'):
+            _entries = self._entries
+        else:
+            # hg <= 4.9 (624d6683c705, b137a6793c51)
+            _entries = self
+        new = self.__class__(_entries, self.tipnode, self.tiprev,
+                             self.filteredhash, self._closednodes)
         new.phaseshash = self.phaseshash
         return new
 
--- a/hgext3rd/topic/__init__.py	Thu Apr 11 22:41:41 2019 +0200
+++ b/hgext3rd/topic/__init__.py	Sat Apr 20 03:55:07 2019 +0200
@@ -139,6 +139,7 @@
 )
 
 from . import (
+    common,
     compat,
     constants,
     destination,
@@ -179,7 +180,7 @@
               'topic.active': 'green',
              }
 
-__version__ = '0.14.0.dev'
+__version__ = '0.14.1.dev'
 
 testedwith = '4.4.2 4.5.2 4.6.2 4.7 4.8 4.9'
 minimumhgversion = '4.4'
@@ -257,6 +258,8 @@
 topicrev = re.compile(r'^t\d+$')
 branchrev = re.compile(r'^b\d+$')
 
+hastopicext = common.hastopicext
+
 def _namemap(repo, name):
     revs = None
     if stackrev.match(name):
@@ -368,6 +371,9 @@
 
     class topicrepo(repo.__class__):
 
+        # attribute for other code to distinct between repo with topic and repo without
+        hastopicext = True
+
         def _restrictcapabilities(self, caps):
             caps = super(topicrepo, self)._restrictcapabilities(caps)
             caps.add('topics')
@@ -559,6 +565,8 @@
 
 def wrapinit(orig, self, repo, *args, **kwargs):
     orig(self, repo, *args, **kwargs)
+    if not hastopicext(repo):
+        return
     if constants.extrakey not in self._extra:
         if getattr(repo, 'currenttopic', ''):
             self._extra[constants.extrakey] = repo.currenttopic
@@ -567,12 +575,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
@@ -1108,6 +1122,8 @@
     return topicmode
 
 def commitwrap(orig, ui, repo, *args, **opts):
+    if not hastopicext(repo):
+        return orig(ui, repo, *args, **opts)
     with repo.wlock():
         topicmode = _configtopicmode(ui)
         ismergecommit = len(repo[None].parents()) == 2
@@ -1149,10 +1165,11 @@
 
 def committextwrap(orig, repo, ctx, subs, extramsg):
     ret = orig(repo, ctx, subs, extramsg)
-    t = repo.currenttopic
-    if t:
-        ret = ret.replace("\nHG: branch",
-                          "\nHG: topic '%s'\nHG: branch" % t)
+    if hastopicext(repo):
+        t = repo.currenttopic
+        if t:
+            ret = ret.replace("\nHG: branch",
+                              "\nHG: topic '%s'\nHG: branch" % t)
     return ret
 
 def pushoutgoingwrap(orig, ui, repo, *args, **opts):
@@ -1169,6 +1186,8 @@
     ist0 = False
     try:
         ret = orig(repo, node, branchmerge, force, *args, **kwargs)
+        if not hastopicext(repo):
+            return ret
         # The mergeupdatewrap function makes the destination's topic as the
         # current topic. This is right for merge but wrong for rebase. We check
         # if rebase is running and update the currenttopic to topic of new
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hgext3rd/topic/common.py	Sat Apr 20 03:55:07 2019 +0200
@@ -0,0 +1,8 @@
+# Copyright 2019 Pierre-Yves David <pierre-yves.david@octobus.net>
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+def hastopicext(repo):
+    """True if the repo use the topic extension"""
+    return getattr(repo, 'hastopicext', False)
--- a/hgext3rd/topic/destination.py	Thu Apr 11 22:41:41 2019 +0200
+++ b/hgext3rd/topic/destination.py	Sat Apr 20 03:55:07 2019 +0200
@@ -7,7 +7,10 @@
     error,
     extensions,
 )
-from . import topicmap
+from . import (
+    common,
+    topicmap,
+)
 from .evolvebits import builddependencies
 
 def _destmergebranch(orig, repo, action='merge', sourceset=None,
@@ -19,7 +22,9 @@
         # XXX: using only the max here is flacky. That code should eventually
         # be updated to take care of the whole sourceset.
         p1 = repo[max(sourceset)]
-    top = p1.topic()
+    top = None
+    if common.hastopicext(repo):
+        top = p1.topic()
     if top:
         revs = repo.revs('topic(%s) - obsolete()', top)
         deps, rdeps = builddependencies(repo, revs)
@@ -57,6 +62,8 @@
 
 def _destupdatetopic(repo, clean, check=None):
     """decide on an update destination from current topic"""
+    if not common.hastopicext(repo):
+        return None, None, None
     movemark = node = None
     topic = repo.currenttopic
     if topic:
@@ -71,6 +78,8 @@
     return node, movemark, None
 
 def desthistedit(orig, ui, repo):
+    if not common.hastopicext(repo):
+        return None
     if not (ui.config('histedit', 'defaultrev', None) is None
             and repo.currenttopic):
         return orig(ui, repo)
--- a/hgext3rd/topic/discovery.py	Thu Apr 11 22:41:41 2019 +0200
+++ b/hgext3rd/topic/discovery.py	Sat Apr 20 03:55:07 2019 +0200
@@ -12,6 +12,9 @@
     extensions,
     util,
 )
+from . import (
+    common,
+)
 
 try:
     from mercurial import wireproto
@@ -26,7 +29,10 @@
 
     publishing = ('phases' not in remote.listkeys('namespaces')
                   or bool(remote.listkeys('phases').get('publishing', False)))
-    if ((publishing or not remote.capable('topics'))
+
+    if not common.hastopicext(pushop.repo):
+        return orig(pushop, *args, **kwargs)
+    elif ((publishing or not remote.capable('topics'))
             and not getattr(pushop, 'publish', False)):
         return orig(pushop, *args, **kwargs)
 
@@ -117,6 +123,8 @@
             remote.branchmap = origremotebranchmap
 
 def wireprotobranchmap(orig, repo, proto):
+    if not common.hastopicext(repo):
+        return orig(repo, proto)
     oldrepo = repo.__class__
     try:
         class repocls(repo.__class__):
@@ -146,7 +154,7 @@
 def handlecheckheads(orig, op, inpart):
     """This is used to check for new heads when publishing changeset"""
     orig(op, inpart)
-    if op.repo.publishing():
+    if not common.hastopicext(op.repo) or op.repo.publishing():
         return
     tr = op.gettransaction()
     if tr.hookargs['source'] not in ('push', 'serve'): # not a push
@@ -181,15 +189,16 @@
 handlecheckheads.params = frozenset()
 
 def _pushb2phases(orig, pushop, bundler):
-    checktypes = ('check:heads', 'check:updated-heads')
-    hascheck = any(p.type in checktypes for p in bundler._parts)
-    if not hascheck and pushop.outdatedphases:
-        exchange._pushb2ctxcheckheads(pushop, bundler)
+    if common.hastopicext(pushop.repo):
+        checktypes = ('check:heads', 'check:updated-heads')
+        hascheck = any(p.type in checktypes for p in bundler._parts)
+        if not hascheck and pushop.outdatedphases:
+            exchange._pushb2ctxcheckheads(pushop, bundler)
     return orig(pushop, bundler)
 
 def wireprotocaps(orig, repo, proto):
     caps = orig(repo, proto)
-    if repo.peer().capable('topics'):
+    if common.hastopicext(repo) and repo.peer().capable('topics'):
         caps.append('topics')
     return caps
 
--- a/hgext3rd/topic/topicmap.py	Thu Apr 11 22:41:41 2019 +0200
+++ b/hgext3rd/topic/topicmap.py	Sat Apr 20 03:55:07 2019 +0200
@@ -12,6 +12,10 @@
     util,
 )
 
+from . import (
+    common,
+)
+
 basefilter = set(['base', 'immutable'])
 def topicfilter(name):
     """return a "topic" version of a filter level"""
@@ -30,6 +34,8 @@
     return filtername.endswith('-topic')
 
 def gettopicrepo(repo):
+    if not common.hastopicext(repo):
+        return repo
     filtername = topicfilter(repo.filtername)
     if filtername == repo.filtername:
         return repo