Unable to read root

So, I am using SharpSVN (SharpSvn.1.7-x86 1.7008.2243) and I have a problem all the time. Every time I try to use SvnWorkingCopyClientin a repo, which is located in the root of the disk (for example, I have a disk D:\, and it itself is a repo), it gives me an error svn_dirent_is_absolute.

In fact, the only team I could find was anyway, there wasn’t SvnClient.GetUriFromWorkingCopy(string)

Any ideas on how I can solve this (other than moving my working copy or link to the file system)? I hope to find a way in the code or an alternative to work with this restriction (since it seems that SVN 1.7 no longer has this restriction).

Here is the code?

private void fakeFunction(){
    var RootPath="d:\";
    using (var client = new SharpSvn.SvnClient())
    using(var workingClient = new SvnWorkingCopyClient())
    {
        SvnWorkingCopyVersion workingVersion = null;
        // Exception happens here
        if (workingClient.GetVersion(this.RootPath, out workingVersion))
        {
            CurrentRevision = workingVersion.End;
                // This will resolve just fine
            var targetUri = client.GetUriFromWorkingCopy(RootPath);
            var target = SvnTarget.FromUri(targetUri);
            SvnInfoEventArgs info = null;
            if (client.GetInfo(target, out info))
            {
                if (workingVersion.End != info.Revision)
                {
                    System.Collections.ObjectModel.Collection<SvnLogEventArgs> logEventArgs = null;
                    if (client.GetLog(targetUri, out logEventArgs))
                    {
                        var oldBack = Console.BackgroundColor;
                        var oldFor = Console.ForegroundColor;
                        Console.BackgroundColor = ConsoleColor.DarkMagenta;
                        Console.ForegroundColor = ConsoleColor.White;
                        foreach (var l in logEventArgs)
                        {
                            Console.WriteLine("[{0}-{1}]-{2}", l.Revision, l.Author, l.LogMessage);
                        }
                        Console.BackgroundColor = oldBack;
                        Console.ForegroundColor = oldFor;
                    }

                    System.Console.WriteLine("Repo not up to date.");
                }
            }
        }
    }
}

http://subversion.tigris.org/issues/show_bug.cgi?id=3535 http://subversion.tigris.org/ds/viewMessage.do?dsForumId=463&viewType=browseAll&dsMessageId=2456472

, , ?

+5
3

SharSVN , . :

  • sharpsvn http://sharpsvn.open.collab.net/files/documents/180/5569/SSvnEx-1.7002.1998.zip
  • svnversion.exe bin.
  • , verison

        public static bool GetVersionHack(string appPath,string targetPath,out long version)
        { 
           // <param name="appPath">Path to svnversion.exe</param>
           // <param name="path">Target path</param>
           // <param name="version">Result version</param>
    
            Process p = new Process();               
    
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.FileName = appPath;
            p.StartInfo.Arguments = targetPath + " -n";
            p.Start();
    
            //read svnversion.exe result
            string output = p.StandardOutput.ReadToEnd();
            p.WaitForExit();
    
            output = output.Replace("M", "");
            output = output.Replace("S", "");
            output = output.Replace("P", "");
    
            //valid results
            //4123:4168     mixed revision working copy
            //4168M         modified working copy
            //4123S         switched working copy
            //4123P         partial working copy, from a sparse checkout
            //4123:4168MS   mixed revision, modified, switched working copy            
    
            return long.TryParse(output, out version);
        }
    

, , . , svnversion.exe GetVersionHack .

+1

"kludge" - ".." :

[pwd = C:\USERS\franklin\absrel]
root = ..\..\..
+2

If he complains about the absolute path, try defining the unc path instead. Share your D: \ drive, which is your svn repo. Then use it with

    var RootPath="\\<servername>\D$";
0
source

All Articles