Pierre-Yves David avatar Pierre-Yves David committed 7daf429

amend: drop the --change option

it is deprecated for quite some time already

Comments (0)

Files changed (3)

     [('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]...'))
 
     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
     """
 
     # determine updates to subsume
-    old = scmutil.revsingle(repo, opts.get('change') or '.')
+    old = scmutil.revsingle(repo, '.')
 
     lock = repo.lock()
     try:
             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()

tests/test-amend.t

   -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)
   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
-  

tests/test-evolve.t

 
   $ hg phase --public 0 -v
   phase changed for 1 changesets
-  $ hg amend -c 4
-  abort: cannot amend non ancestor changeset
-  [255]
 
 
 (amend of on ancestors)
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.