I'd like to put it at the end of each file. I couldn't find any Keyword
which
might work out for me.
Thanks,
Chris
VSS has nothing that will do this automatically for you, but you could
do this from a command prompt with a few simple steps. (If you have
binary files in your database, or other files where you do not want to
add the copyright statement, then this technique would not work as is.
You'd have to modify this technique or use some other technique to
avoid changing such files.)
1) If your database is very large, you may want to sign on to the VSS
file server for better performance.
2) Set the ssdir, ssuser, and sspwd environment variables to the VSS
directory, user and password as desired.
3) Create and switch to a work directory (not necessarily your regular
VSS working folder).
4) Put the copyright statement in a text file somewhere (e.g.,
c:\temp\copyright.txt). You may want to start the file out with a
newline character, just in case you have any source files that do not
end in a carriage return. (Otherwise, the copyright statement will get
tacked on to the end of the last line in the source file.)
5) Check out the entire VSS project tree:
ss checkout $/ -r
5) Append the copyright statement to all checked out files:
for /r %i in (*) do copy "%i"+c:\temp\copyright.txt "%i"
6) Check in all of the files:
ss checkin $/ -r "-cAdd stupid copyright statement"
As an added safety measure, you may want to make a backup of your
database before doing this in case you don't like the result.
Alternatively, you could label the root project ($/) before doing the
checkin command. This will make it easier to rollback your changes if
need be.
While the rollback command does not have a recursive option, you can at
least use it to specify all files in a given project. Therefore, you'd
have to walk through each project in your database yourself. Here's an
example:
ss rollback $/proj1/* -vlbeforechange -i-y
You can also delete the label later if you wish, whether or not you
plan to keep your changes permanent.
Another thing you might want to do is to redirect stdout and stderr to
a file, so you can get a trace of what you have done. Then you can go
back and make sure everything ran as you had expected. That is, tack
something like this at the end of each command:
>>c:\temp\logfile.txt 2>&1
Sent via Deja.com http://www.deja.com/
Before you buy.
Checkout this article. It explains the notion of 'comment templates', which
might help you out.
http://support.microsoft.com/support/kb/articles/q154/0/81.asp
"Chris Griffin" <cgri...@nowhere.com> wrote in message
news:8tn49j$8ii$1...@tribune.oar.net...
In article <#a8pcKQS...@cppssbbsa02.microsoft.com>,
"Weston Morris" <weston.mor...@unisys.com> wrote:
> Hi Chris,
>
> Checkout this article. It explains the notion of 'comment templates',
which
> might help you out.
>
> http://support.microsoft.com/support/kb/articles/q154/0/81.asp
Yes, using either the History or Log keywords in VSS's keyword
expansion. Look up "keywords" in VSS help for more information.
However, I don't believe this will help the original poster much. For
one thing, you need to physically add the History or Log keywords to
each file yourself, so if the original poster was going to do that, he
might as well add the copyright statement at that time also.
Furthermore, I wouldn't think he'd want the copyright statement to be
added for every single checkin, which will happen if it is added to the
comment template.