# HG changeset patch # User Ryan McElroy # Date 1490104228 25200 # Node ID ddadb6b0b58e908bf46f803edd8df435ed1b579a # Parent b71143b10f74fa4316e6bdfc26a16b2179f2c2ea dirstate: use tryunlink diff -r b71143b10f74 -r ddadb6b0b58e mercurial/dirstate.py --- a/mercurial/dirstate.py Tue Mar 21 06:50:28 2017 -0700 +++ b/mercurial/dirstate.py Tue Mar 21 06:50:28 2017 -0700 @@ -1262,8 +1262,7 @@ backupname = prefix + self._filename + suffix assert backupname != filename - if self._opener.exists(backupname): - self._opener.unlink(backupname) + self._opener.tryunlink(backupname) # hardlink backup is okay because _writedirstate is always called # with an "atomictemp=True" file. util.copyfile(self._opener.join(filename),