keyword: use vfs.reljoin and util.unlinkpath to remove kwdemo
authorChristian Ebert <blacktrash@gmx.net>
Sat, 03 Jan 2015 11:11:46 +0000
changeset 23722 5803bfeebbfe
parent 23720 8ec03e0ef51a
child 23723 fd62b3e750af
keyword: use vfs.reljoin and util.unlinkpath to remove kwdemo
hgext/keyword.py
--- 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,