Keyword expansion only works the first time on .BAT file

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
DavidCarr
Posts: 17
Joined: Sat Oct 28, 2006 2:19 pm
Location: Vancouver, BC, Canada
Contact:

Keyword expansion only works the first time on .BAT file

Post by DavidCarr » Mon Jan 25, 2010 3:19 pm

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
David Carr
Senior Systems Analyst
ESSA Technologies Ltd.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Keyword expansion only works the first time on .BAT file

Post by lbauer » Mon Jan 25, 2010 4:37 pm

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.
Linda Bauer
SourceGear
Technical Support Manager

DavidCarr
Posts: 17
Joined: Sat Oct 28, 2006 2:19 pm
Location: Vancouver, BC, Canada
Contact:

Re: Keyword expansion only works the first time on .BAT file

Post by DavidCarr » Mon Jan 25, 2010 6:37 pm

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
David Carr
Senior Systems Analyst
ESSA Technologies Ltd.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Keyword expansion only works the first time on .BAT file

Post by lbauer » Tue Jan 26, 2010 10:38 am

Thanks for the update. That's good news. : )
Funny how the keyword expansion works when intially adding
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.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply