Patchwork [V2] keyword: use wvfs.rmtree to remove kwdemo directory

login
register
mail settings
Submitter Christian Ebert
Date May 3, 2015, 11:45 p.m.
Message ID <4ecbd88cde9a0a5019eb.1430696730@1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa>
Download mbox | patch
Permalink /patch/8866/
State Accepted
Commit 4ecbd88cde9a0a5019ebf77d1c1d4398398f4583
Headers show

Comments

Christian Ebert - May 3, 2015, 11:45 p.m.
# HG changeset patch
# User Christian Ebert <blacktrash@gmx.net>
# Date 1429364366 -7200
#      Sat Apr 18 15:39:26 2015 +0200
# Node ID 4ecbd88cde9a0a5019ebf77d1c1d4398398f4583
# Parent  e9edd53770fb77a9787a3e6592a3bf0a29c1bd80
keyword: use wvfs.rmtree to remove kwdemo directory

Pass repo.root explicitly as argument to indicate that removal of the temporary
repo is intentional in this case.
Matt Mackall - May 4, 2015, 4:59 p.m.
On Mon, 2015-05-04 at 00:45 +0100, Christian Ebert wrote:
> # HG changeset patch
> # User Christian Ebert <blacktrash@gmx.net>
> # Date 1429364366 -7200
> #      Sat Apr 18 15:39:26 2015 +0200
> # Node ID 4ecbd88cde9a0a5019ebf77d1c1d4398398f4583
> # Parent  e9edd53770fb77a9787a3e6592a3bf0a29c1bd80
> keyword: use wvfs.rmtree to remove kwdemo directory

Queued for default, thanks.

Patch

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(repo.root)
 
 @command('kwexpand',
     commands.walkopts,