Mercurial > evolve
changeset 695:7daf42959b72 stable
amend: drop the --change option
it is deprecated for quite some time already
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Fri, 08 Feb 2013 20:18:40 +0000 |
parents | c800d7ca4583 |
children | 121e2d265e85 |
files | hgext/evolve.py tests/test-amend.t tests/test-evolve.t |
diffstat | 3 files changed, 1 insertions(+), 41 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/evolve.py Wed Feb 06 23:21:42 2013 +0000 +++ b/hgext/evolve.py Fri Feb 08 20:18:40 2013 +0000 @@ -1314,7 +1314,6 @@ [('A', 'addremove', None, _('mark new/missing files as added/removed before committing')), ('n', 'note', '', _('use text as commit message for this update')), - ('c', 'change', '', _('specifies the changesets to amend (DEPRECATED)'), _('REV')), ('e', 'edit', False, _('invoke editor on commit messages')), ] + walkopts + commitopts + commitopts2, _('[OPTION]... [FILE]...')) @@ -1328,10 +1327,6 @@ If you don't specify -m, the parent's message will be reused. - If you specify --change, amend additionally considers all - changesets between the indicated changeset and the working copy - parent as updates to be subsumed. - Behind the scenes, Mercurial first commits the update as a regular child of the current parent. Then it creates a new commit on the parent's parents with the updated contents. Then it changes the working copy parent to this @@ -1342,7 +1337,7 @@ """ # determine updates to subsume - old = scmutil.revsingle(repo, opts.get('change') or '.') + old = scmutil.revsingle(repo, '.') lock = repo.lock() try: @@ -1351,8 +1346,6 @@ if old.phase() == phases.public: raise util.Abort(_("can not rewrite immutable changeset %s") % old) - if not repo.revs('%d and (::.)', old): - raise error.Abort(_('cannot amend non ancestor changeset')) tr = repo.transaction('amend') try: oldphase = old.phase()
--- a/tests/test-amend.t Wed Feb 06 23:21:42 2013 +0000 +++ b/tests/test-amend.t Fri Feb 08 20:18:40 2013 +0000 @@ -68,9 +68,6 @@ -a $ hg pdiff $ hg ci -m reseta - $ hg amend --change 2 - abort: no updates found - [255] $ hg debugobsolete bd19cbe78fbfbd87eb33420c63986fe5f3154f2c a34b93d251e49c93d5685ebacad785c73a7e8605 0 {'date': '* *', 'user': 'test'} (glob) 07f4944404050f47db2e5c5071e0e84e7a27bba9 a34b93d251e49c93d5685ebacad785c73a7e8605 0 {'date': '* *', 'user': 'test'} (glob) @@ -84,30 +81,3 @@ o 2@foo(draft) adda -Test collapsing into an existing rev, with an intermediate revision. - - $ hg branch --force default - marked working directory as branch default - (branches are permanent and global, did you want a bookmark?) - $ hg ci -m resetbranch - $ hg branch --force foo - marked working directory as branch foo - (branches are permanent and global, did you want a bookmark?) - $ hg amend --change 2 - abort: no updates found - [255] - $ hg debugobsolete - bd19cbe78fbfbd87eb33420c63986fe5f3154f2c a34b93d251e49c93d5685ebacad785c73a7e8605 0 {'date': '* *', 'user': 'test'} (glob) - 07f4944404050f47db2e5c5071e0e84e7a27bba9 a34b93d251e49c93d5685ebacad785c73a7e8605 0 {'date': '* *', 'user': 'test'} (glob) - 7384bbcba36fde1a789cd00f9cd6f9b919ab5910 0 {'date': '* *', 'user': 'test'} (glob) - $ glog - @ 6@foo(draft) amends a34b93d251e49c93d5685ebacad785c73a7e8605 - | - o 5@default(draft) resetbranch - | - o 4@foo(draft) reseta - | - o 3@foo(draft) changea - | - o 2@foo(draft) adda -