# HG changeset patch # User Pierre-Yves David # Date 1430344142 25200 # Node ID 765286e476192f392c2897aa77855a38b6d829f7 # Parent b8c01464323c45a0333a1d8632a763d2c564f913# Parent 23819e1d61fd5e5a013f0f101f1298123f82f22b merge with stable diff -r b8c01464323c -r 765286e47619 README --- a/README Wed Apr 29 14:48:41 2015 -0700 +++ b/README Wed Apr 29 14:49:02 2015 -0700 @@ -54,6 +54,7 @@ 5.1.5 -- - minor documentation cleanup +- support -i option for `hg amend` if commit supports it (3.4) 5.1.4 -- 2015-04-23 diff -r b8c01464323c -r 765286e47619 hgext/evolve.py --- a/hgext/evolve.py Wed Apr 29 14:48:41 2015 -0700 +++ b/hgext/evolve.py Wed Apr 29 14:49:02 2015 -0700 @@ -88,7 +88,12 @@ else: raise ImportError('evolve needs version %s or above' % min(testedwith.split())) - +aliases, entry = cmdutil.findcmd('commit', commands.table) +hasinteractivemode = util.any(['interactive' in e for e in entry[1]]) +if hasinteractivemode: + interactiveopt = [['i', 'interactive', None, _('use interactive mode')]] +else: + interactiveopt = [] # This extension contains the following code # # - Extension Helper code @@ -1904,7 +1909,7 @@ ('', 'close-branch', None, _('mark a branch as closed, hiding it from the branch list')), ('s', 'secret', None, _('use the secret phase for committing')), - ] + walkopts + commitopts + commitopts2 + commitopts3, + ] + walkopts + commitopts + commitopts2 + commitopts3 + interactiveopt, _('[OPTION]... [FILE]...')) def amend(ui, repo, *pats, **opts): """combine a changeset with updates and replace it with a new one diff -r b8c01464323c -r 765286e47619 tests/test-amend.t --- a/tests/test-amend.t Wed Apr 29 14:48:41 2015 -0700 +++ b/tests/test-amend.t Wed Apr 29 14:49:02 2015 -0700 @@ -115,3 +115,46 @@ branch: foo commit: 1 unknown (clean) update: (current) + +Check the help + $ hg amend -h + hg amend [OPTION]... [FILE]... + + aliases: refresh + + combine a changeset with updates and replace it with a new one + + Commits a new changeset incorporating both the changes to the given files + and all the changes from the current parent changeset into the repository. + + See "hg commit" for details about committing changes. + + If you don't specify -m, the parent's message will be reused. + + 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 new combined changeset. Finally, the old changeset and its update + are hidden from "hg log" (unless you use --hidden with log). + + Returns 0 on success, 1 if nothing changed. + + options ([+] can be repeated): + + -A --addremove mark new/missing files as added/removed before + committing + -e --edit invoke editor on commit messages + --close-branch mark a branch as closed, hiding it from the branch + list + -s --secret use the secret phase for committing + -I --include PATTERN [+] include names matching the given patterns + -X --exclude PATTERN [+] exclude names matching the given patterns + -m --message TEXT use text as commit message + -l --logfile FILE read commit message from file + -d --date DATE record the specified date as commit date + -u --user USER record the specified user as committer + -D --current-date record the current date as commit date + -U --current-user record the current user as committer + -i --interactive use interactive mode + + (some details hidden, use --verbose to show complete help)