I am trying to have keyword expansion work properly for batch files. I am using Vault V4.1.4.18402 (yes, I know that V5.0.2.18753 is available).
Keyword expansion is enabled for the repository. For .VB files, the 'Start of history line' is an single quote '. This works perfectly; adding a file for the first time with the $Log:: $ keyword, and subsequent checkins. For the same repository, the 'Start of history line' is set up as "REM" (without quotes) for .BAT files. The MyTest.bat file also has the $Log:: $ keyword in it. Adding to the repository for the first time, keyword expansion works. Unfortunately, all subsequent checkins cause no keyword expansion. The contents of the MyTest.bat file follows.
Any help is appreciated. Regards,
David
@ECHO OFF
REM David Carr
REM 2010.Jan.25
REM$Log:: $
ECHO Vault Login
SETLOCAL
SET _Server=MyServer
SET _Repository=MyRepository
SET /P _UserName=User name:
SET /P _UserPswd=Password:
REM ECHO %_UserName%
REM ECHO %_UserPswd%
REM EIS Team
ECHO EIS Team
deploy -user %_UserName% -password %_UserPswd% -server %_Server% -repository %_Repository% -xml ETAF_DAC.xml
SET _Server=
SET _Repository=
SET _UserName=
SET _UserPswd=
ENDLOCAL
pause
Keyword expansion only works the first time on .BAT file
Moderator: SourceGear
Keyword expansion only works the first time on .BAT file
David Carr
Senior Systems Analyst
ESSA Technologies Ltd.
Senior Systems Analyst
ESSA Technologies Ltd.
Re: Keyword expansion only works the first time on .BAT file
The first thing I would suggest is to add the .bat extension to the list of mergeable files for the repository. Keyword expansion is basically a merge, and will not work for files considered to be binary or non-mergeable.
This setting is in the Admin Web Client under Source Control Repositories->(Repository name)->File Types.
Let me know if this does not resolve the problem.
This setting is in the Admin Web Client under Source Control Repositories->(Repository name)->File Types.
Let me know if this does not resolve the problem.
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager
Re: Keyword expansion only works the first time on .BAT file
Linda,
Thx so much for your speedy reply and excellent solution - that worked like a charm. Funny how the keyword expansion works when intially adding, but regardless now that I have added a BAT file to the list of mergeable file types, keywords are expanded on every check out/in.
Initially the 'start of history line' was a double colon (i.e. "::"), which denotes a comment line in a Windows batch file. I thought this may have been interfering with the double colon following the $Log keyword. Now that I have used your fix, both 'REM' and '::' work just fine.
Thanks,
David
Thx so much for your speedy reply and excellent solution - that worked like a charm. Funny how the keyword expansion works when intially adding, but regardless now that I have added a BAT file to the list of mergeable file types, keywords are expanded on every check out/in.
Initially the 'start of history line' was a double colon (i.e. "::"), which denotes a comment line in a Windows batch file. I thought this may have been interfering with the double colon following the $Log keyword. Now that I have used your fix, both 'REM' and '::' work just fine.
Thanks,
David
David Carr
Senior Systems Analyst
ESSA Technologies Ltd.
Senior Systems Analyst
ESSA Technologies Ltd.
Re: Keyword expansion only works the first time on .BAT file
Thanks for the update. That's good news. : )
I don't have an answer for why it did that on Add. When I was trying to reproduce your issue, the keyword did not expand until I made the file type Mergeable.Funny how the keyword expansion works when intially adding
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager