API DoWorkingFileDiff

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

Moderator: SourceGear

Post Reply
donprice
Posts: 5
Joined: Wed Aug 11, 2004 2:55 am

API DoWorkingFileDiff

Post by donprice » Thu Aug 26, 2004 3:05 am

Hi,

I can't seem to figure out DoWorkingFileDiff; I want to diff a repository item to file in the path of the working directory.
rep item $/Data Dictionary/Tables/SalesTable
local file c:\\temp\\play\\Data Dictionary\\Tables\\SalesTable
workdir set to c:\\temp\\play

nDoDiffError = myClient.DoWorkingFileDiff(vcfile, datDiffChoice, strRight, strDiffBin, strFullDiffArgs, strLeftLbl, strRightLbl, out strLItem, out strRItem, out e);

Basically copied from the cl source.
vcfile is a valid vault file from the rep item
datDiffChoice, Local Item enum, I've tried them all
strRight = local file
strDiffBin = "diff" , tried sgdiff as well
strFullDiffArgs = "%LEFT_PATH% %RIGHT_PATH%"
strLeftLabel = "rep"
strRightLabel = "file"

With those I get either the item wasn't found or the diff utility had an error. what am I doing wrong?

Vault 2.0.4 (2190)
I'm using VS2002 Build Dlls.

Thanks, Don

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Thu Aug 26, 2004 10:15 am

If what you want is to diff the working file against the latest version in the repository then, you would want something like:

DoWorkingFileDiff(
vcfile,
DiffAgainstType.CurrentRepositoryVersion,
"",
"C:\\Program Files\\SourceGear\\Vault Client\\sgdm.exe",
"[Copy the args from Tools->Options->Diff/Merge in GUI client]",
"Repository version ({0})",
"Working version ({0})",
null,
null,
e);

I'm not sure from the error message whether the problem is the diff tool is being specified incorrectly, or whether the diff item is incorrect. Note that you don't have to specify the local file, because it already knows the working file is what you want to compare against, and it automatically pulls the current repository version from the server. However, specifying a local file in CurrentRepositoryVersion mode should just be ignored.

Hope this helps,

donprice
Posts: 5
Joined: Wed Aug 11, 2004 2:55 am

Post by donprice » Thu Aug 26, 2004 10:40 am

:D Bingo!

Thanks Dan!

Post Reply