Mercurial > hg
changeset 2377:626779aba9bb
The meaning of the directories on the command line is now explained correctly
author | Marco Barisione <marco@barisione.org> |
---|---|
date | Tue, 16 May 2006 22:36:31 +0200 |
parents | 52cfb9864257 |
children | 6e5d40ec862d |
files | purge.py |
diffstat | 1 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/purge.py Tue May 16 22:00:38 2006 +0200 +++ b/purge.py Tue May 16 22:36:31 2006 +0200 @@ -33,15 +33,15 @@ self._act = act self._abort_on_err = abort_on_err - def purge(self, ui, repo, paths=None): + def purge(self, ui, repo, dirs=None): self._repo = repo self._ui = ui self._hg_root = self._split_path(repo.root) - if not paths: - paths = [repo.root] + if not dirs: + dirs = [repo.root] - for path in paths: + for path in dirs: path = os.path.abspath(path) for root, dirs, files in os.walk(path, topdown=False): if '.hg' in self._split_path(root): @@ -129,7 +129,7 @@ return ret -def purge(ui, repo, *paths, **opts): +def purge(ui, repo, *dirs, **opts): '''removes files not tracked by mercurial Delete files not known to mercurial, this is useful to test local and @@ -137,8 +137,8 @@ This means that purge will delete: - Unknown files: files marked with "?" by "hg status" - - Ignored files: files usually ignored by Mercurial because they match a - pattern in a ".hgignore" file + - Ignored files: files usually ignored by Mercurial because they match + a pattern in a ".hgignore" file - Empty directories: infact Mercurial ignores directories unless they contain files under source control managment But it will leave untouched: @@ -146,8 +146,8 @@ - Modified tracked files - New files added to the repository (with "hg add") - If names are given, only files matching the names are considered, else - all files in the repository directory are considered. + If directories are given on the command line, only files in these + directories are considered. Be careful with purge, you could irreversibly delete some files you forgot to add to the repository. If you only want to print the list of @@ -156,7 +156,7 @@ act = not opts['nothing'] abort_on_err = bool(opts['abort_on_err']) p = Purge(act, abort_on_err) - p.purge(ui, repo, paths) + p.purge(ui, repo, dirs) cmdtable = { @@ -164,5 +164,5 @@ [('a', 'abort-on-err', None, _('abort if an error occurs')), ('n', 'nothing', None, _('do nothing on files, useful with --verbose')), ], - _('hg purge [OPTIONS] [NAME]')) + _('hg purge [OPTIONS] [DIR]')) }