##// END OF EJS Templates
commit: allow --interactive to work again when naming a directory (issue6131)
Matt Harbison -
r42444:e45c6b15 stable
parent child Browse files
Show More
@@ -272,6 +272,15 b' def dorecord(ui, repo, commitfunc, cmdsu'
272 raise error.Abort(_('cannot partially commit a merge '
272 raise error.Abort(_('cannot partially commit a merge '
273 '(use "hg commit" instead)'))
273 '(use "hg commit" instead)'))
274
274
275 def fail(f, msg):
276 raise error.Abort('%s: %s' % (f, msg))
277
278 force = opts.get('force')
279 if not force:
280 vdirs = []
281 match.explicitdir = vdirs.append
282 match.bad = fail
283
275 status = repo.status(match=match)
284 status = repo.status(match=match)
276
285
277 overrides = {(b'ui', b'commitsubrepos'): True}
286 overrides = {(b'ui', b'commitsubrepos'): True}
@@ -294,15 +303,6 b' def dorecord(ui, repo, commitfunc, cmdsu'
294 dirtyreason = wctx.sub(s).dirtyreason(True)
303 dirtyreason = wctx.sub(s).dirtyreason(True)
295 raise error.Abort(dirtyreason)
304 raise error.Abort(dirtyreason)
296
305
297 def fail(f, msg):
298 raise error.Abort('%s: %s' % (f, msg))
299
300 force = opts.get('force')
301 if not force:
302 vdirs = []
303 match.explicitdir = vdirs.append
304 match.bad = fail
305
306 if not force:
306 if not force:
307 repo.checkcommitpatterns(wctx, vdirs, match, status, fail)
307 repo.checkcommitpatterns(wctx, vdirs, match, status, fail)
308 diffopts = patch.difffeatureopts(ui, opts=opts, whitespace=True,
308 diffopts = patch.difffeatureopts(ui, opts=opts, whitespace=True,
@@ -775,12 +775,24 b' Record end'
775 +10
775 +10
776 +11
776 +11
777
777
778 Interactive commit can name a directory instead of files (issue6131)
778
779
779 $ mkdir subdir
780 $ mkdir subdir
781 $ echo a > subdir/a
782 $ hg ci -d '16 0' -i subdir -Amsubdir <<EOF
783 > y
784 > y
785 > EOF
786 adding subdir/a
787 diff --git a/subdir/a b/subdir/a
788 new file mode 100644
789 examine changes to 'subdir/a'? [Ynesfdaq?] y
790
791 @@ -0,0 +1,1 @@
792 +a
793 record this change to 'subdir/a'? [Ynesfdaq?] y
794
780 $ cd subdir
795 $ cd subdir
781 $ echo a > a
782 $ hg ci -d '16 0' -Amsubdir
783 adding subdir/a
784
796
785 $ echo a >> a
797 $ echo a >> a
786 $ hg commit -i -d '16 0' -m subdir-change a <<EOF
798 $ hg commit -i -d '16 0' -m subdir-change a <<EOF
General Comments 0
You need to be logged in to leave comments. Login now