# HG changeset patch # User timeless # Date 1459966776 0 # Node ID 44611ad4fbd92183371c3e7d9a3f5ec490ea5114 # Parent 1f65f291a5b7a7ecd6c70d587075f5a7403cf6a7 crecord: check for untracked arguments hg commit tracked untracked -- fails complaining about untracked prior to this commit, hg commit -i tracked untracked -- did not fail This is corrected by calling the refactored localrepo.checkcommitpatterns diff -r 1f65f291a5b7 -r 44611ad4fbd9 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Wed Apr 06 18:08:38 2016 +0000 +++ b/mercurial/cmdutil.py Wed Apr 06 18:19:36 2016 +0000 @@ -135,12 +135,24 @@ """ checkunfinished(repo, commit=True) - merge = len(repo[None].parents()) > 1 + wctx = repo[None] + merge = len(wctx.parents()) > 1 if merge: raise error.Abort(_('cannot partially commit a merge ' '(use "hg commit" instead)')) + def fail(f, msg): + raise error.Abort('%s: %s' % (f, msg)) + + force = opts.get('force') + if not force: + vdirs = [] + match.explicitdir = vdirs.append + match.bad = fail + status = repo.status(match=match) + if not force: + repo.checkcommitpatterns(wctx, vdirs, match, status, fail) diffopts = patch.difffeatureopts(ui, opts=opts, whitespace=True) diffopts.nodates = True diffopts.git = True diff -r 1f65f291a5b7 -r 44611ad4fbd9 tests/test-commit-interactive.t --- a/tests/test-commit-interactive.t Wed Apr 06 18:08:38 2016 +0000 +++ b/tests/test-commit-interactive.t Wed Apr 06 18:19:36 2016 +0000 @@ -59,6 +59,14 @@ +Abort for untracked + + $ touch untracked + $ hg commit -i -m should-fail empty-rw untracked + abort: untracked: file not tracked! + [255] + $ rm untracked + Record empty file $ hg commit -i -d '0 0' -m empty empty-rw<