Show More
@@ -171,9 +171,22 b' def add(ui, repo, file, *files):' | |||
|
171 | 171 | '''add the specified files on the next commit''' |
|
172 | 172 | repo.add(relpath(repo, (file,) + files)) |
|
173 | 173 | |
|
174 | def addremove(ui, repo): | |
|
174 | def addremove(ui, repo, *files): | |
|
175 | 175 | """add all new files, delete all missing files""" |
|
176 | (c, a, d, u) = repo.diffdir(repo.root) | |
|
176 | if files: | |
|
177 | files = relpath(repo, files) | |
|
178 | d = [] | |
|
179 | u = [] | |
|
180 | for f in files: | |
|
181 | p = repo.wjoin(f) | |
|
182 | s = repo.dirstate.state(f) | |
|
183 | isfile = os.path.isfile(p) | |
|
184 | if s != 'r' and not isfile: | |
|
185 | d.append(f) | |
|
186 | elif s not in 'nmai' and isfile: | |
|
187 | u.append(f) | |
|
188 | else: | |
|
189 | (c, a, d, u) = repo.diffdir(repo.root) | |
|
177 | 190 | repo.add(u) |
|
178 | 191 | repo.remove(d) |
|
179 | 192 | |
@@ -573,7 +586,7 b' def verify(ui, repo):' | |||
|
573 | 586 | |
|
574 | 587 | table = { |
|
575 | 588 | "add": (add, [], "hg add [files]"), |
|
576 | "addremove": (addremove, [], "hg addremove"), | |
|
589 | "addremove": (addremove, [], "hg addremove [files]"), | |
|
577 | 590 | "ann|annotate": (annotate, |
|
578 | 591 | [('r', 'revision', '', 'revision'), |
|
579 | 592 | ('u', 'user', None, 'show user'), |
General Comments 0
You need to be logged in to leave comments.
Login now