How do I check in an array of files?

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

Moderator: SourceGear

Tanguy
Posts: 23
Joined: Fri Oct 18, 2013 1:18 pm

How do I check in an array of files?

Post by Tanguy » Thu Jul 14, 2016 7:02 am

I am trying to check in a list of files, with the code below

Code: Select all

public void CheckInFiles(string prjPath, string labelName, string[] files)
{
	ServerOperations.ProcessCommandCheckIn(files, UnchangedHandler.Checkin, false, LocalCopyType.Leave);
}
The items array contains strings like "$\Tools\VzpoApp\VzpoApp.sln" --> filepath in repository.

Any help is appreciated.
Last edited by Tanguy on Fri Jul 15, 2016 2:41 am, edited 3 times in total.

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

Re: How do I check in an array of files?

Post by jclausius » Thu Jul 14, 2016 7:20 am

To commit any changes to the repository, you'll need the repository paths.

Take a look at the source code in the ClientAPI around VaultCmdLineClient.ProcessCommand()#case Command.CHECKIN, VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckIn(), and VaultClientIntegrationLib.ServerOperations.ProcessCommandCommit() to see if that can guide you on committing files to a repository.
Jeff Clausius
SourceGear

Tanguy
Posts: 23
Joined: Fri Oct 18, 2013 1:18 pm

Re: How do I check in an array of files?

Post by Tanguy » Thu Jul 14, 2016 8:23 am

Hi Jeff,

Thank you for your reply, but I keep getting the error (see screenshot)

Image

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

Re: How do I check in an array of files?

Post by jclausius » Thu Jul 14, 2016 8:48 am

Is this from an exception? What does the exception say?

Another option is to add / use VaultClientIntegrationLib project source code to your solution OR copy VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckin() (and all dependent methods) to VaultFunctions(), and debug/step through the code to see where the problem may lie.
Jeff Clausius
SourceGear

Tanguy
Posts: 23
Joined: Fri Oct 18, 2013 1:18 pm

Re: How do I check in an array of files?

Post by Tanguy » Fri Jul 15, 2016 1:32 am

Hi Jeff,

I will write down the steps

1) I choose a folder from my repository to show all Checked out files (from that folder)

Image

2) I check the files I want to check in,

3) and finally I click on Commit (but unfortunately I get the error which sais "Commit failed.")

Image


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Exception: Commit failed
at VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckin(String[] objectPaths, UnchangedHandler unchanged, Boolean keepCheckedOut, LocalCopyType localCopy, Boolean resolveMerge)
at KaspAxoClient.Lib.VaultFunctions.CheckInItemsWithLabelName(String prjPath, String labelName, String[] items) in c:\LNX\Tools\KaspAxoClient\KaspAxoClient.Lib\VaultFunctions.cs:line 210
at KaspAxoClient.CheckInForm.btnCommit_Click(Object sender, EventArgs e) in c:\LNX\Tools\KaspAxoClient\KaspAxoClient\CheckInForm.cs:line 37
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1080.0 built by: NETFXREL3STAGE
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
KaspAxoClient
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/LNX/Tools/KaspAxoClient/KaspAxoClient/bin/Debug/KaspAxoClient.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1081.0 built by: NETFXREL3STAGE
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1078.0 built by: NETFXREL3STAGE
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
KaspAxoClient.Lib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/LNX/Tools/KaspAxoClient/KaspAxoClient/bin/Debug/KaspAxoClient.Lib.DLL
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1064.2 built by: NETFXREL3STAGE
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
AxosoftAPI.NET
Assembly Version: 4.0.6.0
Win32 Version: 4.0.6.0
CodeBase: file:///C:/LNX/Tools/KaspAxoClient/KaspAxoClient/bin/Debug/AxosoftAPI.NET.DLL
----------------------------------------
System.Web
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1073.0 built by: NETFXREL3STAGE
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
Newtonsoft.Json
Assembly Version: 6.0.0.0
Win32 Version: 6.0.8.18111
CodeBase: file:///C:/LNX/Tools/KaspAxoClient/KaspAxoClient/bin/Debug/Newtonsoft.Json.DLL
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Runtime.Serialization
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System.Xml.Linq
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1080.0 built by: NETFXREL3STAGE
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
VaultClientIntegrationLib
Assembly Version: 9.1.0.30584
Win32 Version: 9.1.0.30584
CodeBase: file:///C:/LNX/Tools/KaspAxoClient/KaspAxoClient/bin/Debug/VaultClientIntegrationLib.DLL
----------------------------------------
VaultClientNetLib
Assembly Version: 9.1.0.30584
Win32 Version: 9.1.0.30584
CodeBase: file:///C:/LNX/Tools/KaspAxoClient/KaspAxoClient/bin/Debug/VaultClientNetLib.DLL
----------------------------------------
VaultClientOperationsLib
Assembly Version: 9.1.0.30584
Win32 Version: 9.1.0.30584
CodeBase: file:///C:/LNX/Tools/KaspAxoClient/KaspAxoClient/bin/Debug/VaultClientOperationsLib.DLL
----------------------------------------
VaultLib
Assembly Version: 9.1.0.30584
Win32 Version: 9.1.0.30584
CodeBase: file:///C:/LNX/Tools/KaspAxoClient/KaspAxoClient/bin/Debug/VaultLib.DLL
----------------------------------------
System.Web.Services
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Web.Services/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
----------------------------------------
Microsoft.GeneratedCode
Assembly Version: 1.0.0.0
Win32 Version: 4.6.1064.2 built by: NETFXREL3STAGE
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
VCDiff
Assembly Version: 9.1.0.30584
Win32 Version: 9.1.0.30584
CodeBase: file:///C:/LNX/Tools/KaspAxoClient/KaspAxoClient/bin/Debug/VCDiff.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: How do I check in an array of files?

