diff -r 4333b9744419 -r 012f1244cd4c mercurial/windows.py --- a/mercurial/windows.py Wed Oct 07 22:50:20 2009 +0200 +++ b/mercurial/windows.py Fri Oct 09 00:29:39 2009 +0200 @@ -267,7 +267,7 @@ head, tail = os.path.split(head) while head and tail: try: - if osutil.listdir(name): + if osutil.listdir(head): return os.rmdir(head) except: