hgext/evolve.py
changeset 985 6a37044ec0b3
parent 983 914255564352
child 986 c1f8ece4182d
--- a/hgext/evolve.py	Sat Jun 21 18:31:21 2014 -0400
+++ b/hgext/evolve.py	Sun Jun 22 12:01:11 2014 -0400
@@ -328,9 +328,11 @@
 commitopts3 = [
     ('D', 'current-date', None,
      _('record the current date as commit date')),
+    ('U', 'current-user', None,
+     _('record the current user as committer')),
 ]
 
-def _resolveoptions(opts):
+def _resolveoptions(ui, opts):
     """modify commit options dict to handle related options
 
     For now, all it does is figure out the commit date: respect -D unless
@@ -339,6 +341,8 @@
     # N.B. this is extremely similar to setupheaderopts() in mq.py
     if not opts.get('date') and opts.get('current_date'):
         opts['date'] = '%d %d' % util.makedate()
+    if not opts.get('user') and opts.get('current_user'):
+        opts['user'] = ui.username()
 
 @eh.wrapfunction(mercurial.obsolete, 'createmarkers')
 def _createmarkers(orig, repo, relations, *args, **kwargs):
@@ -1841,7 +1845,7 @@
     opts['amend'] = True
     if not (edit or opts['message']):
         opts['message'] = repo['.'].description()
-    _resolveoptions(opts)
+    _resolveoptions(ui, opts)
     _alias, commitcmd = cmdutil.findcmd('commit', commands.table)
     return commitcmd[0](ui, repo, *pats, **opts)