# HG changeset patch # User Laurent Charignon # Date 1426112524 25200 # Node ID 0b94b68aace92ff51039c233781398fe9d43bc7d # Parent 22d560fe1516516261f22cc822102e03115f9b58 record: add interactive option to the commit command diff -r 22d560fe1516 -r 0b94b68aace9 hgext/record.py --- a/hgext/record.py Tue Mar 10 16:26:13 2015 -0700 +++ b/hgext/record.py Wed Mar 11 15:22:04 2015 -0700 @@ -18,7 +18,8 @@ @command("record", # same options as commit + white space diff options - commands.table['^commit|ci'][1][:] + commands.diffwsopts, + [c for c in commands.table['^commit|ci'][1][:] + if c[1] != "interactive"] + commands.diffwsopts, _('hg record [OPTION]... [FILE]...')) def record(ui, repo, *pats, **opts): '''interactively select changes to commit diff -r 22d560fe1516 -r 0b94b68aace9 mercurial/commands.py --- a/mercurial/commands.py Tue Mar 10 16:26:13 2015 -0700 +++ b/mercurial/commands.py Wed Mar 11 15:22:04 2015 -0700 @@ -1383,6 +1383,7 @@ ('', 'amend', None, _('amend the parent of the working dir')), ('s', 'secret', None, _('use the secret phase for committing')), ('e', 'edit', None, _('invoke editor on commit messages')), + ('i', 'interactive', None, _('use interactive mode')), ] + walkopts + commitopts + commitopts2 + subrepoopts, _('[OPTION]... [FILE]...'), inferrepo=True) @@ -1422,6 +1423,11 @@ Returns 0 on success, 1 if nothing changed. """ + if opts.get('interactive'): + opts.pop('interactive') + cmdutil.dorecord(ui, repo, commit, 'commit', False, *pats, **opts) + return + if opts.get('subrepos'): if opts.get('amend'): raise util.Abort(_('cannot amend with --subrepos')) diff -r 22d560fe1516 -r 0b94b68aace9 tests/test-completion.t --- a/tests/test-completion.t Tue Mar 10 16:26:13 2015 -0700 +++ b/tests/test-completion.t Wed Mar 11 15:22:04 2015 -0700 @@ -202,7 +202,7 @@ add: include, exclude, subrepos, dry-run annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, ignore-all-space, ignore-space-change, ignore-blank-lines, include, exclude, template clone: noupdate, updaterev, rev, branch, pull, uncompressed, ssh, remotecmd, insecure - commit: addremove, close-branch, amend, secret, edit, include, exclude, message, logfile, date, user, subrepos + commit: addremove, close-branch, amend, secret, edit, interactive, include, exclude, message, logfile, date, user, subrepos diff: rev, change, text, git, nodates, noprefix, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude, subrepos export: output, switch-parent, rev, text, git, nodates forget: include, exclude