changeset 2729:69fe16428b0f

uncommit: add support for -U and -D
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 11 Jul 2017 12:00:45 +0200
parents 3c371aa16cb9
children 7fbb7a5d359f
files hgext3rd/evolve/evocommands.py tests/test-tutorial.t tests/test-uncommit.t
diffstat 3 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/evocommands.py	Tue Jul 11 11:59:18 2017 +0200
+++ b/hgext3rd/evolve/evocommands.py	Tue Jul 11 12:00:45 2017 +0200
@@ -223,7 +223,7 @@
     '^uncommit',
     [('a', 'all', None, _('uncommit all changes when no arguments given')),
      ('r', 'rev', '', _('revert commit content to REV instead')),
-     ] + commands.walkopts + commitopts + commitopts2,
+     ] + commands.walkopts + commitopts + commitopts2 + commitopts3,
     _('[OPTION]... [NAME]'))
 def uncommit(ui, repo, *pats, **opts):
     """move changes from parent revision to working directory
@@ -243,6 +243,7 @@
     Return 0 if changed files are uncommitted.
     """
 
+    _resolveoptions(ui, opts) # process commitopts3
     wlock = lock = tr = None
     try:
         wlock = repo.wlock()
--- a/tests/test-tutorial.t	Tue Jul 11 11:59:18 2017 +0200
+++ b/tests/test-tutorial.t	Tue Jul 11 12:00:45 2017 +0200
@@ -465,6 +465,8 @@
    -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
   
   (some details hidden, use --verbose to show complete help)
 
--- a/tests/test-uncommit.t	Tue Jul 11 11:59:18 2017 +0200
+++ b/tests/test-uncommit.t	Tue Jul 11 12:00:45 2017 +0200
@@ -384,3 +384,16 @@
   date:        Thu Jan 01 00:22:17 1970 +0000
   summary:     to-uncommit
   
+
+test -U option
+
+  $ hg uncommit -U b
+  $ hg log -r .
+  changeset:   14:288da4a95941
+  branch:      bar
+  tag:         tip
+  parent:      7:4f1c269eab68
+  user:        test
+  date:        Thu Jan 01 00:22:17 1970 +0000
+  summary:     to-uncommit
+