Mercurial > hg
comparison mercurial/util.py @ 49190:4ff4e23de7df
clone: use better names for temp files
Before this commit, the file names are /tmp/tmpn8smvlr8
After this commit, they are more like /tmp/hg-clone-n8smvlr8/00manifest.ndb3qj52v6,
which makes it much clearer what these files correspond to.
Differential Revision: https://phab.mercurial-scm.org/D12623
author | Arseniy Alekseyev <aalekseyev@janestreet.com> |
---|---|
date | Tue, 10 May 2022 20:30:26 +0100 |
parents | 7ccf3dac1a8f |
children | c6a3243567b6 |
comparison
equal
deleted
inserted
replaced
49189:237855525f64 | 49190:4ff4e23de7df |
---|---|
2590 self.discard() | 2590 self.discard() |
2591 else: | 2591 else: |
2592 self.close() | 2592 self.close() |
2593 | 2593 |
2594 | 2594 |
2595 def tryrmdir(f): | |
2596 try: | |
2597 removedirs(f) | |
2598 except OSError as e: | |
2599 if e.errno != errno.ENOENT and e.errno != errno.ENOTEMPTY: | |
2600 raise | |
2601 | |
2602 | |
2595 def unlinkpath(f, ignoremissing=False, rmdir=True): | 2603 def unlinkpath(f, ignoremissing=False, rmdir=True): |
2596 # type: (bytes, bool, bool) -> None | 2604 # type: (bytes, bool, bool) -> None |
2597 """unlink and remove the directory if it is empty""" | 2605 """unlink and remove the directory if it is empty""" |
2598 if ignoremissing: | 2606 if ignoremissing: |
2599 tryunlink(f) | 2607 tryunlink(f) |