Hello.
I need write script that will get fresh version from repository, build solution, set new project versions (only AssemblyInfo.cs files will be updated), commit changes to repository and label repository main folder as some version.
Could you help me please with committing changed files back to repository?
The problem is that on this machine people are working so working folder in Vault GUI client is set to folder that differs from script working folder.
e.g. developer set his working folder to c:\project and script need to operate with c:\test fodler.
I know how to get files to specific folder:
vault.exe get -destpath c:\test -makewritable $/project_root
Change all AssemblyInfo.cs files is not a problem too.
Help me please - how could I commit chaged files from c:\test to $/project_root from command line or Vault client API?
I look on commit vault client syntax and fall into confusion it seems that commit command does not accept -destpath option.
I've thought that I can change working folder from c:\project to c:\test and back but vault client doesn't support GETWORKINGFOLDER command, only SET and UNSETWORKINGFOLDER
Is it possible to add files with Vault client API to pending chage set from folder that differs from working folder?
I'm using 3.5.1.4786 Vault version.
Thank you.
Get, update, commit past working folder
Moderator: SourceGear
ok, it is possible to switch working folder using Vault client API
instead of GET you could execute ci.AddLabel or ci.Commit to make commit from directory that differs from current working folder.
Code: Select all
string oldWF = ci.TreeCache.GetWorkingFolder(repository);
ci.TreeCache.SetWorkingFolder(repository, local); // new working folder
ci.Refresh();
VaultClientTreeObject vctreeobj;
vctreeobj = ci.TreeCache.Repository.Root.FindTreeObjectRecursive(repository);
if (vctreeobj == null)
throw new ApplicationException(string.Format("repository path {0} not found", repository));
ci.Get((VaultClientFolder)vctreeobj, true, true, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.CheckIn, MergeType.OverwriteWorkingCopy, null);
ci.TreeCache.SetWorkingFolder(repository, oldWF); //restoring old repository working folder back
it is something wrong with such solution
when working folder is changed programmatically it seems that Vault doesn't refresh changeset completely.
Would you be so kind to tell me how could I refresh changeset?
when working folder is changed programmatically it seems that Vault doesn't refresh changeset completely.
Would you be so kind to tell me how could I refresh changeset?
Code: Select all
string oldWF = ci.TreeCache.GetWorkingFolder(repository);
ci.TreeCache.SetWorkingFolder(repository, local);
ci.Refresh();
ci.TreeCache.ChangeSetComment = "commit from BuildL";
// not all chages are visible here :(
ci.TreeCache.SetWorkingFolder(repository, oldWF);
To refresh the changeset, you will want to call:
Code: Select all
ci.UpdateKnownChanges_All(true)