Comments
Patch
@@ -1,6 +1,8 @@
Test uncommit - set up the config
$ cat >> $HGRCPATH <<EOF
+ > [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<<EOF
+ > y
+ > EOF
+ diff --git a/x b/x
+ new file mode 100644
+ examine changes to 'x'? [Ynesfdaq?] y
+
+ abort: empty commit message
+ [255]
@@ -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(), ()):