Vault Client API - URGENT! Need example of checking in file
Moderator: SourceGear
Vault Client API - URGENT! Need example of checking in file
I am stumped and need to be able to checkin a file that I just checked out and modified in code.
Thanks,
-Jim
Thanks,
-Jim
Calling ClientInstance.Commit() should do the trick. Commit() with no args will attempt to commit all the change set items in the internal change set. If you only want to commit a few of the items in your change set, call Commit(ChangeSetItemColl). There is also a Commit(ChangeSetItemColl,bool,bool), which allows for keeping files checked out and removing local copies.
If you're calling any of these Commit functions, and it doesn't seem to be doing anything, hook up an event handler to ClientInstance.NewMessage, and watch the messages that are sent to your callback. These are the strings that go into the message pane in the GUI client.
If you're calling any of these Commit functions, and it doesn't seem to be doing anything, hook up an event handler to ClientInstance.NewMessage, and watch the messages that are sent to your callback. These are the strings that go into the message pane in the GUI client.
Shaw Terwilliger
SourceGear LLC
`echo sterwill5sourcegear6com | tr 56 @.`
SourceGear LLC
`echo sterwill5sourcegear6com | tr 56 @.`
One thing I forgot to mention was that the internal change set is persistent. If you add something to it (like a "Create Folder" change set item), it will stay there until you either undo it or commit it. If you later check out a file (it will then appear in the internal change set too), and call commit with no arguments, both items will be committed. If the first is failing (maybe because the destination name is invalid), the whole transaction will keep failing.
The workaround is to do what I think you said you were doing in your other message: call the commit that takes the ChangeSetItemColl and put only one of the items from InternalChangeSet_Get in it.
The workaround is to do what I think you said you were doing in your other message: call the commit that takes the ChangeSetItemColl and put only one of the items from InternalChangeSet_Get in it.
Shaw Terwilliger
SourceGear LLC
`echo sterwill5sourcegear6com | tr 56 @.`
SourceGear LLC
`echo sterwill5sourcegear6com | tr 56 @.`
Ok I have narrowed down the problem
(this is all using the Vault Client API)
If I Open vault, check out a file, modify it and then try to check it back in, it fails.
...but...
If I Open vault, check out a file, modify it, then logout, Open vault again, then try to check in the file, it works.
So, it seems like theres something I need to do in between checking it out and checking back to let the "Client" know that it has changed.
Any ideas?
-Jim
If I Open vault, check out a file, modify it and then try to check it back in, it fails.
...but...
If I Open vault, check out a file, modify it, then logout, Open vault again, then try to check in the file, it works.
So, it seems like theres something I need to do in between checking it out and checking back to let the "Client" know that it has changed.
Any ideas?
-Jim
I think I have it...
I put a ClientInstance.DoLocalRefresh() call and it seems to work...from the documentation I would not have guessed this would have worked but...I'll take it!
Thanks,
Jim
Thanks,
Jim