changeset 2836:feaa52680682

log: bumped was renamed into phasedivergent Bumped was renamed into phasedivergent, update tests. Match 9c27a2891b75 mercurial changeset.
author Boris Feld <boris.feld@octobus.net>
date Thu, 10 Aug 2017 19:31:55 +0200
parents 20c2499ce8bc
children cec8609bb396
files hgext3rd/evolve/__init__.py hgext3rd/evolve/compat.py tests/test-evolve-bumped.t tests/test-evolve.t tests/test-obsolete.t tests/test-stabilize-result.t
diffstat 6 files changed, 60 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/__init__.py	Thu Aug 10 17:57:50 2017 +0200
+++ b/hgext3rd/evolve/__init__.py	Thu Aug 10 19:31:55 2017 +0200
@@ -995,7 +995,7 @@
         tr = repo.transaction("evolve")
         if 'orphan' == category:
             result = _solveunstable(ui, repo, ctx, dryrun, confirm, progresscb)
-        elif 'bumped' == category:
+        elif 'phasedivergent' == category:
             result = _solvebumped(ui, repo, ctx, dryrun, confirm, progresscb)
         elif 'contentdivergent' == category:
             result = _solvedivergent(ui, repo, ctx, dryrun, confirm,
@@ -1010,7 +1010,7 @@
 def _handlenotrouble(ui, repo, allopt, revopt, anyopt, targetcat):
     """Used by the evolve function to display an error message when
     no troubles can be resolved"""
-    troublecategories = ['bumped', 'contentdivergent', 'orphan']
+    troublecategories = ['phasedivergent', 'contentdivergent', 'orphan']
     unselectedcategories = [c for c in troublecategories if c != targetcat]
     msg = None
     hint = None
@@ -1018,27 +1018,34 @@
     troubled = {
         "orphan": repo.revs("unstable()"),
         "contentdivergent": repo.revs("divergent()"),
-        "bumped": repo.revs("bumped()"),
+        "phasedivergent": repo.revs("bumped()"),
         "all": repo.revs("troubled()"),
     }
 
     hintmap = {
-        'bumped': _("do you want to use --bumped"),
-        'bumped+contentdivergent': _("do you want to use --bumped or --contentdivergent"),
-        'bumped+orphan': _("do you want to use --bumped or --orphan"),
+        'phasedivergent': _("do you want to use --phasedivergent"),
+        'phasedivergent+contentdivergent': _("do you want to use "
+                                             "--phasedivergent or"
+                                             " --contentdivergent"),
+        'phasedivergent+orphan': _("do you want to use --phasedivergent"
+                                   " or --orphan"),
         'contentdivergent': _("do you want to use --contentdivergent"),
         'contentdivergent+orphan': _("do you want to use --contentdivergent"
                                      " or --orphan"),
         'orphan': _("do you want to use --orphan"),
-        'any+bumped': _("do you want to use --any (or --rev) and --bumped"),
-        'any+bumped+contentdivergent': _("do you want to use --any (or --rev) and"
-                                         " --bumped or --contentdivergent"),
-        'any+bumped+orphan': _("do you want to use --any (or --rev) and"
-                               "--bumped or --orphan"),
+        'any+phasedivergent': _("do you want to use --any (or --rev) and"
+                                " --phasedivergent"),
+        'any+phasedivergent+contentdivergent': _("do you want to use --any"
+                                                 " (or --rev) and"
+                                                 " --phasedivergent or"
+                                                 " --contentdivergent"),
+        'any+phasedivergent+orphan': _("do you want to use --any (or --rev)"
+                                       " and --phasedivergent or --orphan"),
         'any+contentdivergent': _("do you want to use --any (or --rev) and"
                                   " --contentdivergent"),
         'any+contentdivergent+orphan': _("do you want to use --any (or --rev)"
-                                         " and --contentdivergent or --orphan"),
+                                         " and --contentdivergent or "
+                                         "--orphan"),
         'any+orphan': _("do you want to use --any (or --rev)"
                         "and --orphan"),
     }
@@ -1184,7 +1191,8 @@
     return res
 
 instabilities_map = {
-    'contentdivergent': "content-divergent"
+    'contentdivergent': "content-divergent",
+    'phasedivergent': "phase-divergent"
 }
 
 def _selectrevs(repo, allopt, revopt, anyopt, targetcat):
