Vault NAnt task feature requests

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

Moderator: SourceGear

Post Reply
icnocop
Posts: 46
Joined: Wed Aug 18, 2004 12:41 pm

Vault NAnt task feature requests

Post by icnocop » Mon Jul 30, 2007 11:16 pm

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.
Attachments
NewVaultNAntTasks.zip
SourceGear Vault v2.0.6 NAnt Task Implementations
(13.32 KiB) Downloaded 205 times

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Re: Vault NAnt task feature requests

Post by jeremy_sg » Tue Jul 31, 2007 9:30 am

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?
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: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.
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:3. Can the nant task <vaultlistchangeset> be added, please?
This task is already in the 4.0.2 NAnt tasks.
icnocop wrote:4. Can the nant task <vaultlistworkingfolders> be added, please?
It's already there, but it's called vaultgetworkingfolderassignments.
icnocop wrote:5. Can the nant task <vaultlistshares> be added, please?
I'll have to investigate what your example implementation does to understand what you want this command to do.
icnocop wrote:6. Can the nant task <vaultfindfile> be added, please?
Does vaultlistobjectproperties do what you want it to do?
icnocop wrote:7. Can the nant task <vaultundochangeset> 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:8. Can the nant task <vaultrefreshchangeset> be added, please?
The vaultlistchangeset command should also refresh the change set.

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.

keithr
Posts: 10
Joined: Mon Nov 27, 2006 7:03 pm

"<vaultcheckin>" missing "comment"

Post by keithr » Mon Aug 06, 2007 7:02 pm

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! ;-)

icnocop
Posts: 46
Joined: Wed Aug 18, 2004 12:41 pm

Post by icnocop » Tue Aug 07, 2007 4:50 am

It works for me.

Can you paste more of your code file?

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Tue Aug 07, 2007 7:14 am

This will be fixed in 4.0.5.

keithr
Posts: 10
Joined: Mon Nov 27, 2006 7:03 pm

my code tweak

Post by keithr » Tue Aug 07, 2007 5:42 pm

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?

icnocop
Posts: 46
Joined: Wed Aug 18, 2004 12:41 pm

Post by icnocop » Tue Aug 07, 2007 10:55 pm

i don't have "ServerOperations.client.AutoCommit = true;" in VaultCheckIn.cs and it works for me.

keithr
Posts: 10
Joined: Mon Nov 27, 2006 7:03 pm

i goofed

Post by keithr » Wed Aug 08, 2007 2:46 pm

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.

Post Reply