diff hgext/evolve.py @ 1626:0edb545503fe

topic: 'hg evolve --all' pick all trouble within current topic This is the first changeset of a collaboration between the topic extensions and evolve. If there is an active topic, 'hg evolve --all' will try to fix all changesets in that topic wherever they are. Aspiring descendant that are not in the current topic will be ignored. For now, evolve behave as usual if there is no active topic. This is a bit inconsistent and will probably be unified in the future.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 17 Mar 2016 09:39:35 -0700
parents 081605c2e9b6
children a91115687a7e
line wrap: on
line diff
--- a/hgext/evolve.py	Sat Mar 12 13:59:07 2016 +0800
+++ b/hgext/evolve.py	Thu Mar 17 09:39:35 2016 -0700
@@ -1454,9 +1454,14 @@
         revs = repo.revs(targetcat+'()')
         if revopt:
             revs = scmutil.revrange(repo, revopt) & revs
-        elif not anyopt and targetcat == 'unstable':
-            revs = set(_aspiringdescendant(repo,
-                                           repo.revs('(.::) - obsolete()::')))
+        elif not anyopt:
+            topic = getattr(repo, 'currenttopic', '')
+            if topic:
+                revs = repo.revs('topic(%s)', topic) & revs
+            elif targetcat == 'unstable':
+                revs = _aspiringdescendant(repo,
+                                           repo.revs('(.::) - obsolete()::'))
+                revs = set(revs)
         if targetcat == 'divergent':
             # Pick one divergent per group of divergents
             revs = _dedupedivergents(repo, revs)