[PATCH 04 of 13] Make the purge extension use the statwalk walker from the dirstate object

Emanuele Aina faina.mail at tiscali.it
Sun Mar 4 15:49:46 CST 2007


Alexis S. L. Carvalho revisionò:

>>          if not dirs:
>>              dirs = [repo.root]
> 
> You can remove this, and...

Oh, thanks.


> ... you want to remove this loop since you're just calling statwalk with
> the same arguments over and over.
> 
> Then you can either change the purge function to not accept any subdir
> argument, or change things to use util.matcher (something like this:
> 
>     files, match, anypats = util.cmdmatcher(repo.root, names=dirs,
> 			        opts.get('include'), opts.get('exclude'))
>     repo.dirstate.statwalk(files=files, match=match)
> 
> But I'm not sure this will really work with the
> statwalk-returns-directories change...
> )

It should work simply using the 'files' arguments of statwalk(), so I've
updated my patches to do that.


> Use repo.wjoin(f) instead of os.path.join on what statwalk returns.
> They're the same thing right now, but that's cleaner.  This also applies
> to some other patches.

Done, thank you.

Updated patches will follow.

-- 
Buongiorno.
Complimenti per l'ottima scelta.




More information about the Mercurial-devel mailing list