Ryan McElroy <rmcelroy@fb.com> [Tue, 21 Mar 2017 06:50:28 -0700] rev 31549
shelve: use tryunlink
Ryan McElroy <rmcelroy@fb.com> [Tue, 21 Mar 2017 06:50:28 -0700] rev 31548
vfs: add tryunlink method
Thoughout hg code, we see a pattern of attempting to remove a file and then
catching and ignoring any errors due to a missing file in the calling code.
Let's unify this pattern in a single implementation in the vfs layer.
Ryan McElroy <rmcelroy@fb.com> [Tue, 21 Mar 2017 06:50:28 -0700] rev 31547
util: use tryunlink in unlinkpath
We just introduced a func to attempt a file removal. Start using it.
Ryan McElroy <rmcelroy@fb.com> [Tue, 21 Mar 2017 06:50:28 -0700] rev 31546
util: add tryunlink function
Throughout mercurial cdoe, there is a common pattern of attempting to remove
a file and ignoring ENOENT errors. Let's move this into a common function to
allow for cleaner code.
Ryan McElroy <rmcelroy@fb.com> [Tue, 21 Mar 2017 06:50:28 -0700] rev 31545
util: unify unlinkpath
Previously, there were two slightly different versions of unlinkpath between
windows and posix, but these differences were eliminated in previous patches.
Now we can unify these two code paths inside of the util module.
Ryan McElroy <rmcelroy@fb.com> [Tue, 21 Mar 2017 06:50:28 -0700] rev 31544
posix: use local reference to removedirs
We have a local reference to os.removedirs in module scope, but we still used
os.removedirs inside functions. This changes util to use the local reference,
which will pave the way for combining duplicated code in future patches.