comparison 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
comparison
equal deleted inserted replaced
809:d0fb9efa2b2d 810:790a0ff306f2
599 ui.note(len(revs) > 1 and "Exporting patches:\n" or "Exporting patch:\n") 599 ui.note(len(revs) > 1 and "Exporting patches:\n" or "Exporting patch:\n")
600 for cset in revs: 600 for cset in revs:
601 seqno += 1 601 seqno += 1
602 doexport(ui, repo, cset, seqno, total, revwidth, opts) 602 doexport(ui, repo, cset, seqno, total, revwidth, opts)
603 603
604 def forget(ui, repo, file1, *files): 604 def forget(ui, repo, *pats, **opts):
605 """don't add the specified files on the next commit""" 605 """don't add the specified files on the next commit"""
606 repo.forget(relpath(repo, (file1,) + files)) 606 q = dict(zip(pats, pats))
607 forget = []
608 for src, abs, rel in walk(repo, pats, opts):
609 if repo.dirstate.state(abs) == 'a':
610 forget.append(abs)
611 if rel not in q: ui.status('forgetting ', rel, '\n')
612 repo.forget(forget)
607 613
608 def heads(ui, repo): 614 def heads(ui, repo):
609 """show current repository heads""" 615 """show current repository heads"""
610 for n in repo.changelog.heads(): 616 for n in repo.changelog.heads():
611 show_changeset(ui, repo, changenode=n) 617 show_changeset(ui, repo, changenode=n)
1151 'hg diff [-r REV1 [-r REV2]] [FILE]...'), 1157 'hg diff [-r REV1 [-r REV2]] [FILE]...'),
1152 "^export": 1158 "^export":
1153 (export, 1159 (export,
1154 [('o', 'output', "", 'output to file')], 1160 [('o', 'output', "", 'output to file')],
1155 "hg export [-o OUTFILE] REV..."), 1161 "hg export [-o OUTFILE] REV..."),
1156 "forget": (forget, [], "hg forget FILE..."), 1162 "forget": (forget,
1163 [('I', 'include', [], 'include path in search'),
1164 ('X', 'exclude', [], 'exclude path from search')],
1165 "hg forget FILE..."),
1157 "heads": (heads, [], 'hg heads'), 1166 "heads": (heads, [], 'hg heads'),
1158 "help": (help_, [], 'hg help [COMMAND]'), 1167 "help": (help_, [], 'hg help [COMMAND]'),
1159 "identify|id": (identify, [], 'hg identify'), 1168 "identify|id": (identify, [], 'hg identify'),
1160 "import|patch": 1169 "import|patch":
1161 (import_, 1170 (import_,