diff -r ca39b80cbe15 -r dda243bb34b3 mercurial/commands.py --- a/mercurial/commands.py Wed Jun 15 09:50:00 2005 -0800 +++ b/mercurial/commands.py Wed Jun 15 10:00:10 2005 -0800 @@ -171,9 +171,22 @@ '''add the specified files on the next commit''' repo.add(relpath(repo, (file,) + files)) -def addremove(ui, repo): +def addremove(ui, repo, *files): """add all new files, delete all missing files""" - (c, a, d, u) = repo.diffdir(repo.root) + if files: + files = relpath(repo, files) + d = [] + u = [] + for f in files: + p = repo.wjoin(f) + s = repo.dirstate.state(f) + isfile = os.path.isfile(p) + if s != 'r' and not isfile: + d.append(f) + elif s not in 'nmai' and isfile: + u.append(f) + else: + (c, a, d, u) = repo.diffdir(repo.root) repo.add(u) repo.remove(d) @@ -573,7 +586,7 @@ table = { "add": (add, [], "hg add [files]"), - "addremove": (addremove, [], "hg addremove"), + "addremove": (addremove, [], "hg addremove [files]"), "ann|annotate": (annotate, [('r', 'revision', '', 'revision'), ('u', 'user', None, 'show user'),