Subversion : How to add svn:keywords in all xcode Source files?

Up vote 4 down vote favorite share g+ share fb share tw.

Like Node Kind: directory Schedule: normal Last Changed Author: karthikeyan Last Changed Rev: 9 Last Changed Date: 2011-06-21 23:55:20 +0530 (Tue, 21 Jun 2011) #import "TestController. H" @implementation TestController xcode svn xcode3.2 link|improve this question edited Jun 30 '11 at 14:05 asked Jun 27 '11 at 16:26Karthikeyan1,221312 82% accept rate.

Retagged. This question doesn't have anything to do with the iPhone SDK. – Pelle ten Cate Jun 28 '11 at 14:29.

Shell-fu to the rescue... I don't know what 'Node Kind' and 'Schedule' are, but do the following: Put the following in a shell script, call it insert_header. Sh for argument's sake: #! /bin/bash FILE=$1 sed '1s:^:\ : 1i\ Node Kind: directory 1i\ Schedule: normal 1i\ Last Changed Author: $Author$ 1i\ Last Changed Rev: $Rev$ 1i\ Last Changed Date: $LastChangedDate$ ' $FILE > $FILE.

Somerandombackupextension mv $FILE. Somerandombackupextension $FILE Open a Terminal session. Make the file executable with chmod +x insert_header.

Sh and put it in your PATH, or run it with its relative path (see below). Then, run the following command in your source checkout directory (e.g. If you want to change files with extension . Cpp): find .

-name \*. Cpp -exec insert_header. Sh {} \; -exec svn propset svn:keywords "Author Rev LastChangedDate" {} \; Run svn status, and expect to see all the changed files with the following 'MM' status code: MM path/to/file1.

Cpp MM path/to/file2. Cpp If you don't like the changes, revert with svn revert -R . , otherwise svn commit -m "+1 for opyate ;-)" PS I tried it with a dummy project, and it ended up looking like this, which is normal: Node Kind: directory Schedule: normal Last Changed Author: $Author: opyate $ Last Changed Rev: $Rev: 2 $ Last Changed Date: $LastChangedDate: 2011-06-30 23:20:33 +0100 (Thu, 30 Jun 2011) $ ...the rest of my file.

SVN Keywords should do exactly what you want.

Thanks Ryan , exactly is that possible to add in all my xcode files – Karthikeyan Jun 27 '11 at 17:36 You could write an Applescript to add that to all your existing source files. I haven't found a reliable way to change the template for new files in XCode 4 yet. – RyanR Jun 27 '11 at 18:13.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions