[PATCH RESEND] keyword: use wvfs.rmtree to remove kwdemo directory

Christian Ebert blacktrash at gmx.net
Sat May 2 20:24:59 CDT 2015


* Matt Mackall on Saturday, May 02, 2015 at 16:48:31 -0500
> On Sat, 2015-05-02 at 08:34 +0100, Christian Ebert wrote:
>> * Pierre-Yves David on Friday, May 01, 2015 at 16:56:28 -0700
>>> On 05/01/2015 04:21 PM, Christian Ebert wrote:
>>>> # HG changeset patch
>>>> # User Christian Ebert <blacktrash at gmx.net>
>>>> # Date 1429364366 -7200
>>>> #      Sat Apr 18 15:39:26 2015 +0200
>>>> # Node ID 7d7445e0ea622532c20a8a8fa5a00e582fe96c38
>>>> # Parent  2ee10789d66b9ca500a7bfb1b3e031e04cdc4fb7
>>>> keyword: use wvfs.rmtree to remove kwdemo directory
>>>> 
>>>> diff --git a/hgext/keyword.py b/hgext/keyword.py
>>>> --- a/hgext/keyword.py
>>>> +++ b/hgext/keyword.py
>>>> @@ -457,9 +457,7 @@ def demo(ui, repo, *args, **opts):
>>>>    repo.commit(text=msg)
>>>>    ui.status(_('\n\tkeywords expanded\n'))
>>>>    ui.write(repo.wread(fn))
>>>> -    for root, dirs, files in os.walk(tmpdir):
>>>> -        for f in files:
>>>> -            util.unlinkpath(repo.vfs.reljoin(root, f))
>>>> +    repo.wvfs.rmtree()
>>> 
>>> rmtree with no argument?
>> 
>> Yes, the entire self repo/tmpdir, like in subrepo.py.
>> 
>> At least that what happens, and it should.
> 
> That's quite a scary API, now that you've drawn it to my attention.
> Makes it a little too easy to accidentally delete repositories. We
> probably shouldn't have a default arg there.. and we might even consider
> not accepting empty strings.

I can pass the temp dir as argument explicitly. That works as
well in this case. You want me to resend again like that?

-- 
Auftreten Tarzan und Martha -
ich hatte Sankt Pauli unterschätzt.

_MICHAEL WEBER: MARTHA_ --->> http://www.blacktrash.org/baustellen/#martha


More information about the Mercurial-devel mailing list