[PATCH] add: only retrieve from dirstate.walk files that were not removed

Matt Mackall mpm at selenic.com
Mon Dec 14 11:49:20 CST 2009


On Mon, 2009-12-14 at 18:11 +0100, Benoit Boissinot wrote:
> On Mon, Dec 14, 2009 at 07:00:43PM +0900, Nicolas Dumazet wrote:
> > # HG changeset patch
> > # User Nicolas Dumazet <nicdumz.commits at gmail.com>
> > # Date 1260498662 -32400
> > # Node ID c13f2fd2afb5fb0c461ded5dbcd00cf9280d6ce9
> > # Parent  fd6729805f44c0686abf0a4d59449284b2ff7dd6
> > add: only retrieve from dirstate.walk files that were not removed
> > 
> > It does not make sense to match removed files in this context.
> > It should suppress a bogus hg add warning when adding a directory over
> > a removed file.
> 
> Sorry for the delay, I just had a look at this patch.
> 
> Isn't the real problem the use of m.exact()?

No. The problem is:

hg mv a b
mkdir a
touch a/a
hg add a  # should succeed

Because 'a' is in state 'removed', it gets returned by walk(), even
though it's not relevant.

>  Or that walk() should
> differentiate files that exists vs. file that existed (removed/missing).

No, compare:

rm a  # spurious unrecorded deletion of a
mkdir a
touch a/a
hg add a  # should complain loudly

walk() should definitely return a here as it is still relevant.

> In that case the keyword should probably be something else than
> "removed".

No, this is really about 'removed' files.

-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial-devel mailing list