comparison mercurial/commands.py @ 3670:b4903debbe3b

abort if explicitly committed files are not found or not tracked
author Matt Mackall <mpm@selenic.com>
date Wed, 15 Nov 2006 23:59:39 -0600
parents f4dc02d7fb71
children 86d3f966201d
comparison
equal deleted inserted replaced
3669:f4dc02d7fb71 3670:b4903debbe3b
416 416
417 if opts['addremove']: 417 if opts['addremove']:
418 cmdutil.addremove(repo, pats, opts) 418 cmdutil.addremove(repo, pats, opts)
419 fns, match, anypats = cmdutil.matchpats(repo, pats, opts) 419 fns, match, anypats = cmdutil.matchpats(repo, pats, opts)
420 if pats: 420 if pats:
421 modified, added, removed = repo.status(files=fns, match=match)[:3] 421 status = repo.status(files=fns, match=match)
422 modified, added, removed, deleted, unknown = status[:5]
422 files = modified + added + removed 423 files = modified + added + removed
424 for f in fns:
425 if f not in modified + added + removed:
426 if f in unknown:
427 raise util.Abort(_("file %s not tracked!") % f)
428 else:
429 raise util.Abort(_("file %s not found!") % f)
423 else: 430 else:
424 files = [] 431 files = []
425 try: 432 try:
426 repo.commit(files, message, opts['user'], opts['date'], match, 433 repo.commit(files, message, opts['user'], opts['date'], match,
427 force_editor=opts.get('force_editor')) 434 force_editor=opts.get('force_editor'))