Nant task - Checkin, get new folder version back?

If you are having a problem using Vault, post a message here.
Post Reply
ajj3085
Posts: 228
Joined: Thu Feb 16, 2006 11:39 am

Nant task - Checkin, get new folder version back?

Post by ajj3085 » Sat Jan 22, 2011 8:24 pm

Hi,

I'm checking in some files at the end of a successful build. I'd like to label that so that I can grab that version more easily if I want to deploy it. I can label right after the checkin, but it's possible that another checkin happens between the scripts checkin and label.

Is it possible to get the new folder version which was incremented due to the checkin? Also, is there any way to label a specific folder version? I know it can be done in the gui client, but doesn't seem possible with the nant tasks.

Thanks
Andy

ps - are all posting here going through moderation? I don't recall that happening until the past few weeks.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Nant task - Checkin, get new folder version back?

Post by jclausius » Mon Jan 24, 2011 10:07 am

Andy,

What if you used the vaulthistory task, with a row limit of 1 on the folder? Assuming you know no one committed a change set between the build's GET but before committing your changes from the build, you could apply the label to that version of the folder. The key is knowing the folder version of the GET, and the folder version after committing your change set. If the folder's version changed, then someone committed a change set between the two. Not sure what you would do in that case.

What if you committed, got the version of the folder right after the commit, and then labeled that version? That way you know w/ out a doubt every line of code that goes into any kind of build.
Jeff Clausius
SourceGear

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

Re: Nant task - Checkin, get new folder version back?

Post by lbauer » Mon Jan 24, 2011 10:20 am

ps - are all posting here going through moderation? I don't recall that happening until the past few weeks.
New forum users always go through moderation, but we've noticed that some long time users are being flagged for moderation, too. We're not sure why, but we're investigating.
Linda Bauer
SourceGear
Technical Support Manager

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

Re: Nant task - Checkin, get new folder version back?

Post by lbauer » Tue Jan 25, 2011 8:42 am

Andy -- regarding your posts which have been flagged for moderation:

Have you tried logging out of the forum and then logging in again? I wonder if that would help.
Linda Bauer
SourceGear
Technical Support Manager

ajj3085
Posts: 228
Joined: Thu Feb 16, 2006 11:39 am

Re: Nant task - Checkin, get new folder version back?

Post by ajj3085 » Mon Jan 31, 2011 8:53 pm

[quote="jclausius"]What if you used the vaulthistory task, with a row limit of 1 on the folder? Assuming you know no one committed a change set between the build's GET but before committing your changes from the build, you could apply the label to that version of the folder. The key is knowing the folder version of the GET, and the folder version after committing your change set. If the folder's version changed, then someone committed a change set between the two. Not sure what you would do in that case.

What if you committed, got the version of the folder right after the commit, and then labeled that version? That way you know w/ out a doubt every line of code that goes into any kind of build.[/quote]

Jeff,

Thanks for the suggestions. I had thought about the latter option, but I had thought there's still a possiblity that a commit occures between the build's commit and it's label. That may or may not be likely depending on how Vault handles two commits at once (that is, the build begins it's commit, and while that's working another commit begins and completes before the first ends).

ajj3085
Posts: 228
Joined: Thu Feb 16, 2006 11:39 am

Re: Nant task - Checkin, get new folder version back?

Post by ajj3085 » Mon Jan 31, 2011 8:57 pm

[quote="lbauer"]Andy -- regarding your posts which have been flagged for moderation:

Have you tried logging out of the forum and then logging in again? I wonder if that would help.[/quote]

No joy. I logged off, and when i tried to log back on it immediately said I failed too many login attempts (odd since I had just logged off) and wanted me to to do a captcha as well as logon.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Nant task - Checkin, get new folder version back?

Post by jclausius » Tue Feb 01, 2011 3:35 pm

ajj3085 wrote:Thanks for the suggestions. I had thought about the latter option, but I had thought there's still a possiblity that a commit occures between the build's commit and it's label. That may or may not be likely depending on how Vault handles two commits at once (that is, the build begins it's commit, and while that's working another commit begins and completes before the first ends).
It all depends on which one gets there first. Transactions will be atomic, so the 1st one to ask the server to End the transaction will be granted a synchronization lock. The other transaction is blocked on that repository until the transaction ends. After the transaction has been successfully saved, the lock is released and the 2nd tx can then proceed.
Jeff Clausius
SourceGear

ajj3085
Posts: 228
Joined: Thu Feb 16, 2006 11:39 am

Re: Nant task - Checkin, get new folder version back?

Post by ajj3085 » Tue Feb 01, 2011 3:55 pm

[quote="jclausius"]It all depends on which one gets there first. Transactions will be atomic, so the 1st one to ask the server to End the transaction will be granted a synchronization lock. The other transaction is blocked on that repository until the transaction ends. After the transaction has been successfully saved, the lock is released and the 2nd tx can then proceed.[/quote]

What's what I thought. Could a feature request be added so that the last part of committing the transaction gets the new folder version back? When you commit in SVN the last thing it displays was the revision number you just created. The version of the folder to which you committed should work fine (ie, if you commit to $/project/myfolder you get back the folder version for $/project/myfolder).

Thanks
Andy

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Nant task - Checkin, get new folder version back?

Post by jclausius » Tue Feb 01, 2011 5:18 pm

At what level are you using the API? In other words, are you using, VaultClientIntegrationLib, the lower libraries, or NAnt Tasks?

Right now, from the pure API, EndTx() will return the latest repository revision, plus it will return the *new* version of each item within the change set within the VaultRequestItem. That should give you enough info to create the label, but are you seeing that data?
Jeff Clausius
SourceGear

ajj3085
Posts: 228
Joined: Thu Feb 16, 2006 11:39 am

Re: Nant task - Checkin, get new folder version back?

Post by ajj3085 » Fri Feb 04, 2011 9:54 pm

[quote="jclausius"]At what level are you using the API? In other words, are you using, VaultClientIntegrationLib, the lower libraries, or NAnt Tasks?[/quote]

I'm using the Nant tasks (which I ported to Msbuild).

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Nant task - Checkin, get new folder version back?

Post by jclausius » Tue Feb 08, 2011 9:54 am

Andy,

Yeah, the NAnt tasks do not provide you with enough data to get what you're looking for. There's not a way to return a folder version as you could have a change set with files from folders all over the repository.

In any case, I'll log a request to see if there is a way the commit NAnt task could return folder version information from all folders in the "just committed" change set.
Jeff Clausius
SourceGear

ajj3085
Posts: 228
Joined: Thu Feb 16, 2006 11:39 am

Re: Nant task - Checkin, get new folder version back?

Post by ajj3085 » Tue Feb 08, 2011 8:03 pm

[quote="jclausius"]Yeah, the NAnt tasks do not provide you with enough data to get what you're looking for. There's not a way to return a folder version as you could have a change set with files from folders all over the repository.

In any case, I'll log a request to see if there is a way the commit NAnt task could return folder version information from all folders in the "just committed" change set.[/quote]

I understand what you're saying, and I appreciate you looking into this for me.

If it helps, when I do the check in it's always for $/project/trunk (or $/project/branches/branch), so it's just a single folder. Never $/project1/trunk;$/project2/trunk. Is the latter a common use case?

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Nant task - Checkin, get new folder version back?

Post by jclausius » Wed Feb 09, 2011 9:11 am

ajj3085 wrote:... $/project1/trunk;$/project2/trunk. Is the latter a common use case?
It can be. It really all depends on the type of user and their process.

The Vault UI is extremely flexible in that you can operate in multiple folders in this regard.
Jeff Clausius
SourceGear

Post Reply