@@ -1291,9 +1299,9 @@
 
 def listtroubles(ui, repo, troublecategories, **opts):
     """Print all the troubles for the repo (or given revset)"""
-    troublecategories = troublecategories or ['contentdivergent', 'orphan', 'bumped']
+    troublecategories = troublecategories or ['contentdivergent', 'orphan', 'phasedivergent']
     showunstable = 'orphan' in troublecategories
-    showbumped = 'bumped' in troublecategories
+    showbumped = 'phasedivergent' in troublecategories
     showdivergent = 'contentdivergent' in troublecategories
 
     revs = repo.revs('+'.join("%s()" % t for t in troublecategories))
@@ -1373,7 +1381,8 @@
         'directory')),
      ('r', 'rev', [], _('solves troubles of these revisions')),
      ('', 'bumped', False, _('solves only bumped changesets')),
-     ('', 'divergent', False, _('solves only divergent changesets')),
+     ('', 'phasedivergent', False, _('solves only bumped changesets')),
+     ('', 'divergent', False, _('solves only phasedivergent changesets')),
      ('', 'contentdivergent', False, _('solves only contentdivergent changesets')),
      ('', 'unstable', False, _('solves only unstable changesets')),
      ('', 'orphan', False, _('solves only orphan changesets (default)')),
@@ -1479,7 +1488,14 @@
 
         opts['contentdivergent'] = opts['divergent']
 
-    troublecategories = ['bumped', 'contentdivergent', 'orphan']
+    if opts['bumped']:
+        msg = ("'evolve --bumped' is deprecated, "
+               "use 'evolve --phasedivergent'")
+        repo.ui.deprecwarn(msg, '4.4')
+
+        opts['phasedivergent'] = opts['bumped']
+
+    troublecategories = ['phasedivergent', 'contentdivergent', 'orphan']
     specifiedcategories = [t for t in troublecategories if opts[t]]
     if listopt:
         listtroubles(ui, repo, specifiedcategories, **opts)
--- a/hgext3rd/evolve/compat.py	Thu Aug 10 17:57:50 2017 +0200
+++ b/hgext3rd/evolve/compat.py	Thu Aug 10 19:31:55 2017 +0200
@@ -101,6 +101,9 @@
 if not util.safehasattr(context.basectx, 'contentdivergent'):
     context.basectx.contentdivergent = context.basectx.divergent
 
+if not util.safehasattr(context.basectx, 'phasedivergent'):
+    context.basectx.phasedivergent = context.basectx.bumped
+
 if not util.safehasattr(revset, 'orphan'):
     @eh.revset('orphan')
     def oprhanrevset(*args, **kwargs):
@@ -111,6 +114,11 @@
     def contentdivergentrevset(*args, **kwargs):
         return revset.divergent(*args, **kwargs)
 
+if not util.safehasattr(revset, 'phasedivergent'):
+    @eh.revset('phasedivergent')
+    def phasedivergentrevset(*args, **kwargs):
+        return revset.bumped(*args, **kwargs)
+
 if not util.safehasattr(context.basectx, 'instabilities'):
     def instabilities(self):
         """return the list of instabilities affecting this changeset.
@@ -123,8 +131,8 @@
         instabilities = []
         if self.orphan():
             instabilities.append('unstable')
-        if self.bumped():
-            instabilities.append('bumped')
+        if self.phasedivergent():
+            instabilities.append('phase-divergent')
         if self.contentdivergent():
             instabilities.append('content-divergent')
         return instabilities
--- a/tests/test-evolve-bumped.t	Thu Aug 10 17:57:50 2017 +0200
+++ b/tests/test-evolve-bumped.t	Thu Aug 10 19:31:55 2017 +0200
@@ -69,7 +69,7 @@
   no changes found
   1 new bumped changesets
 
-  $ hg evolve -a -A --bumped
+  $ hg evolve -a -A --phasedivergent
   recreate:[2] tweak a
   atop:[1] modify a
   computing new diff
@@ -121,5 +121,5 @@
   |
   o  0:d3873e73d99e@default(public) init
   
-  $ hg evolve --all --bumped
+  $ hg evolve --all --phasedivergent
   skipping b28e84916d8c : we do not handle merge yet
--- a/tests/test-evolve.t	Thu Aug 10 17:57:50 2017 +0200
+++ b/tests/test-evolve.t	Thu Aug 10 19:31:55 2017 +0200
@@ -412,7 +412,7 @@
   |
   o  0	: base - test
   
-  $ hg evolve --any --traceback --bumped
+  $ hg evolve --any --traceback --phasedivergent
   recreate:[8] another feature that rox
   atop:[7] another feature (child of ba0ec09b1bab)
   computing new diff
@@ -1049,7 +1049,7 @@
   |/
   o  0	: a0 - test
   
-  $ hg evolve -r 12 --bumped
+  $ hg evolve -r 12 --phasedivergent
   recreate:[12] add new file bumped
   atop:[11] a2
   computing new diff
@@ -1110,8 +1110,8 @@
   set of specified revisions is empty
   [1]
 
-  $ hg evolve --rev "14::" --bumped
-  no bumped changesets in specified revisions
+  $ hg evolve --rev "14::" --phasedivergent
+  no phasedivergent changesets in specified revisions
   (do you want to use --orphan)
   [2]
   $ hg evolve --rev "14::" --orphan
--- a/tests/test-obsolete.t	Thu Aug 10 17:57:50 2017 +0200
+++ b/tests/test-obsolete.t	Thu Aug 10 19:31:55 2017 +0200
@@ -592,13 +592,13 @@
   parent:      10:2033b4e49474
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  instability: bumped
+  instability: phase-divergent
   summary:     add obsol_d'''
   
   $ hg push ../other-new/
   pushing to ../other-new/
   searching for changes
-  abort: push includes bumped changeset: 6db5e282cb91!
+  abort: push includes phase-divergent changeset: 6db5e282cb91!
   (use 'hg evolve' to get a stable history or --force to ignore warnings)
   [255]
 
@@ -622,7 +622,7 @@
   |/   parent:      10:2033b4e49474
   |    user:        test
   |    date:        Thu Jan 01 00:00:00 1970 +0000
-  |    instability: bumped
+  |    instability: phase-divergent
   |    summary:     add obsol_d'''
   |
   | o  changeset:   11:9468a5f5d8b2
@@ -679,14 +679,14 @@
   commit: (clean)
   update: (2|9|11) new changesets, (3|9|10) branch heads \(merge\) (re)
   phases: 3 draft
-  bumped: 1 changesets
+  phase-divergent: 1 changesets
   $ hg debugobsolete `getid a7a6f2b5d8a5` `getid 50f11e5e3a63`
   $ hg log -r 'divergent()'
   changeset:   12:6db5e282cb91
   parent:      10:2033b4e49474
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  instability: bumped, content-divergent
+  instability: phase-divergent, content-divergent
   summary:     add obsol_d'''
   
   changeset:   16:50f11e5e3a63
@@ -767,7 +767,7 @@
   | | |/   parent:      10:2033b4e49474
   | | |    user:        test
   | | |    date:        Thu Jan 01 00:00:00 1970 +0000
-  | | |    instability: bumped, content-divergent
+  | | |    instability: phase-divergent, content-divergent
   | | |    summary:     add obsol_d'''
   | | |
   | o |  changeset:   11:9468a5f5d8b2
--- a/tests/test-stabilize-result.t	Thu Aug 10 17:57:50 2017 +0200
+++ b/tests/test-stabilize-result.t	Thu Aug 10 19:31:55 2017 +0200
@@ -156,20 +156,20 @@
 
 Stabilize!
 
-  $ hg evolve --any --dry-run --bumped
+  $ hg evolve --any --dry-run --phasedivergent
   recreate:[12] newer a
   atop:[8] newer a
-  hg rebase --rev (73b15c7566e9|d5c7ef82d003) --dest 66719795a494; (re)
+  hg rebase --rev d5c7ef82d003 --dest 66719795a494;
   hg update 1cf0aacfd363;
-  hg revert --all --rev (73b15c7566e9|d5c7ef82d003); (re)
+  hg revert --all --rev d5c7ef82d003;
   hg commit --msg "bumped update to %s" (no-eol)
-  $ hg evolve --any --confirm --bumped
+  $ hg evolve --any --confirm --phasedivergent
   recreate:[12] newer a
   atop:[8] newer a
   perform evolve? [Ny] n
   abort: evolve aborted by user
   [255]
-  $ echo y | hg evolve --any --confirm --config ui.interactive=True --bumped
+  $ echo y | hg evolve --any --confirm --config ui.interactive=True --phasedivergent
   recreate:[12] newer a
   atop:[8] newer a
   perform evolve? [Ny] y