changeset 23722:5803bfeebbfe

keyword: use vfs.reljoin and util.unlinkpath to remove kwdemo
author Christian Ebert <blacktrash@gmx.net>
date Sat, 03 Jan 2015 11:11:46 +0000
parents 8ec03e0ef51a
children fd62b3e750af
files hgext/keyword.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Mon Dec 29 18:35:23 2014 -0800
+++ b/hgext/keyword.py	Sat Jan 03 11:11:46 2015 +0000
@@ -457,12 +457,9 @@
     repo.commit(text=msg)
     ui.status(_('\n\tkeywords expanded\n'))
     ui.write(repo.wread(fn))
-    for root, dirs, files in os.walk(tmpdir, topdown=False):
+    for root, dirs, files in os.walk(tmpdir):
         for f in files:
-            util.unlink(os.path.join(root, f))
-        for d in dirs:
-            os.rmdir(os.path.join(root, d))
-    os.rmdir(tmpdir)
+            util.unlinkpath(repo.vfs.reljoin(root, f))
 
 @command('kwexpand',
     commands.walkopts,