comparison mercurial/cmdutil.py @ 42163:e45c6b153e51 stable

commit: allow --interactive to work again when naming a directory (issue6131)
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 06 May 2019 22:10:34 -0400
parents db72f9f6580e
children 19b95afb0c01
comparison
equal deleted inserted replaced
42162:29798c9ba5c9 42163:e45c6b153e51
270 merge = len(wctx.parents()) > 1 270 merge = len(wctx.parents()) > 1
271 if merge: 271 if merge:
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}
278 287
279 with repo.ui.configoverride(overrides, b'record'): 288 with repo.ui.configoverride(overrides, b'record'):
291 repo.ui, wctx, tmpstatus, match, force=True) 300 repo.ui, wctx, tmpstatus, match, force=True)
292 for s in subs: 301 for s in subs:
293 if s in commitsubs: 302 if s in commitsubs:
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
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 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,
309 section='commands', 309 section='commands',