Mercurial > public > mercurial-scm > hg
comparison mercurial/vfs.py @ 39464:3dd34b401bc2
merge: use vfs methods for I/O
All I/O is supposed to be performed via vfs instances so filesystems
can be abstracted. The previous commit ported the old code in purge,
which didn't go through the vfs layer. This commit ports the purge
code to use the vfs layer.
The vfs layer didn't have a method to remove a single directory, so
it was added as part of implementing this.
Differential Revision: https://phab.mercurial-scm.org/D4478
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 04 Sep 2018 15:55:23 -0700 |
parents | da2a7d8354b2 |
children | 5fe0b880200e |
comparison
equal
deleted
inserted
replaced
39463:7fea205fd5dc | 39464:3dd34b401bc2 |
---|---|
210 | 210 |
211 def removedirs(self, path=None): | 211 def removedirs(self, path=None): |
212 """Remove a leaf directory and all empty intermediate ones | 212 """Remove a leaf directory and all empty intermediate ones |
213 """ | 213 """ |
214 return util.removedirs(self.join(path)) | 214 return util.removedirs(self.join(path)) |
215 | |
216 def rmdir(self, path=None): | |
217 """Remove an empty directory.""" | |
218 return os.rmdir(self.join(path)) | |
215 | 219 |
216 def rmtree(self, path=None, ignore_errors=False, forcibly=False): | 220 def rmtree(self, path=None, ignore_errors=False, forcibly=False): |
217 """Remove a directory tree recursively | 221 """Remove a directory tree recursively |
218 | 222 |
219 If ``forcibly``, this tries to remove READ-ONLY files, too. | 223 If ``forcibly``, this tries to remove READ-ONLY files, too. |