Pierre-Yves David avatar Pierre-Yves David committed 7ecd415

rename `stabilize` to `evolve`

stabilize keep being valide but as Matt still like "Changeset Evolution" as a
name evolve make more sense.

Stabilize is a bit too tight to unstable too.

Comments (0)

Files changed (12)

docs/evolve-collaboration.rst

 Being now done with grammar and typo fixes, Alice decides it is time to
 stabilize again the tree. She does::
 
-    $ hg stabilize
+    $ hg evolve
 
 two times, one for each unstable descendant. The last time, hgview
 shows her a straight line again. Wow! that feels a bit like a

docs/evolve-faq.rst

 .. warning:: Beware that rebasing obsolete changesets will result in
              conflicting versions of the changesets.
 
-Stabilize history: ``stabilize``
+Stabilize history: ``evolve``
 ------------------------------------------------------------
 
 When you rewrite (amend) a changeset with children without rewriting
 newest version. This is not done automatically to avoid the
 proliferation of useless hidden changesets.
 
-.. warning:: ``hg stabilize`` have no --continue to use after conflict
-             resolution
-
-.. warning:: stabilization does not handle deletion yet.
-
-.. warning:: obsolete currently relies on changesets in secret phase
-              to avoid exchanging obsolete and unstable changesets.
-
-             XXX details issue here
-
 
 Fix my history afterward: ``prune -n``
 ------------------------------------------------------------
 qnew                            ``commit``
 qrefresh                        ``amend``
 qpop                            ``update`` or ``qdown``
-qpush                           ``update`` or ``gup`` sometimes ``stabilize``
+qpush                           ``update`` or ``gup`` sometimes ``evolve``
 qrm                             ``prune``
 qfold                           ``amend -c`` (for now, ``collapse`` soon)
 qdiff                           ``odiff``
 The evolution extension adds a command to rewrite the "out of sync"
 changesets:::
 
-  $ hg stabilize
+  $ hg evolve
 
 You can also decide to do it manually using::
 
 Here is a list of know issue that will be fixed later:
 
 
-* ``hg stabilize`` does not handle merge conflict.
-
-    You must fallback to graft or rebase when that happen.
-
-* rewriting conflict are not detected yet``hg stabilize`` does not
+* rewriting conflict are not detected yet``hg evolve`` does not
   handle them.
 
 * ``hg update`` can move an obsolete parent

docs/instability.rst

     $ hg pull
     added 3 changeset
     +2 unstable changeset
-    (do you want "hg stabilize" ?)
+    (do you want "hg evolve" ?)
     working directory parent is obsolete!
     $ hg push
     outgoing unstable changesets
-    (use "hg stabilize" or force the push)
+    (use "hg evolve" or force the push)
 
 And should not not encourage people to create instability
 

docs/obs-terms.rst

 - kill: shall has funny effects when you forget "hg" in front of ``hg kill``.
 - obsolete: too vague, too long and too generic.
 
