compat: drop code dealing with incompatibility for --publish with 4.3
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 19 Nov 2018 02:27:13 +0000
changeset 4263 35130e428ebd
parent 4262 f7cf556e3775
child 4264 9882fed37ea9
compat: drop code dealing with incompatibility for --publish with 4.3 We dropped 4.3 support.
hgext3rd/topic/discovery.py
hgext3rd/topic/flow.py
--- a/hgext3rd/topic/discovery.py	Mon Nov 19 02:25:37 2018 +0000
+++ b/hgext3rd/topic/discovery.py	Mon Nov 19 02:27:13 2018 +0000
@@ -33,32 +33,30 @@
     publishedset = ()
     remotebranchmap = None
     origremotebranchmap = remote.branchmap
-    # < hg-4.4 do not have a --publish flag anyway
-    if util.safehasattr(pushop, 'remotephases'):
-        publishednode = [c.node() for c in pushop.outdatedphases]
-        publishedset = repo.revs('ancestors(%ln + %ln)',
-                                 publishednode,
-                                 pushop.remotephases.publicheads)
+    publishednode = [c.node() for c in pushop.outdatedphases]
+    publishedset = repo.revs('ancestors(%ln + %ln)',
+                             publishednode,
+                             pushop.remotephases.publicheads)
 
-        rev = repo.unfiltered().changelog.nodemap.get
+    rev = repo.unfiltered().changelog.nodemap.get
 
-        def remotebranchmap():
-            # drop topic information from changeset about to be published
-            result = collections.defaultdict(list)
-            for branch, heads in origremotebranchmap().iteritems():
-                if ':' not in branch:
-                    result[branch].extend(heads)
-                else:
-                    namedbranch = branch.split(':', 1)[0]
-                    for h in heads:
-                        r = rev(h)
-                        if r is not None and r in publishedset:
-                            result[namedbranch].append(h)
-                        else:
-                            result[branch].append(h)
-            for heads in result.itervalues():
-                heads.sort()
-            return result
+    def remotebranchmap():
+        # drop topic information from changeset about to be published
+        result = collections.defaultdict(list)
+        for branch, heads in origremotebranchmap().iteritems():
+            if ':' not in branch:
+                result[branch].extend(heads)
+            else:
+                namedbranch = branch.split(':', 1)[0]
+                for h in heads:
+                    r = rev(h)
+                    if r is not None and r in publishedset:
+                        result[namedbranch].append(h)
+                    else:
+                        result[branch].append(h)
+        for heads in result.itervalues():
+            heads.sort()
+        return result
 
     class repocls(repo.__class__):
         # awful hack to see branch as "branch:topic"
--- a/hgext3rd/topic/flow.py	Mon Nov 19 02:25:37 2018 +0000
+++ b/hgext3rd/topic/flow.py	Mon Nov 19 02:27:13 2018 +0000
@@ -7,7 +7,6 @@
     extensions,
     node,
     phases,
-    util,
 )
 
 from mercurial.i18n import _
@@ -75,9 +74,6 @@
 def wrapphasediscovery(orig, pushop):
     orig(pushop)
     if getattr(pushop, 'publish', False):
-        if not util.safehasattr(pushop, 'remotephases'):
-            msg = _('--publish flag only supported from Mercurial 4.4 and higher')
-            raise error.Abort(msg)
         if not pushop.remotephases.publishing:
             unfi = pushop.repo.unfiltered()
             droots = pushop.remotephases.draftroots