Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 810:790a0ff306f2
Move commands.forget over to using new walk code.
With no names, it now recursively forgets everything, as is the default
behaviour of other commands. And prints the names of all files it
hasn't specifically been told to forget.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Fri, 29 Jul 2005 08:49:01 -0800 |
parents | d0fb9efa2b2d |
children | b65af904d6d7 |
line wrap: on
line diff
--- a/mercurial/commands.py Fri Jul 29 08:42:28 2005 -0800 +++ b/mercurial/commands.py Fri Jul 29 08:49:01 2005 -0800 @@ -601,9 +601,15 @@ seqno += 1 doexport(ui, repo, cset, seqno, total, revwidth, opts) -def forget(ui, repo, file1, *files): +def forget(ui, repo, *pats, **opts): """don't add the specified files on the next commit""" - repo.forget(relpath(repo, (file1,) + files)) + q = dict(zip(pats, pats)) + forget = [] + for src, abs, rel in walk(repo, pats, opts): + if repo.dirstate.state(abs) == 'a': + forget.append(abs) + if rel not in q: ui.status('forgetting ', rel, '\n') + repo.forget(forget) def heads(ui, repo): """show current repository heads""" @@ -1153,7 +1159,10 @@ (export, [('o', 'output', "", 'output to file')], "hg export [-o OUTFILE] REV..."), - "forget": (forget, [], "hg forget FILE..."), + "forget": (forget, + [('I', 'include', [], 'include path in search'), + ('X', 'exclude', [], 'exclude path from search')], + "hg forget FILE..."), "heads": (heads, [], 'hg heads'), "help": (help_, [], 'hg help [COMMAND]'), "identify|id": (identify, [], 'hg identify'),