Post by Beth » Fri Jul 15, 2016 7:46 am

Are any of the files you are checking in over 10 mb in size?

Also, is there anything logged in your Vault server log?
Beth Kieler
SourceGear Technical Support

Tanguy
Posts: 23
Joined: Fri Oct 18, 2013 1:18 pm

Re: How do I check in an array of files?

Post by Tanguy » Mon Jul 18, 2016 7:08 am

Hi Beth,

The files I try to check in aren't 10 mb

Where can I find what's logged in my Vault server log? Thank you in advance.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: How do I check in an array of files?

Post by Beth » Mon Jul 18, 2016 7:26 am

The Vault Server Log is at C:\Windows\temp\sgvault\sgvault.log. In there, search for your Vault login name or your IP address to see entries that pertain to you.
Beth Kieler
SourceGear Technical Support

Tanguy
Posts: 23
Joined: Fri Oct 18, 2013 1:18 pm

Re: How do I check in an array of files?

Post by Tanguy » Mon Jul 18, 2016 7:44 am

Beth wrote:The Vault Server Log is at C:\Windows\temp\sgvault\sgvault.log. In there, search for your Vault login name or your IP address to see entries that pertain to you.
I can't find the file C:\Windows\temp\sgvault\sgvault.log

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: How do I check in an array of files?

Post by Beth » Mon Jul 18, 2016 8:22 am

Are you checking on the Vault server?

To check the location of the log file by log into the Vault admin web page and click the Logging link.
Beth Kieler
SourceGear Technical Support

Tanguy
Posts: 23
Joined: Fri Oct 18, 2013 1:18 pm

Re: How do I check in an array of files?

Post by Tanguy » Wed Jul 20, 2016 1:01 am

Beth wrote:Are you checking on the Vault server?

To check the location of the log file by log into the Vault admin web page and click the Logging link.
I will check with my colleagues and reply as soon as I know more.

Tanguy
Posts: 23
Joined: Fri Oct 18, 2013 1:18 pm

Re: How do I check in an array of files?

Post by Tanguy » Mon Aug 01, 2016 1:36 am

Hi Beth,

In the Server Log I get these messages after a successful login. Then I tried to checkin some files as you can see and it failed:
----1/08/2016 9:17:08 mt--LBEvert(192.168.10.42)--SSL Disabled Login
----1/08/2016 9:17:22 mt--LBEvert(192.168.10.42)--SSL Disabled Logout
----1/08/2016 9:17:22 mt--LBEvert(192.168.10.42)--SSL Disabled Login
----1/08/2016 9:17:39 mt--LBEvert(192.168.10.42)--SSL Disabled (7a263449-b47b-4566-843f-c59b6dba1a44) BeginTx returned: Failure
----1/08/2016 9:17:39 mt--LBEvert(192.168.10.42)--SSL Disabled (7a263449-b47b-4566-843f-c59b6dba1a44) CheckIn: $/Tools/KaspAxoClient/KaspAxoClient.sln returned: FailCheckInCommentRequired
----1/08/2016 9:17:39 mt--LBEvert(192.168.10.42)--SSL Disabled (7a263449-b47b-4566-843f-c59b6dba1a44) CheckIn: $/Tools/ReleaseInstaller/ReleaseInstaller/AppForm.cs returned: Failure
----1/08/2016 9:17:39 mt--LBEvert(192.168.10.42)--SSL Disabled (7a263449-b47b-4566-843f-c59b6dba1a44) CheckIn: $/Tools/KaspAxoClient/KaspAxoClient/KaspAxoClient.csproj returned: Failure
----1/08/2016 9:17:39 mt--LBEvert(192.168.10.42)--SSL Disabled (7a263449-b47b-4566-843f-c59b6dba1a44) CheckIn: $/Tools/KaspAxoClient/KaspAxoClient.Lib/ConfigFileFunctions.cs returned: Failure

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: How do I check in an array of files?

Post by Beth » Mon Aug 01, 2016 7:43 am

It's saying you need to put in a comment. Do you have that?
Beth Kieler
SourceGear Technical Support

Tanguy
Posts: 23
Joined: Fri Oct 18, 2013 1:18 pm

Re: How do I check in an array of files?

Post by Tanguy » Tue Aug 02, 2016 12:48 am

Hi Beth,

It isn't possible to give a comment when checking in.

Please look at the picture (attached) for the method signature.

Thank you in advance.
Attachments
checkin1.png
checkin1.png (7.16 KiB) Viewed 39715 times

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: How do I check in an array of files?

Post by Beth » Tue Aug 02, 2016 8:57 am

Before the check in set the ServerOperations.client.Comment field. You'll want to set it to empty string after your call.

A useful thread that talk about adding comments: http://support.sourcegear.com/viewtopic ... ent#p58410.

Another option is to turn off the Require Check In comments on the repository using the Vault admin web page. Go to http://<your Vault server>/vaultservice/admin, log in as admin, expand repository names in the left column, then click the repository name for the one to change the comment requirement. On the right side is the check box option.
Beth Kieler
SourceGear Technical Support

Post Reply