diff --git a/hgext/uncommit.py b/hgext/uncommit.py --- a/hgext/uncommit.py +++ b/hgext/uncommit.py @@ -136,7 +136,8 @@ ds.copy(src, dst) @command('uncommit', - [('', 'keep', False, _('allow an empty commit after uncommiting')), + [('i', 'interactive', None, _('use interactive mode')), + ('', 'keep', False, _('allow an empty commit after uncommiting')), ] + commands.walkopts, _('[OPTION]... [FILE]...'), helpcategory=command.CATEGORY_CHANGE_MANAGEMENT) @@ -186,6 +187,11 @@ s = old.p1().status(old, match=match) _fixdirstate(repo, old, repo[newid], s) + if opts.get(r'interactive'): + opts.pop(r'interactive') + ret = cmdutil.dorecord(ui, repo, commands.commit, None, False, + cmdutil.recordfilter, *pats, + **opts) def predecessormarkers(ctx): """yields the obsolete markers marking the given changeset as a successor""" for data in ctx.repo().obsstore.predecessors.get(ctx.node(), ()): diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t --- a/tests/test-uncommit.t +++ b/tests/test-uncommit.t @@ -1,6 +1,8 @@ Test uncommit - set up the config $ cat >> $HGRCPATH < [ui] + > interactive = true > [experimental] > evolution.createmarkers=True > evolution.allowunstable=True @@ -34,6 +36,7 @@ options ([+] can be repeated): + -i --interactive use interactive mode --keep allow an empty commit after uncommiting -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns @@ -398,3 +401,17 @@ |/ o 0:ea4e33293d4d274a2ba73150733c2612231f398c a 1 +Test for interactive mode + $ hg init repo3 + $ touch x + $ hg add x + $ hg commit -m "added x" + $ hg uncommit -i< y + > EOF + diff --git a/x b/x + new file mode 100644 + examine changes to 'x'? [Ynesfdaq?] y + + abort: empty commit message + [255]