|
From: Imran A. <Im...@PL...> - 2005-03-15 09:11:32
|
Hi ,
I'm Imran. I was looking out for a C# CVS Library for usage in my .Net
application when I came across NetCVSLibrary version 2.0 which is part of
the isharpcode project.
I'm in the process of writing a sample winforms application in C# that would
invoke the basic cvs commands like checkout, commit and update. I was able
to invoked the checkout command with success. The following is the code
snippet for the same.
CVSServerConnection connection = new CVSServerConnection();
CvsRoot cvsroot = new
CvsRoot(":pserver:satinderp@172.16.69.188:/cvs/HOMESTORECVS");
WorkingDirectory workingdirectory = new WorkingDirectory(cvsroot,
@"D:\\Imran\\cvs\\FileContainer_CVS", "FileContainer");
connection.Connect(workingdirectory, "password");
//check out
new CheckoutModuleCommand(workingdirectory).Execute(connection);
MessageBox.Show("CVS LOCAL CHECKOUT COMPLETED");
Similary I have written a code snippet to do a commit operation of the File
TestForm.cs contained in the checkout directory
"D:\Imran\cvs\FileContainer_CVS\FileContainer" . The following is the code
snippet for the same. Unfortunately I'm not able to do the commit operation
successfully. I get the error "cvs server: Up-to-date check failed for
`TestForm.cs' as the ErrorMessage Response.
CVSServerConnection connection = new CVSServerConnection();
CvsRoot cvsroot = new
CvsRoot(":pserver:satinderp@172.16.69.188:/cvs/HOMESTORECVS");
WorkingDirectory workingdirectory = new
WorkingDirectory(cvsroot,@"D:\Imran\cvs\FileContainer_CVS\FileContainer",
"FileContainer");
workingdirectory.AddAllFiles(@"D:\Imran\cvs\FileContainer_CVS\FileContainer"
);
MessageBox.Show(workingdirectory.Folders.Count.ToString());
connection.Connect(workingdirectory, "password");
CommitCommand2 objCommit = new CommitCommand2(workingdirectory);
objCommit.LogMessage = "Test Logging";
objCommit.ReleaseString = "Release Imran 2";
objCommit.Execute(connection);
Please guide me with reasons for the same or changes in the above code
snippet to yield a positive result. Also if you could share any examples
using the NetCVSLibrary, it would be appreciated. I've also downloaded the
SharpCVSLib but I cannot use it since my application uses .Net 1.0.
I'm looking forward to your help asap
Thanks & Regards
Imran
|