Issues of replacing SharpSVN 1.5 dll to SharpSVN 1.6 dll -
We are using SharpSVN 1.5 dll for our source control functionalites. Our checkout works as followers in checkout and checkin
Suppose I want to check a folder name test and it has 3 files file1.txt, file2.txt, file3.txt
Step 1: - Checkout file from SVN repository 1.txt - Step 2: - Checkout file 2 from SVN repository TTE - Step 3: - Checkout file from SVN repository 3 dot
During the checkout operation in file 1, the .svn folder is created in our work folder. This is a file named as entries in the .svn folder. This file contains the SVN repository and checkout file information (we can see it through Notepad). When the file2.txt checkout operation occurred (checkout in the same work folder) no new .svn folder is created. Sharpsvn uses the existing .svn file (last file checkout .svn folder) and file2.txt information in the entries file adds up. The same thing happened when checkingout file3.txt in the same working folder.
During the checkin operation the first checkin file is 1.txt then file2 then file3. SVN uses all these files in the single SSN folder (in the working folder) in checkin. In file 1. During check check-in, the entries file contains this information, so this file belongs to the SVN version control and it can successfully check in. Similarly file2 Txt and file3.txt
We are now trying to use SharpSVN 1.6 dll, but there are some problems facing checkout and checkin operation.
The file1.txt checkout is created during the .svn folder and there is file1.txt information in the entries file. During file2.txt checkout, the existing .svn foder has been removed and the new .svn folder has been created. These entries do not include the file2.txt information only in file1.txt information.When I am trying to check, the previous The file which I am checking out from SVN is only checked in SVN. This is because the file in entries in the SVN folder is only the last checked file information.
I need to enter all file information entries as my code snippet
public string [] checkon (string psppath, string policy, string plackpath, Int pRevisionNum) // svn {string [] checks a file from strCheckoutDetails = new string [2]; Uri Uri SCSP = new Uri (PSCP); SvnCheckOutArgs objChkoutargs = New SvnCheckOutArgs (); ObjChkoutargs.Revision = pRevisionNum; SvnInfoEventArgs information; Try {objChkoutargs.Depth = SvnDepth.Empty; String strSingleFiletoCheckout = uriSCPath.ToString (); String strFolderNameofSingleFileSelected = strSingleFiletoCheckout.Remove (strSingleFiletoCheckout.LastIndexOf ('/')); Ury Ursinglefile checkout = new URI (StrawFolderName field selected); _objSVNClient.CheckOut (uriSingleFileCheckout, pLocalPath, objChkoutargs); // Empty Task Folder SvnTarget target = new URI (strSingleFiletoCheckout); String strFileNameonlyfromUri = strSingleFiletoCheckout.Substring (strSingleFiletoCheckout.LastIndexOf ("/") + 1); If (copyFiletoWorkingCopy (pLocalPath, strFileNameonlyfromUri, _objSVNClient)) // Current file is available for copying version - Biju {pLocalPath = ""; Throw New SharpSvn.SvnException ("Checkout Exceptions"); } _objSVNClient.GetInfo (uriSCPath, information out); StrCheckoutDetails [0] = info.LastChangeRevision.ToString (); } Hold (exception before) {pLocalPath = ""; East; } StrCheckoutDetails [1] = pLocalPath; Return strCheckoutDetails; }
thanks
resume
Directly checking files in subversion is not supported. What you can do, and what still works in Subversion / SharpSVN 1.6:
- Check out a directory with depth = empty. It creates a working copy without any files
- svn update --set-depth = files file1.txt
copy this piece of example code to check an empty task, and file1.txt and file2 .txt fetches If you later bring Point3.txt, then all 3 files are in entries, and you can execute all Subversion commands on them.
using (SvnClient client = new SvnClient ()) {SvnCheckOutArgs coArgs = New SvnCheckOutArgs (); CoArgs.Depth = SvnDepth.Empty; Client.CheckOut (new URI ("http: // server / repos / directory"), targetDir, coArgs); SvnUpdateArgs updateArgs = new SvnUpdateArgs (); UpdateArgs.Depth = SvnDepth.Files; Client.Update (Path.Combine (targetDir, new string [] {"file1.txt", "file2.txt"}, updates); }
Comments
Post a Comment