Mercurial > evolve
changeset 492:7ecd41520dae
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.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Fri, 24 Aug 2012 11:17:18 +0200 |
parents | 6989d8fe4ed2 |
children | 9a4867b79f6c |
files | docs/evolve-collaboration.rst docs/evolve-faq.rst docs/from-mq.rst docs/index.rst docs/instability.rst docs/obs-terms.rst hgext/evolve.py tests/test-evolve.t tests/test-obsolete.t tests/test-stabilize-order.t tests/test-stabilize-result.t tests/test-tutorial.t |
diffstat | 12 files changed, 71 insertions(+), 76 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/evolve-collaboration.rst Fri Aug 24 10:44:23 2012 +0200 +++ b/docs/evolve-collaboration.rst Fri Aug 24 11:17:18 2012 +0200 @@ -111,7 +111,7 @@ 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
--- a/docs/evolve-faq.rst Fri Aug 24 10:44:23 2012 +0200 +++ b/docs/evolve-faq.rst Fri Aug 24 11:17:18 2012 +0200 @@ -152,7 +152,7 @@ .. 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 @@ -164,16 +164,6 @@ 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`` ------------------------------------------------------------
--- a/docs/from-mq.rst Fri Aug 24 10:44:23 2012 +0200 +++ b/docs/from-mq.rst Fri Aug 24 11:17:18 2012 +0200 @@ -12,7 +12,7 @@ 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`` @@ -113,7 +113,7 @@ 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::
--- a/docs/index.rst Fri Aug 24 10:44:23 2012 +0200 +++ b/docs/index.rst Fri Aug 24 11:17:18 2012 +0200 @@ -137,11 +137,7 @@ 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
--- a/docs/instability.rst Fri Aug 24 10:44:23 2012 +0200 +++ b/docs/instability.rst Fri Aug 24 11:17:18 2012 +0200 @@ -183,11 +183,11 @@ $ 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
--- a/docs/obs-terms.rst Fri Aug 24 10:44:23 2012 +0200 +++ b/docs/obs-terms.rst Fri Aug 24 11:17:18 2012 +0200 @@ -222,7 +222,7 @@ - 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 @@ -231,9 +231,7 @@ 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
--- a/hgext/evolve.py Fri Aug 24 10:44:23 2012 +0200 +++ b/hgext/evolve.py Fri Aug 24 11:17:18 2012 +0200 @@ -904,20 +904,20 @@ @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 ') @@ -925,7 +925,7 @@ ex.hint = hint raise return result - repo.__class__ = stabilizerrepo + repo.__class__ = evolvingrepo @eh.wrapcommand("summary") def obssummary(orig, ui, repo, *args, **kwargs): @@ -1297,21 +1297,31 @@ 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 + + - rebase unstable changeset to make it stable again, + - create proper diff from latecomer changeset, + - merge conflicting changeset. - 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. + By default, take the first troubles changeset that looks relevant. + + (The logic is still a bit fuzzy) - With --any, stabilize any unstable changeset. + - 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. - The working directory is updated to the rebased revision. + - 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'] @@ -1327,7 +1337,7 @@ 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 @@ -1404,8 +1414,8 @@ 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() @@ -1419,7 +1429,7 @@ 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}) @@ -1456,8 +1466,8 @@ 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')) @@ -1565,7 +1575,8 @@ "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)
--- a/tests/test-evolve.t Fri Aug 24 10:44:23 2012 +0200 +++ b/tests/test-evolve.t Fri Aug 24 11:17:18 2012 +0200 @@ -272,7 +272,7 @@ 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 @@ -312,7 +312,7 @@ | 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
--- a/tests/test-obsolete.t Fri Aug 24 10:44:23 2012 +0200 +++ b/tests/test-obsolete.t Fri Aug 24 11:17:18 2012 +0200 @@ -166,7 +166,7 @@ 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 @@ -219,7 +219,7 @@ 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 @@ -290,7 +290,7 @@ .. 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 @@ -564,7 +564,7 @@ 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
--- a/tests/test-stabilize-order.t Fri Aug 24 10:44:23 2012 +0200 +++ b/tests/test-stabilize-order.t Fri Aug 24 11:17:18 2012 +0200 @@ -62,7 +62,7 @@ Test stabilizing a predecessor child - $ hg stabilize -v + $ hg evolve -v move:[5] addb atop:[7] adda hg rebase -Dr ab8cbb6d87ff -d f5ff10856e5a @@ -88,7 +88,7 @@ $ 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 @@ -116,7 +116,7 @@ | o 0:c471ef929e6a@default(draft) addroot - $ hg stabilize -v + $ hg evolve -v no troubled changeset [1] @@ -140,11 +140,11 @@ $ 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 @@ -163,6 +163,6 @@ | o 0:c471ef929e6a@default(draft) addroot - $ hg stabilize --any -v + $ hg evolve --any -v no troubled changeset [1]
--- a/tests/test-stabilize-result.t Fri Aug 24 10:44:23 2012 +0200 +++ b/tests/test-stabilize-result.t Fri Aug 24 11:17:18 2012 +0200 @@ -12,7 +12,7 @@ > '{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 @@ -28,7 +28,7 @@ $ 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 @@ -49,7 +49,7 @@ 102a90ea7b4a3361e4082ed620918c261189a36a 1447e1c4828d2347df8f858aa041305fa4cf7db1 0 {'date': '* *', 'user': 'test'} (glob) cce2c55b896511e0b6e04173c9450ba822ebc740 0 {'date': '* *', 'user': 'test'} (glob) -Test stabilize with conflict +Test evolve with conflict $ ls a @@ -69,14 +69,14 @@ $ 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 @@ -88,12 +88,12 @@ 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 @@ -146,14 +146,14 @@ 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 @@ -229,14 +229,14 @@ 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 @@ -247,7 +247,7 @@ 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 |
--- a/tests/test-tutorial.t Fri Aug 24 10:44:23 2012 +0200 +++ b/tests/test-tutorial.t Fri Aug 24 11:17:18 2012 +0200 @@ -610,18 +610,18 @@ 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 @@ -741,7 +741,7 @@ $ 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