branching: merge with stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 23 Oct 2017 16:05:57 +0200
changeset 3138 8a390749ff67
parent 3122 c80ba40d4c87 (current diff)
parent 3137 c3953ae44b87 (diff)
child 3139 ec2251d0ba06
branching: merge with stable Prepare the 7.0.0 line.
--- a/.hgtags	Fri Oct 20 23:03:11 2017 +0200
+++ b/.hgtags	Mon Oct 23 16:05:57 2017 +0200
@@ -58,3 +58,4 @@
 cc3e09e033a3c632c9ac35badbf8b5d53f584049 6.6.0
 3a4f75c6619c7ef7d78ee0912efd6cb01d55b521 6.7.0
 430ad68292d76b9387d1eeadf289951f51fd88d3 6.7.1
+ec0bbf26ce7fadd42c637e01d3750dac96ac0b1b 6.8.0
--- a/CHANGELOG	Fri Oct 20 23:03:11 2017 +0200
+++ b/CHANGELOG	Mon Oct 23 16:05:57 2017 +0200
@@ -1,8 +1,8 @@
 Changelog
 =========
 
-6.8.0 -- in progress
-----------------
+6.8.0 -- 2017-10-23
+-------------------
 
   * compatibility with Mercurial 4.4
     (use upstream implementation for obsfate and effect-flags starting hg 4.4+)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/merge-test-compat.sh	Mon Oct 23 16:05:57 2017 +0200
@@ -0,0 +1,15 @@
+#!/bin/bash
+set -euox pipefail
+
+unset GREP_OPTIONS
+NOTOPIC="--config experimental.topic-mode=ignore"
+
+compatbranches=`hg branches --quiet | grep 'mercurial-' | grep -v ':' | sort -n --reverse`
+prev='stable'
+for branch in $compatbranches; do
+    hg up $branch
+    hg merge $prev
+    hg commit -m "test-compat: merge $prev into $branch"
+    prev=$branch
+done
+
--- a/debian/changelog	Fri Oct 20 23:03:11 2017 +0200
+++ b/debian/changelog	Mon Oct 23 16:05:57 2017 +0200
@@ -1,3 +1,9 @@
+mercurial-evolve (6.8.0-1) UNRELEASED; urgency=medium
+
+  * new upstream release
+
+ -- Pierre-Yves David <pierre-yves.david@ens-lyon.org>  Mon, 23 Oct 2017 15:41:03 +0200
+
 mercurial-evolve (6.7.1-1) unstable; urgency=medium
  
    * new upstream release
--- a/hgext3rd/evolve/__init__.py	Fri Oct 20 23:03:11 2017 +0200
+++ b/hgext3rd/evolve/__init__.py	Mon Oct 23 16:05:57 2017 +0200
@@ -1122,10 +1122,10 @@
         if othertroubles:
             hint = hintmap['+'.join(othertroubles)]
         else:
-            l = len(troubled[targetcat])
-            if l:
+            length = len(troubled[targetcat])
+            if length:
                 hint = _("%d other %s in the repository, do you want --any "
-                         "or --rev") % (l, targetcat)
+                         "or --rev") % (length, targetcat)
             else:
                 othertroubles = []
                 for cat in unselectedcategories:
--- a/hgext3rd/evolve/legacy.py	Fri Oct 20 23:03:11 2017 +0200
+++ b/hgext3rd/evolve/legacy.py	Mon Oct 23 16:05:57 2017 +0200
@@ -86,7 +86,7 @@
     """import markers from an .hg/obsolete-relations file"""
     cnt = 0
     err = 0
-    l = repo.lock()
+    lock = repo.lock()
     some = False
     try:
         unlink = []
@@ -163,7 +163,7 @@
             tr.release()
     finally:
         del repo._importoldobsolete
-        l.release()
+        lock.release()
     if not some:
         ui.warn(_('nothing to do\n'))
     ui.status('%i obsolete marker converted\n' % cnt)
