Show More
@@ -171,9 +171,22 b' def add(ui, repo, file, *files):' | |||||
171 | '''add the specified files on the next commit''' |
|
171 | '''add the specified files on the next commit''' | |
172 | repo.add(relpath(repo, (file,) + files)) |
|
172 | repo.add(relpath(repo, (file,) + files)) | |
173 |
|
173 | |||
174 | def addremove(ui, repo): |
|
174 | def addremove(ui, repo, *files): | |
175 | """add all new files, delete all missing files""" |
|
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 | repo.add(u) |
|
190 | repo.add(u) | |
178 | repo.remove(d) |
|
191 | repo.remove(d) | |
179 |
|
192 | |||
@@ -573,7 +586,7 b' def verify(ui, repo):' | |||||
573 |
|
586 | |||
574 | table = { |
|
587 | table = { | |
575 | "add": (add, [], "hg add [files]"), |
|
588 | "add": (add, [], "hg add [files]"), | |
576 | "addremove": (addremove, [], "hg addremove"), |
|
589 | "addremove": (addremove, [], "hg addremove [files]"), | |
577 | "ann|annotate": (annotate, |
|
590 | "ann|annotate": (annotate, | |
578 | [('r', 'revision', '', 'revision'), |
|
591 | [('r', 'revision', '', 'revision'), | |
579 | ('u', 'user', None, 'show user'), |
|
592 | ('u', 'user', None, 'show user'), |
General Comments 0
You need to be logged in to leave comments.
Login now