Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 2181:690da72b0b16
deprecate addremove command.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Tue, 02 May 2006 21:50:53 -0700 |
parents | 520dd3d28e9b |
children | 2477a7183a6f |
comparison
equal
deleted
inserted
replaced
2180:82385773df6c | 2181:690da72b0b16 |
---|---|
807 ui.status(_('adding %s\n') % rel) | 807 ui.status(_('adding %s\n') % rel) |
808 names.append(abs) | 808 names.append(abs) |
809 repo.add(names) | 809 repo.add(names) |
810 | 810 |
811 def addremove(ui, repo, *pats, **opts): | 811 def addremove(ui, repo, *pats, **opts): |
812 """add all new files, delete all missing files | 812 """add all new files, delete all missing files (DEPRECATED) |
813 | 813 |
814 (DEPRECATED) | |
814 Add all new files and remove all missing files from the repository. | 815 Add all new files and remove all missing files from the repository. |
815 | 816 |
816 New files are ignored if they match any of the patterns in .hgignore. As | 817 New files are ignored if they match any of the patterns in .hgignore. As |
817 with add, these changes take effect at the next commit. | 818 with add, these changes take effect at the next commit. |
818 """ | 819 |
820 This command is now deprecated and will be removed in a future | |
821 release. Please use add and remove --after instead. | |
822 """ | |
823 ui.warn(_('(the addremove command is deprecated; use add and remove ' | |
824 '--after instead)\n')) | |
819 return addremove_lock(ui, repo, pats, opts) | 825 return addremove_lock(ui, repo, pats, opts) |
820 | 826 |
821 def addremove_lock(ui, repo, pats, opts, wlock=None): | 827 def addremove_lock(ui, repo, pats, opts, wlock=None): |
822 add, remove = [], [] | 828 add, remove = [], [] |
823 for src, abs, rel, exact in walk(repo, pats, opts): | 829 for src, abs, rel, exact in walk(repo, pats, opts): |
1151 except IOError, inst: | 1157 except IOError, inst: |
1152 raise util.Abort(_("can't read commit message '%s': %s") % | 1158 raise util.Abort(_("can't read commit message '%s': %s") % |
1153 (logfile, inst.strerror)) | 1159 (logfile, inst.strerror)) |
1154 | 1160 |
1155 if opts['addremove']: | 1161 if opts['addremove']: |
1156 addremove(ui, repo, *pats, **opts) | 1162 addremove_lock(ui, repo, pats, opts) |
1157 fns, match, anypats = matchpats(repo, pats, opts) | 1163 fns, match, anypats = matchpats(repo, pats, opts) |
1158 if pats: | 1164 if pats: |
1159 modified, added, removed, deleted, unknown = ( | 1165 modified, added, removed, deleted, unknown = ( |
1160 repo.changes(files=fns, match=match)) | 1166 repo.changes(files=fns, match=match)) |
1161 files = modified + added + removed | 1167 files = modified + added + removed |
1892 ui.debug(_('message:\n%s\n') % message) | 1898 ui.debug(_('message:\n%s\n') % message) |
1893 | 1899 |
1894 files = util.patch(strip, pf, ui) | 1900 files = util.patch(strip, pf, ui) |
1895 | 1901 |
1896 if len(files) > 0: | 1902 if len(files) > 0: |
1897 addremove(ui, repo, *files) | 1903 addremove_lock(ui, repo, files, {}) |
1898 repo.commit(files, message, user) | 1904 repo.commit(files, message, user) |
1899 | 1905 |
1900 def incoming(ui, repo, source="default", **opts): | 1906 def incoming(ui, repo, source="default", **opts): |
1901 """show new changesets found in source | 1907 """show new changesets found in source |
1902 | 1908 |