How to do an auto commit on changed files

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

shannon

Re: How to do an auto commit on changed files

Post by shannon » Wed Jan 28, 2009 4:01 pm

Ok, well, the error from the client log looks like something went wrong with an op you performed from the gui client.

There might be a more useful message in the server log.

Does it always throw an exception? Have you tried just committing one or two simple changes?

joacim
Posts: 21
Joined: Wed Jan 28, 2009 6:04 am
Location: Interactive Medica

Re: How to do an auto commit on changed files

Post by joacim » Wed Jan 28, 2009 4:12 pm

I'm only trying to commit (or rather add) a few files and create one subdirectory. All of the files are new. There are a total of 4 files, 3 in the root directory and 1 in one subdirectory.

joacim
Posts: 21
Joined: Wed Jan 28, 2009 6:04 am
Location: Interactive Medica

Re: How to do an auto commit on changed files

Post by joacim » Wed Jan 28, 2009 4:38 pm

Here's the last few items from the server log:
----2009-01-28 22:16:11 admin--c-c259e353.431-1-64736c10.cust.bredbandsbolaget.se(83.227.89.194)--SSL Disabled Login
----2009-01-28 22:16:15 admin--c-c259e353.431-1-64736c10.cust.bredbandsbolaget.se(83.227.89.194)--SSL Disabled (23f36c41-4f16-44c9-9421-5913bf0d4c75) BeginTx returned: Failure
----2009-01-28 22:16:15 admin--c-c259e353.431-1-64736c10.cust.bredbandsbolaget.se(83.227.89.194)--SSL Disabled (23f36c41-4f16-44c9-9421-5913bf0d4c75) AddFolder: $/TestAutoCheckIn/Demo returned: Failure
----2009-01-28 22:16:15 admin--c-c259e353.431-1-64736c10.cust.bredbandsbolaget.se(83.227.89.194)--SSL Disabled (23f36c41-4f16-44c9-9421-5913bf0d4c75) AddFolder: $/TestAutoCheckIn/Demo returned: FailObjAlreadyExists
----2009-01-28 22:16:15 admin--c-c259e353.431-1-64736c10.cust.bredbandsbolaget.se(83.227.89.194)--SSL Disabled (23f36c41-4f16-44c9-9421-5913bf0d4c75) AddFile: $/TestAutoCheckIn/Project1.sbproj returned: Failure
----2009-01-28 22:16:15 admin--c-c259e353.431-1-64736c10.cust.bredbandsbolaget.se(83.227.89.194)--SSL Disabled (23f36c41-4f16-44c9-9421-5913bf0d4c75) AddFile: $/TestAutoCheckIn/robocopy.txt returned: Failure
----2009-01-28 22:16:15 admin--c-c259e353.431-1-64736c10.cust.bredbandsbolaget.se(83.227.89.194)--SSL Disabled (23f36c41-4f16-44c9-9421-5913bf0d4c75) AddFile: $/TestAutoCheckIn/SubUnit.bsl returned: Failure
----2009-01-28 22:16:15 admin--c-c259e353.431-1-64736c10.cust.bredbandsbolaget.se(83.227.89.194)--SSL Disabled (23f36c41-4f16-44c9-9421-5913bf0d4c75) AddFile: $/TestAutoCheckIn/Demo/Test.txt returned: Failure
----2009-01-28 22:16:15 admin--c-c259e353.431-1-64736c10.cust.bredbandsbolaget.se(83.227.89.194)--SSL Disabled (23f36c41-4f16-44c9-9421-5913bf0d4c75) AddFile: $/TestAutoCheckIn/Demo/Test.txt returned: Failure
----2009-01-28 22:16:16 admin--c-c259e353.431-1-64736c10.cust.bredbandsbolaget.se(83.227.89.194)--SSL Disabled Logout

joacim
Posts: 21
Joined: Wed Jan 28, 2009 6:04 am
Location: Interactive Medica

Re: How to do an auto commit on changed files

Post by joacim » Wed Jan 28, 2009 4:59 pm

I've solved it :D. I should not use ProcessCommandAdd on subfolders...

Thanks for all the help!

shannon

Re: How to do an auto commit on changed files

Post by shannon » Wed Jan 28, 2009 5:22 pm

You're welcome.

joacim
Posts: 21
Joined: Wed Jan 28, 2009 6:04 am
Location: Interactive Medica

Re: How to do an auto commit on changed files

Post by joacim » Wed Jan 28, 2009 6:45 pm

I have one more question if you don't mind: Can I programmatically set the CVS style? I don't want to have to check out files before I check them in, neither should their be any exclusive locks on these files.

shannon

Re: How to do an auto commit on changed files

Post by shannon » Wed Jan 28, 2009 11:01 pm

If you don't plan to change the style back and forth on that user, you can just log into the gui client and set it there. It will use the same settings as long as you log in on the same machine.

UserOptions uo = ServerOperations.client.ClientInstance.UserOptions;
uo.SetBool(VaultOptions.RequireCheckOut, false);

I think RequireCheckOut is the only one that will make a difference to you (if you aren't checking out, then there won't be any exclusive locks anyway). If you want to set any of the others, just look for the VaultOptions value for it.

joacim
Posts: 21
Joined: Wed Jan 28, 2009 6:04 am
Location: Interactive Medica

Re: How to do an auto commit on changed files

Post by joacim » Thu Jan 29, 2009 3:17 am

Thank you again for the quick response. I have one question about the following statement though:
shannon wrote:If you don't plan to change the style back and forth on that user, you can just log into the gui client and set it there. It will use the same settings as long as you log in on the same machine.
Does this setting "follow" the user account or is it set on the client computer? What I mean is that if I use the GUI client on my developer machine to set this option will it be set even if the program runs from another computer (given of course that it logs on to the same Vault server)?

I also have a couple of other quick questions if you don't mind :).

In the help file for VaultClientIntegrationLib I find the following statement for the ProcessCommandGetLabelToLocationOutsideWorkingFolder method:
If you use this method to download objects, you will not be able to check in from the that folder on disk. If you will need to check in from this location, use ProcessCommandGetLabelToTempWorkingFolder instead.
However for the ProcessCommandGetLabelToTempWorkingFolder method the following statement is provided:
If you use this method to download objects, you will not be able to check in from the that folder on disk.
Which of the statements are correct?

How can I list the Labels a particular item has?

shannon

Re: How to do an auto commit on changed files

Post by shannon » Thu Jan 29, 2009 6:41 pm

The settings are per machine, they won't follow you.

They're both technically correct, although obviously confusing. If you use ProcessCommandGetLabelToLocationOutsideWorkingFolder, it does a get and stores no baseline information. If you use ProcessCommandGetLabelToTempWorkingFolder, it temporarily sets a working folder, does the get and removes the working folder. So, you have baseline information, but no working folder. If you set a working folder there, you should be able to check in I believe.

I'll address your last question in the other thread you started.

joacim
Posts: 21
Joined: Wed Jan 28, 2009 6:04 am
Location: Interactive Medica

Re: How to do an auto commit on changed files

Post by joacim » Fri Jan 30, 2009 7:19 am

Thanks for clearing that up for me :D

Post Reply