changeset 15072:91d2efecb245

merge with stable
author Matt Mackall <mpm@selenic.com>
date Thu, 08 Sep 2011 18:30:44 -0500
parents 650d81a313cb (current diff) ad6eb7d7dbca (diff)
children 89d9f92f6fdd
files hgext/keyword.py mercurial/templates/paper/graph.tmpl
diffstat 4 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Thu Sep 08 10:20:42 2011 +0200
+++ b/hgext/keyword.py	Thu Sep 08 18:30:44 2011 -0500
@@ -275,7 +275,10 @@
                 data, found = _shrinktext(data, re_kw.subn)
             if found:
                 self.ui.note(msg % f)
+                fpath = self.repo.wjoin(f)
+                mode = os.lstat(fpath).st_mode
                 self.repo.wwrite(f, data, ctx.flags(f))
+                os.chmod(fpath, mode)
                 if kwcmd:
                     self.repo.dirstate.normal(f)
                 elif self.record:
--- a/mercurial/templates/paper/graph.tmpl	Thu Sep 08 10:20:42 2011 +0200
+++ b/mercurial/templates/paper/graph.tmpl	Thu Sep 08 18:30:44 2011 -0500
@@ -95,7 +95,7 @@
 	item = item.replace(/_DATE/, cur[5]);
 
 	var tagspan = '';
-	if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) \{
+	if (cur[7].length || cur[8].length || (cur[6][0] != 'default' || cur[6][1])) \{
 		tagspan = '<span class="logtags">';
 		if (cur[6][1]) \{
 			tagspan += '<span class="branchhead" title="' + cur[6][0] + '">';
--- a/tests/test-hgweb-empty.t	Thu Sep 08 10:20:42 2011 +0200
+++ b/tests/test-hgweb-empty.t	Thu Sep 08 18:30:44 2011 -0500
@@ -281,7 +281,7 @@
   	item = item.replace(/_DATE/, cur[5]);
   
   	var tagspan = '';
-  	if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) {
+  	if (cur[7].length || cur[8].length || (cur[6][0] != 'default' || cur[6][1])) {
   		tagspan = '<span class="logtags">';
   		if (cur[6][1]) {
   			tagspan += '<span class="branchhead" title="' + cur[6][0] + '">';
--- a/tests/test-keyword.t	Thu Sep 08 10:20:42 2011 +0200
+++ b/tests/test-keyword.t	Thu Sep 08 18:30:44 2011 -0500
@@ -270,15 +270,20 @@
   xxx $
   ignore $Id$
 
-Check whether expansion is filewise
+Check whether expansion is filewise and file mode is preserved
 
   $ echo '$Id$' > c
   $ echo 'tests for different changenodes' >> c
+  $ chmod 600 c
+  $ ls -l c | cut -b 1-10
+  -rw-------
 
 commit file c
 
   $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
   adding c
+  $ ls -l c | cut -b 1-10
+  -rw-------
 
 force expansion