--- a/hgext3rd/evolve/metadata.py	Fri Oct 20 23:03:11 2017 +0200
+++ b/hgext3rd/evolve/metadata.py	Mon Oct 23 16:05:57 2017 +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__ = '6.8.0.dev'
-testedwith = '3.8.4 3.9.2 4.0.2 4.1.3 4.2.3 4.3.2'
+__version__ = '6.8.1.dev'
+testedwith = '3.8.4 3.9.2 4.0.2 4.1.3 4.2.3 4.3.2 4.4'
 minimumhgversion = '3.8'
 buglink = 'https://bz.mercurial-scm.org/'
--- a/hgext3rd/topic/__init__.py	Fri Oct 20 23:03:11 2017 +0200
+++ b/hgext3rd/topic/__init__.py	Mon Oct 23 16:05:57 2017 +0200
@@ -139,9 +139,9 @@
               'topic.active': 'green',
              }
 
-__version__ = '0.4.0.dev'
+__version__ = '0.4.1.dev'
 
-testedwith = '4.0.2 4.1.3 4.2.3 4.3.3'
+testedwith = '4.0.2 4.1.3 4.2.3 4.3.3 4.4'
 minimumhgversion = '4.0'
 buglink = 'https://bz.mercurial-scm.org/'
 
@@ -517,16 +517,16 @@
             raise error.Abort('changing topic requires a topic name or --clear')
         if repo.revs('%ld and public()', touchedrevs):
             raise error.Abort("can't change topic of a public change")
-        wl = l = txn = None
+        wl = lock = txn = None
         try:
             wl = repo.wlock()
-            l = repo.lock()
+            lock = repo.lock()
             txn = repo.transaction('rewrite-topics')
             rewrote = _changetopics(ui, repo, touchedrevs, topic)
             txn.close()
             ui.status('changed topic on %d changes\n' % rewrote)
         finally:
-            lockmod.release(txn, l, wl)
+            lockmod.release(txn, lock, wl)
             repo.invalidate()
         return
 
--- a/hgext3rd/topic/stack.py	Fri Oct 20 23:03:11 2017 +0200
+++ b/hgext3rd/topic/stack.py	Mon Oct 23 16:05:57 2017 +0200
@@ -9,6 +9,7 @@
     error,
     node,
     phases,
+    obsolete,
     util,
 )
 from .evolvebits import builddependencies, _singlesuccessor
@@ -23,6 +24,25 @@
 if not util.safehasattr(context.basectx, 'isunstable'):
     context.basectx.isunstable = context.basectx.troubled
 
+def _stackcandidates(repo):
+    """build the smaller set of revs that might be part of a stack.
+
+    The intend is to build something more efficient than what revsets do in
+    this area.
+    """
+    phasecache = repo._phasecache
+    if not phasecache._phasesets:
+        return repo.revs('(not public()) - obsolete()')
+    if any(s is None for s in phasecache._phasesets):
+        return repo.revs('(not public()) - obsolete()')
+
+    result = set()
+    for s in phasecache._phasesets[phases.draft:]:
+        result |= s
+
+    result -= obsolete.getrevs(repo, 'obsolete')
+    return result
+
 class stack(object):
     """object represent a stack and common logic associated to it."""
 
@@ -31,12 +51,15 @@
         self.branch = branch
         self.topic = topic
         self.behinderror = None
+
+        subset = _stackcandidates(repo)
+
         if topic is not None and branch is not None:
             raise error.ProgrammingError('both branch and topic specified (not defined yet)')
         elif topic is not None:
-            trevs = repo.revs("not obsolete() and topic(%s)", topic)
+            trevs = repo.revs("%ld and topic(%s)", subset, topic)
         elif branch is not None:
-            trevs = repo.revs("not public() and branch(%s) - obsolete() - topic()", branch)
+            trevs = repo.revs("%ld and branch(%s) - topic()", subset, branch)
         else:
             raise error.ProgrammingError('neither branch and topic specified (not defined yet)')
         self._revs = trevs