Vault NAnt task feature requests
Moderator: SourceGear
Vault NAnt task feature requests
Hello.
We are using SourceGear Vault v4.0.2 and NAnt to automate our builds.
I have some questions:
1. Can I use <vaultcheckin> without using <vaultcheckout>?
Or
a. Would I have to create a custom task <vaultcommit> that will commit a set of files without requiring a checkout (ie. CVS style)?
b. Can the "RequireCheckOutBeforeCheckIn" property some how be exposed as a task attribute?
2. How can I add a comment to items in <vaultcheckin>? The "Require check in comments" is set as a server option for the repository.
3. Can the nant task <vaultlistchangeset> be added, please?
4. Can the nant task <vaultlistworkingfolders> be added, please?
5. Can the nant task <vaultlistshares> be added, please?
6. Can the nant task <vaultfindfile> be added, please?
7. Can the nant task <vaultundochangeset> be added, please?
8. Can the nant task <vaultrefreshchangeset> be added, please?
I have attached a zip file containing several cs files that contain the implementation used for these nant tasks for SourceGear Vault v2.0.6 so that it might be easier for someone to use as a basis to understand the expectations and upgrade them to support v4.0.2.
Thank you.
We are using SourceGear Vault v4.0.2 and NAnt to automate our builds.
I have some questions:
1. Can I use <vaultcheckin> without using <vaultcheckout>?
Or
a. Would I have to create a custom task <vaultcommit> that will commit a set of files without requiring a checkout (ie. CVS style)?
b. Can the "RequireCheckOutBeforeCheckIn" property some how be exposed as a task attribute?
2. How can I add a comment to items in <vaultcheckin>? The "Require check in comments" is set as a server option for the repository.
3. Can the nant task <vaultlistchangeset> be added, please?
4. Can the nant task <vaultlistworkingfolders> be added, please?
5. Can the nant task <vaultlistshares> be added, please?
6. Can the nant task <vaultfindfile> be added, please?
7. Can the nant task <vaultundochangeset> be added, please?
8. Can the nant task <vaultrefreshchangeset> be added, please?
I have attached a zip file containing several cs files that contain the implementation used for these nant tasks for SourceGear Vault v2.0.6 so that it might be easier for someone to use as a basis to understand the expectations and upgrade them to support v4.0.2.
Thank you.
- Attachments
-
- NewVaultNAntTasks.zip
- SourceGear Vault v2.0.6 NAnt Task Implementations
- (13.32 KiB) Downloaded 214 times
Re: Vault NAnt task feature requests
Yes you can, if your user's RequireCheckOutBeforeCheckIn option is set to false, you should be able to checkin files without checking them out.icnocop wrote: 1. Can I use <vaultcheckin> without using <vaultcheckout>?
Or
a. Would I have to create a custom task <vaultcommit> that will commit a set of files without requiring a checkout (ie. CVS style)?
b. Can the "RequireCheckOutBeforeCheckIn" property some how be exposed as a task attribute?
You're right. This is a glaring omission in our NAnt tasks. We'll get that included, but the fix will not be ready in time for the 4.0.3 release.icnocop wrote:2. How can I add a comment to items in <vaultcheckin>? The "Require check in comments" is set as a server option for the repository.
This task is already in the 4.0.2 NAnt tasks.icnocop wrote:3. Can the nant task <vaultlistchangeset> be added, please?
It's already there, but it's called vaultgetworkingfolderassignments.icnocop wrote:4. Can the nant task <vaultlistworkingfolders> be added, please?
I'll have to investigate what your example implementation does to understand what you want this command to do.icnocop wrote:5. Can the nant task <vaultlistshares> be added, please?
Does vaultlistobjectproperties do what you want it to do?icnocop wrote:6. Can the nant task <vaultfindfile> be added, please?
This one could be done, but since the CLC version of this command takes an index, I didn't think it would be useful to have a NAnt task which takes an index, since NAnt is meant to run unattended.icnocop wrote:7. Can the nant task <vaultundochangeset> be added, please?
The vaultlistchangeset command should also refresh the change set.icnocop wrote:8. Can the nant task <vaultrefreshchangeset> be added, please?
Another thing to note is that we include the source for all the NAnt tasks in the NAnt zip file we distribute, as well as documentation. You're welcome to modify them to fit your needs or add your own tasks.
"<vaultcheckin>" missing "comment"
The lack of support for a "comment" by the "<vaultcheckin>" task has my upgrade of existing NAnt tasks to support Vault 4.x completely blocked.
Even when I duplicate the logic of "<vaultadd>" of calling "ServerOperations.client.Comment = "keith's test comment";" via modifying the source code, the comment is not passed and still results in the same "A checkin comment is required." error.
Having to do manual builds stinks! So please address this, yesterday!
Even when I duplicate the logic of "<vaultadd>" of calling "ServerOperations.client.Comment = "keith's test comment";" via modifying the source code, the comment is not passed and still results in the same "A checkin comment is required." error.
Having to do manual builds stinks! So please address this, yesterday!
my code tweak
I changed this, from the 4.0.3 source:
protected override void ExecuteTask()
{
ServerOperations.GetInstance().UserMessage += new ServerOperations.UserMessageEventHandler(WriteUserMessage);
ServerOperations.client.Verbose = true;
CheckLoggedIn();
CheckRepository();
string[] pathsobjectPaths = new string[objectPaths.Count];
int iobjectPaths = 0;
foreach( string fileName in objectPaths.Paths )
{
pathsobjectPaths[iobjectPaths++] = fileName;
}
ServerOperations.ProcessCommandCheckIn(pathsobjectPaths, (UnchangedHandler)Enum.Parse(typeof(UnchangedHandler), unchanged, true), keepCheckedOut, (LocalCopyType)Enum.Parse(typeof(LocalCopyType), localCopy, true));
ServerOperations.GetInstance().UserMessage -= new ServerOperations.UserMessageEventHandler(WriteUserMessage);
}
TO this, thus duping the code in VaultAdd:
protected override void ExecuteTask()
{
ServerOperations.GetInstance().UserMessage += new ServerOperations.UserMessageEventHandler(WriteUserMessage);
ServerOperations.client.Verbose = true;
CheckLoggedIn();
CheckRepository();
ServerOperations.client.Comment = "keith's test comment";
ServerOperations.client.AutoCommit = true;
string[] pathsobjectPaths = new string[objectPaths.Count];
int iobjectPaths = 0;
foreach( string fileName in objectPaths.Paths )
{
pathsobjectPaths[iobjectPaths++] = fileName;
}
ServerOperations.ProcessCommandCheckIn(pathsobjectPaths, (UnchangedHandler)Enum.Parse(typeof(UnchangedHandler), unchanged, true), keepCheckedOut, (LocalCopyType)Enum.Parse(typeof(LocalCopyType), localCopy, true));
ServerOperations.GetInstance().UserMessage -= new ServerOperations.UserMessageEventHandler(WriteUserMessage);
}
.
Btw, when do you expect 4.0.5 to come out?
protected override void ExecuteTask()
{
ServerOperations.GetInstance().UserMessage += new ServerOperations.UserMessageEventHandler(WriteUserMessage);
ServerOperations.client.Verbose = true;
CheckLoggedIn();
CheckRepository();
string[] pathsobjectPaths = new string[objectPaths.Count];
int iobjectPaths = 0;
foreach( string fileName in objectPaths.Paths )
{
pathsobjectPaths[iobjectPaths++] = fileName;
}
ServerOperations.ProcessCommandCheckIn(pathsobjectPaths, (UnchangedHandler)Enum.Parse(typeof(UnchangedHandler), unchanged, true), keepCheckedOut, (LocalCopyType)Enum.Parse(typeof(LocalCopyType), localCopy, true));
ServerOperations.GetInstance().UserMessage -= new ServerOperations.UserMessageEventHandler(WriteUserMessage);
}
TO this, thus duping the code in VaultAdd:
protected override void ExecuteTask()
{
ServerOperations.GetInstance().UserMessage += new ServerOperations.UserMessageEventHandler(WriteUserMessage);
ServerOperations.client.Verbose = true;
CheckLoggedIn();
CheckRepository();
ServerOperations.client.Comment = "keith's test comment";
ServerOperations.client.AutoCommit = true;
string[] pathsobjectPaths = new string[objectPaths.Count];
int iobjectPaths = 0;
foreach( string fileName in objectPaths.Paths )
{
pathsobjectPaths[iobjectPaths++] = fileName;
}
ServerOperations.ProcessCommandCheckIn(pathsobjectPaths, (UnchangedHandler)Enum.Parse(typeof(UnchangedHandler), unchanged, true), keepCheckedOut, (LocalCopyType)Enum.Parse(typeof(LocalCopyType), localCopy, true));
ServerOperations.GetInstance().UserMessage -= new ServerOperations.UserMessageEventHandler(WriteUserMessage);
}
.
Btw, when do you expect 4.0.5 to come out?
i goofed
ahh, it sure does, as it turns out i had the original "copy of Nant.VaultTasks.dll" in the same folder that was naturally being used instead since it shows up first.
too bad nant doesn't alert and error out on having duplicate assemblies like asp.net, which i suppose has spoiled me on having to remember that the name of the file means nothing.
i also added the comment to the VaultLabel tag as well.
too bad nant doesn't alert and error out on having duplicate assemblies like asp.net, which i suppose has spoiled me on having to remember that the name of the file means nothing.
i also added the comment to the VaultLabel tag as well.