-Stabilize
+evolve
 ```````````````
 
 Automatically resolve *troublesome* changesets
 This is an important name as hg pull/push will suggest it the same way it
 suggest merging when you add heads.
 
-I do not like stabilize much.
-
 alternative names:
 
 - solve (too generic ?)
-- evolve (too vague)
+- stabilize
 
 @eh.reposetup
 def _repostabilizesetup(ui, repo):
-    """Add a hint for "hg stabilize" when troubles make push fails
+    """Add a hint for "hg evolve" when troubles make push fails
     """
     if not repo.local():
         return
 
     opush = repo.push
 
-    class stabilizerrepo(repo.__class__):
+    class evolvingrepo(repo.__class__):
         def push(self, remote, *args, **opts):
             """wrapper around pull that pull obsolete relation"""
             try:
                 result = opush(remote, *args, **opts)
             except util.Abort, ex:
-                hint = _("use 'hg stabilize' to get a stable history "
+                hint = _("use 'hg evolve' to get a stable history "
                          "or --force to ignore warnings")
                 if (len(ex.args) >= 1
                     and ex.args[0].startswith('push includes ')
                     ex.hint = hint
                 raise
             return result
-    repo.__class__ = stabilizerrepo
+    repo.__class__ = evolvingrepo
 
 @eh.wrapcommand("summary")
 def obssummary(orig, ui, repo, *args, **kwargs):
 cmdtable = {}
 command = cmdutil.command(cmdtable)
 
-@command('^stabilize|evolve|solve',
+@command('^evolve|stabilize|evolve|solve',
     [('n', 'dry-run', False, 'do not perform actions, print what to be done'),
-    ('A', 'any', False, 'stabilize any unstable changeset'),
-    ('c', 'continue', False, 'continue an interrupted stabilized'), ],
+    ('A', 'any', False, 'evolve any troubled changeset'),
+    ('c', 'continue', False, 'continue an interrupted evolution'), ],
     _('[OPTIONS]...'))
-def stabilize(ui, repo, **opts):
-    """rebase an unstable changeset to make it stable again
+def evolve(ui, repo, **opts):
+    """Solve trouble in your repository
 
-    By default, take the first unstable changeset which could be
-    rebased as child of the working directory parent revision or one
-    of its descendants and rebase it.
+    - rebase unstable changeset to make it stable again,
+    - create proper diff from latecomer changeset,
+    - merge conflicting changeset.
 
-    With --any, stabilize any unstable changeset.
+    By default, take the first troubles changeset that looks relevant.
 
-    The working directory is updated to the rebased revision.
+    (The logic is still a bit fuzzy)
+
+    - For unstable, that mean the first which could be rebased as child of the
+      working directory parent revision or one of its descendants and rebase
+      it.
+
+    - For conflicting this mean "." if applicable.
+
+    With --any, evolve pick any troubled changeset to solve
+
+    The working directory is updated to the newly created revision.
     """
 
     contopt = opts['continue']
     tr = _picknexttroubled(ui, repo, anyopt)
     if tr is None:
         if troubled:
-            ui.write_err(_('nothing to stabilize here\n'))
+            ui.write_err(_('nothing to evolve here\n'))
             ui.status(_('(%i troubled changesets, do you want --any ?)\n')
                       % len(troubled))
             return 2
             relocate(repo, orig, target)
         except MergeFailure:
             repo.opener.write('graftstate', orig.hex() + '\n')
-            repo.ui.write_err(_('stabilize failed!\n'))
-            repo.ui.write_err(_('fix conflict and run "hg stabilize --continue"\n'))
+            repo.ui.write_err(_('evolve failed!\n'))
+            repo.ui.write_err(_('fix conflict and run "hg evolve --continue"\n'))
             raise
         finally:
             lock.release()
     prec = repo.set('last(allprecursors(%d) and public())', latecomer).next()
     # For now we deny target merge
     if len(prec.parents()) > 1:
-        raise util.Abort('late comer stabilization is confused by precursors'
+        raise util.Abort('late comer evolution is confused by precursors'
                          ' %s being a merge' % prec)
 
     displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate})
                             createmarkers(repo, [(latecomer, (tmpctx,))])
                     except MergeFailure:
                         repo.opener.write('graftstate', latecomer.hex() + '\n')
-                        repo.ui.write_err(_('stabilize failed!\n'))
-                        repo.ui.write_err(_('fix conflict and run "hg stabilize --continue"\n'))
+                        repo.ui.write_err(_('evolution failed!\n'))
+                        repo.ui.write_err(_('fix conflict and run "hg evolve --continue"\n'))
                         raise
                 # Create the new commit context
                 repo.ui.status(_('computing new diff\n'))
                                  "or 'hg update -C .' to abandon\n"))
             #repo.dirstate.write()
             if stats[3] > 0:
-                raise util.Abort('GASP! Merge Conflict! You are on you own chap!')
+                raise util.Abort('GASP! Merge Conflict! You are on you own chap!',
+                                 hint='/!\\ hg evolve --continue will NOT work /!\\')
             tr = repo.transaction('stabilize-conflicting')
             try:
                 repo.dirstate.setparents(conflicting.node(), node.nullid)

tests/test-evolve.t

   7b36850622b2fd159fa30a4fb2a1edd2043b4a14 f8111a076f0975cbecb336e2bd3411be22b673fb 0 {'date': '* *', 'user': 'test'} (glob)
   e416e48b27428695d00c2a2cc4a0b9619482e63f 23409eba69a0986e90cd42252852c1e6da97af5b 0 {'date': '* *', 'user': 'test'} (glob)
   568a468b60fc99a42d5d4ddbe181caff1eef308d 23409eba69a0986e90cd42252852c1e6da97af5b 0 {'date': '* *', 'user': 'test'} (glob)
-  $ hg stabilize
+  $ hg evolve
   move:[4] another feature
   atop:[6] a nifty feature
   merging main-file-1
   |
   o  0	: base - test
   
-  $ hg stabilize --any --traceback
+  $ hg evolve --any --traceback
   recreate:[8] another feature that rox
   atop:[7] another feature
   computing new diff

tests/test-obsolete.t

   pushing to ../other-new
   searching for changes
   abort: push includes an unstable changeset: a7a6f2b5d8a5!
-  (use 'hg stabilize' to get a stable history or --force to ignore warnings)
+  (use 'hg evolve' to get a stable history or --force to ignore warnings)
   [255]
   $ hg push -f ../other-new
   pushing to ../other-new
   pushing to ../other-new
   searching for changes
   abort: push includes an unstable changeset: 95de7fc6918d!
-  (use 'hg stabilize' to get a stable history or --force to ignore warnings)
+  (use 'hg evolve' to get a stable history or --force to ignore warnings)
   [255]
   $ hg push ../other-new -f # use f because there is unstability
   pushing to ../other-new
 ..  pushing to ../other-old
 ..  searching for changes
 ..  abort: push includes an unstable changeset: 909a0fb57e5d!
-..  (use 'hg stabilize' to get a stable history or --force to ignore warnings)
+..  (use 'hg evolve' to get a stable history or --force to ignore warnings)
 ..  [255]
 ..  $ hg push -f ../other-old
 ..  pushing to ../other-old
   pushing to ../other-new/
   searching for changes
   abort: push includes a latecomer changeset: 6db5e282cb91!
-  (use 'hg stabilize' to get a stable history or --force to ignore warnings)
+  (use 'hg evolve' to get a stable history or --force to ignore warnings)
   [255]
 
 Check hg commit --amend compat

tests/test-stabilize-order.t

 
 Test stabilizing a predecessor child
 
-  $ hg stabilize -v
+  $ hg evolve -v
   move:[5] addb
   atop:[7] adda
   hg rebase -Dr ab8cbb6d87ff -d f5ff10856e5a
   $ hg up 7
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg debugobsolete > successors.old
-  $ hg stabilize -v
+  $ hg evolve -v
   move:[3] addc
   atop:[8] addb
   hg rebase -Dr 7a7552255fb5 -d 6bf44048e43f
   |
   o  0:c471ef929e6a@default(draft) addroot
   
-  $ hg stabilize -v
+  $ hg evolve -v
   no troubled changeset
   [1]
 
   
   $ hg up 9
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ hg stabilize -v
-  nothing to stabilize here
+  $ hg evolve -v
+  nothing to evolve here
   (1 troubled changesets, do you want --any ?)
   [2]
-  $ hg stabilize --any -v
+  $ hg evolve --any -v
   move:[9] addc
   atop:[11] addb
   hg rebase -Dr 5e819fbb0d27 -d 4e7cec6b4afe
   |
   o  0:c471ef929e6a@default(draft) addroot
   
-  $ hg stabilize --any -v
+  $ hg evolve --any -v
   no troubled changeset
   [1]

tests/test-stabilize-result.t

   >     '{rev}:{node|short}@{branch}({phase}) bk:[{bookmarks}] {desc|firstline}\n' "$@"
   > }
 
-Test stabilize removing the changeset being stabilized
+Test evolve removing the changeset being evolved
 
   $ hg init empty
   $ cd empty
   $ echo a >> a
   $ hg amend -m changea
   1 new unstable changesets
-  $ hg stabilize -v
+  $ hg evolve -v
   move:[2] changea
   atop:[4] changea
   hg rebase -Dr cce2c55b8965 -d 1447e1c4828d
   102a90ea7b4a3361e4082ed620918c261189a36a 1447e1c4828d2347df8f858aa041305fa4cf7db1 0 {'date': '* *', 'user': 'test'} (glob)
   cce2c55b896511e0b6e04173c9450ba822ebc740 0 {'date': '* *', 'user': 'test'} (glob)
 
-Test stabilize with conflict
+Test evolve with conflict
 
   $ ls
   a
   $ echo 'a' > a
   $ hg amend
   1 new unstable changesets
-  $ hg stabilize
+  $ hg evolve
   move:[5] newer a
   atop:[7] changea
   merging a
   warning: conflicts during merge.
   merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
-  stabilize failed!
-  fix conflict and run "hg stabilize --continue"
+  evolve failed!
+  fix conflict and run "hg evolve --continue"
   abort: unresolved merge conflicts (see hg help resolve)
   [255]
   $ hg revert -r 'unstable()' a
    a
   +a
   +newer a
-  $ hg stabilize --continue
+  $ hg evolve --continue
   grafting revision 5
   abort: unresolved merge conflicts (see hg help resolve)
   [255]
   $ hg resolve -m a
-  $ hg stabilize --continue
+  $ hg evolve --continue
   grafting revision 5
 
 Stabilize of late comer with different parent
 
 Stabilize !
 
-  $ hg stabilize --any --dry-run
+  $ hg evolve --any --dry-run
   recreate:[12] newer a
   atop:[8] newer a
   hg rebase --rev 15c83af6f3a3 --detach e8cc1b534401;
   hg update e3183e9c0961;
   hg revert --all --rev 15c83af6f3a3;
   hg commit --msg "latecomer update to %s" (no-eol)
-  $ hg stabilize --any
+  $ hg evolve --any
   recreate:[12] newer a
   atop:[8] newer a
   rebasing to destination parent: e8cc1b534401
 
 Stabilize It
 
-  $ hg stabilize -qn
+  $ hg evolve -qn
   hg update -c 3883461cc228 &&
   hg merge 4754d61bc2db && 
   hg commit -m "auto merge resolving conflict between 3883461cc228 and 4754d61bc2db"&&
   hg up -C 7391601a4bfa &&
   hg revert --all --rev tip &&
   hg commit -m "`hg log -r 3883461cc228 --template={desc}`";
-  $ hg stabilize -v
+  $ hg evolve -v
   merge:[19] More addition
   with: [17] More addition
   base: [15] More addition
   a
   a
   $ hg st
-  $ hg amend -d '0 0' -m 'More addition' # kill date variation XXX should be done in stabilize
+  $ hg amend -d '0 0' -m 'More addition' # kill date variation XXX should be done in evolve
   $ glog
   @  22:ac6d600735a4@default(draft) bk:[] More addition
   |

tests/test-tutorial.t

   pushing to $TESTTMP/other
   searching for changes
   abort: push includes an unstable changeset: 9ac5d0e790a2!
-  (use 'hg stabilize' to get a stable history or --force to ignore warnings)
+  (use 'hg evolve' to get a stable history or --force to ignore warnings)
   [255]
  
 
 
 
 To resolve this unstable state, you need to rebase 9ac5d0e790a2 onto
-ffa278c50818 the "hg stabilize" command will make this for you.
+ffa278c50818 the "hg evolve" command will make this for you.
 
 It has a --dry-run option to only suggest the next move.
 
-  $ hg stabilize --dry-run
+  $ hg evolve --dry-run
   move:[15] animals
   atop:[14] bathroom stuff
   hg rebase -Dr 9ac5d0e790a2 -d ffa278c50818
   $ hg log -r 'unstable()'
   ae45c0c3092a (draft): SPAM SPAM SPAM
 
-  $ hg stabilize --any
+  $ hg evolve --any
   move:[17] SPAM SPAM SPAM
   atop:[14] bathroom stuff
   merging shopping
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.