##// END OF EJS Templates
shrink-revlog: preserve mode of the shrunken index and data file....
Greg Ward -
r11267:d3ebb1a0 stable
parent child Browse files
Show More
@@ -202,9 +202,14 b' def shrink(ui, repo, **opts):'
202 # copy files
202 # copy files
203 util.os_link(indexfn, oldindexfn)
203 util.os_link(indexfn, oldindexfn)
204 ignoremissing(util.os_link)(datafn, olddatafn)
204 ignoremissing(util.os_link)(datafn, olddatafn)
205
206 # mkstemp() creates files only readable by the owner
207 os.chmod(tmpindexfn, os.stat(indexfn).st_mode)
208
205 # rename
209 # rename
206 util.rename(tmpindexfn, indexfn)
210 util.rename(tmpindexfn, indexfn)
207 try:
211 try:
212 os.chmod(tmpdatafn, os.stat(datafn).st_mode)
208 util.rename(tmpdatafn, datafn)
213 util.rename(tmpdatafn, datafn)
209 except OSError, inst:
214 except OSError, inst:
210 if inst.errno != errno.ENOENT:
215 if inst.errno != errno.ENOENT:
General Comments 0
You need to be logged in to leave comments. Login now