# HG changeset patch # User Matt Mackall # Date 1163656779 21600 # Node ID b4903debbe3be1fd78ddd26ee783f7cdfc9bc5c0 # Parent f4dc02d7fb714eaa8b7d722dd264101c0c8d08a9 abort if explicitly committed files are not found or not tracked diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -418,8 +418,15 @@ def commit(ui, repo, *pats, **opts): cmdutil.addremove(repo, pats, opts) fns, match, anypats = cmdutil.matchpats(repo, pats, opts) if pats: - modified, added, removed = repo.status(files=fns, match=match)[:3] + status = repo.status(files=fns, match=match) + modified, added, removed, deleted, unknown = status[:5] files = modified + added + removed + for f in fns: + if f not in modified + added + removed: + if f in unknown: + raise util.Abort(_("file %s not tracked!") % f) + else: + raise util.Abort(_("file %s not found!") % f) else: files = [] try: