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