[PATCH] Warn in case user tries to add files which would otherwise be ignored

Alexis S. L. Carvalho alexis at cecm.usp.br
Fri Feb 22 15:16:14 CST 2008


Thus spake Jesse Glick:
> # 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.
> 
> While sometimes you really meant to do this, often you did not. For
> example, if '/build$' is ignored and you have
> 
> module/
> module/src/
> [...]
> module/build/
> module/build/generated-file
> 
> and you run 'hg add module' then all is good. But if a novice user
> runs 'hg add module/*' then generated-file is added with no warning!

FWIW this shouldn't happen anymore after b41f0d6a74fc.  (But "hg add
module/build/*" will still add things).

Instead of changing the addremove and add commands, it's probably better
to change the add method in localrepo.py.

And we would probably want to rename dirstate._dirignore to
dirstate.ignore (but not in the same revision), since it won't really be
private anymore...

Alexis


More information about the Mercurial-devel mailing list