Check in UNchanged file

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
Tri
Posts: 288
Joined: Wed Dec 22, 2004 11:10 am

Check in UNchanged file

Post by Tri » Fri Apr 15, 2005 9:27 am

Scenario:
- The working folder has 50 files checked out.
- Only 2 files are new since the last check in
- I use Vault Cmd line client to check in (+keep files check out) all the 50 files

Question: How does Vault Cmd Line client handle the 48 UNchanged files?
- Would their version# incremented (I wish not)?
- Are they really checked in (and consume any database space)?

I have tested with GUI Vault Client 3.05. It seems that Vault does nothing when checking in an unchanged file (no version increment, no new entry in file history). Can I assume that there is zero DB space consumption and Vault Cmd client also exposes the same behaviour?

Thanks in advance.

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

Post by jclausius » Fri Apr 15, 2005 9:38 am

The default of the Command Line Client (CLC) is to undo the checkout. If you want different behavior, use the -unchanged <OPTION>.

See

Code: Select all

Vault.exe HELP commit
for more information related to the unchanged options.
Jeff Clausius
SourceGear

Tri
Posts: 288
Joined: Wed Dec 22, 2004 11:10 am

Post by Tri » Fri Apr 15, 2005 11:07 am

Does undocheckout set the file to "check in" status?

I would like CLC to do nothing and leave the file ALWAYS checked out on an unchanged file. So that the next time I run the command, the file could be checked in if it is changed.

Should I use the options:

Vault.exe -keepcheckedout -unchanged leavecheckedout

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

Post by jclausius » Fri Apr 15, 2005 11:56 am

No. The -keepcheckedout option applies to modified files.

In the case of 50 files checked out, of which 3 are modified...

VAULT COMMIT -UNCHANGED leavecheckedout

will leave 47 files in the change set after the command has completed.


If you ran

VAULT COMMIT -UNCHANGED leavecheckedout -keepcheckedout

there would be 50 files in the change set. Although the three files had their changes committed, the lock was not removed.
Jeff Clausius
SourceGear

Tri
Posts: 288
Joined: Wed Dec 22, 2004 11:10 am

Post by Tri » Fri Apr 15, 2005 12:10 pm

jclausius wrote: If you ran

VAULT COMMIT -UNCHANGED leavecheckedout -keepcheckedout

there would be 50 files in the change set. Although the three files had their changes committed, the lock was not removed.
Which lock were you referring to? And what is a change set? A collection of checked-out files?

I would like these 50 files to be ALWAYS checked out. The files which are changed and checked in by CLC could very well be changed again tomorrow.

In short, I would like to run CLC every midnight on the working folder. New or changed files must be checked in. Requirements are:

- unchanged files: nothing happen, they must remain checked out (so that CLC would be able to check them in possibly next time)

- change files: check in, but leave the files checked out. Same purpose, they could be changed again tomorrow and will be checked in again.

- new files (working folder may have new files created): add files to Vault project and these file should also remains checked out.

- deleted files (exist in Vault project but not in working folder): do nothing.

Should I run CLC several times or can I do all of this in one single execution?

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

Post by jclausius » Fri Apr 15, 2005 1:23 pm

Tri wrote:Which lock were you referring to? And what is a change set? A collection of checked-out files?
A Lock is a checkout lock ( exclusive or normal ) placed on a file. It is an indication that a file will soon be changing.

A Change set is a group of related file/folder changes committed in a Vault transaction. If you using Vault in Checkout/Modify/Commit mode, a change set may include files which are locked ( checked out ).

A Pending Change set is a group of file/folder changes which you have not yet committed to the repository.
Tri wrote:I would like these 50 files to be ALWAYS checked out. The files which are changed and checked in by CLC could very well be changed again tomorrow.
Then -keepcheckedout -unchanged leavecheckedout should do what you want.
Tri wrote:In short, I would like to run CLC every midnight on the working folder. New or changed files must be checked in. Requirements are:

- unchanged files: nothing happen, they must remain checked out (so that CLC would be able to check them in possibly next time)

- change files: check in, but leave the files checked out. Same purpose, they could be changed again tomorrow and will be checked in again.

- new files (working folder may have new files created): add files to Vault project and these file should also remains checked out.

- deleted files (exist in Vault project but not in working folder): do nothing.

Should I run CLC several times or can I do all of this in one single execution?
You are going to have to do some type of change detection to catch the added or deleted files. Once you detect these changes, you would use

Code: Select all

vault ADD repository_path local_path
and

Code: Select all

vault DELETE repository_path
to determine these things.

Once you have determined the actions the ADD/DELETE will place the items into the Pending change set. You would then call

Code: Select all

vault COMMIT
to commit the change set to the repository.

HTH
Jeff Clausius
SourceGear

Locked