##// END OF EJS Templates
keyword: preserve file mode when overwriting
Christian Ebert -
r15070:e4c65158 stable
parent child Browse files
Show More
@@ -270,7 +270,10 b' class kwtemplater(object):'
270 data, found = _shrinktext(data, re_kw.subn)
270 data, found = _shrinktext(data, re_kw.subn)
271 if found:
271 if found:
272 self.ui.note(msg % f)
272 self.ui.note(msg % f)
273 fpath = self.repo.wjoin(f)
274 mode = os.lstat(fpath).st_mode
273 self.repo.wwrite(f, data, ctx.flags(f))
275 self.repo.wwrite(f, data, ctx.flags(f))
276 os.chmod(fpath, mode)
274 if kwcmd:
277 if kwcmd:
275 self.repo.dirstate.normal(f)
278 self.repo.dirstate.normal(f)
276 elif self.record:
279 elif self.record:
@@ -270,15 +270,20 b' Update and expand'
270 xxx $
270 xxx $
271 ignore $Id$
271 ignore $Id$
272
272
273 Check whether expansion is filewise
273 Check whether expansion is filewise and file mode is preserved
274
274
275 $ echo '$Id$' > c
275 $ echo '$Id$' > c
276 $ echo 'tests for different changenodes' >> c
276 $ echo 'tests for different changenodes' >> c
277 $ chmod 600 c
278 $ ls -l c | cut -b 1-10
279 -rw-------
277
280
278 commit file c
281 commit file c
279
282
280 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
283 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
281 adding c
284 adding c
285 $ ls -l c | cut -b 1-10
286 -rw-------
282
287
283 force expansion
288 force expansion
284
289
General Comments 0
You need to be logged in to leave comments. Login now