[PATCH] Warn in case user tries to add files which would otherwise be ignored
Thomas Arendsen Hein
thomas at intevation.de
Fri Feb 22 14:38:36 CST 2008
* Jesse Glick <Jesse.Glick at sun.com> [20080222 18:25]:
> # HG changeset patch
> # User Jesse Glick <jesse.glick at sun.com>
> # Date 1203700484 18000
> # Node ID a15692d29c9f3216b629b7d67e8bcc842ff88c40
> # Parent 554715e584e6d9a4275fffd9065d9330511eafc4
> Warn in case user tries to add files which would otherwise be ignored.
I like the idea, but the patch is a bit too verbose:
> -def addremove(repo, pats=[], opts={}, dry_run=None, similarity=None):
> +def addremove(repo, pats=[], opts={}, dry_run=None, similarity=None,
> + fromcommit=False):
The fromcommit isn't needed, because ...
> - repo.ui.status(_('adding %s\n') % ((pats and rel) or abs))
> + repo.ui.status(_('adding %s\n') % name)
> + if repo.dirstate._dirignore(abs):
> + repo.ui.warn(_('warning: adding ignorable file %s\n') % name)
> + if fromcommit:
> + repo.ui.warn(_("(use 'hg remove %s' to delete the file)\n")
> + % name)
> + else:
> + repo.ui.warn(_("(use 'hg revert %s' to unadd the file)\n")
> + % name)
... this is too much output.
I'd say just say something like 'adding (ignored) %s' (unless -q)
instead of the usual 'adding %s' (only shown with -v).
Or maybe a final message/warning "%d ignored files have been added"?
Thomas
--
thomas at intevation.de - http://intevation.de/~thomas/ - OpenPGP key: 0x5816791A
Intevation GmbH, Osnabrueck - Register: Amtsgericht Osnabrueck, HR B 18998
Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
More information about the Mercurial-devel
mailing list