Show More
@@ -73,10 +73,14 b' def purge(ui, repo, *dirs, **opts):' | |||
|
73 | 73 | ui.write('%s%s' % (name, eol)) |
|
74 | 74 | |
|
75 | 75 | def removefile(path): |
|
76 | try: | |
|
77 | os.remove(path) | |
|
78 | except OSError: | |
|
76 | 79 | # read-only files cannot be unlinked under Windows |
|
77 | 80 | s = os.stat(path) |
|
78 |
if (s.st_de |
|
|
79 | os.chmod(path, s.st_mode | stat.S_IWRITE) | |
|
81 | if (s.st_mode & stat.S_IWRITE) != 0: | |
|
82 | raise | |
|
83 | os.chmod(path, stat.S_IMODE(s.st_mode) | stat.S_IWRITE) | |
|
80 | 84 | os.remove(path) |
|
81 | 85 | |
|
82 | 86 | directories = [] |
General Comments 0
You need to be logged in to leave comments.
Login now