changeset 1299:765286e47619

merge with stable
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 29 Apr 2015 14:49:02 -0700
parents b8c01464323c (current diff) 23819e1d61fd (diff)
children 4a27123e0696
files hgext/evolve.py
diffstat 3 files changed, 51 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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
 
--- 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
--- 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)