tags:

views:

931

answers:

1

Hello all, I am attempting to do a merge using SharpSVN. A bit of research and I have learned the SharpSVN supports the MergDiff function, however when I attempt the code as listed below I am getting an error message of not all required revisions are specified.

Thanks

try
{
    SvnCheckOutArgs argsSVNCheckout = new SvnCheckOutArgs();
    SvnUpdateResult result;
    SvnTarget _rootSVNTarget = null;   // = new SvnTarget();
    string serverUrl = "http://svn.snaffpaw.com:8080/CPM Creator/";


    // The Subversion target to run log against
    SvnTarget target = null;

    // Attempt to create an SvnTarget by parsing the targetPath
    if (string.IsNullOrEmpty(targetPath) ||
        !SvnTarget.TryParse(targetPath, out target))

    if (string.IsNullOrEmpty(serverUrl) || (!SvnTarget.TryParse(serverUrl,out _rootSVNTarget))) 


    //SvnStatusArgs argSVN = new SvnStatusArgs();
    //argSVN.RetrieveRemoteStatus = true;

    //Collection<SvnStatusEventArgs> infos;
    //bool isChecked = client.GetStatus(targetPath, argSVN, out infos);

    // Attempt to create an SvnTarget by parsing the targetPath
    if (string.IsNullOrEmpty(targetPath) ||
        !SvnTarget.TryParse(targetPath, out target))


        if (string.IsNullOrEmpty(serverUrl) || !SvnTarget.TryParse(serverUrl, out _rootSVNTarget))



    client.Authentication.DefaultCredentials = new NetworkCredential("guest", "guestpwd");



    client.DiffMerge(targetPath, _rootSVNTarget, target); //<<<-- errors here
}
// ...
+1  A: 

As noted on the SharpSvn user list the following example would have resolved the missing revisions:

using (SvnClient client = new SvnClient())
{
 client.DiffMerge(
     "CHANGES",  // Target to merge to
     new SvnUriTarget(new Uri("http://svn.collab.net/repos/svn/tags/1.5.0/CHANGES")), SvnRevision.Head),
     new SvnUriTarget(new Uri("http://svn.collab.net/repos/svn/tags/1.5.5/CHANGES"), SvnRevision.Head));
 }

The error was that the passed Uris didn't default to the HEAD revision, but had to use the head revision explicitly.

This is fixed in the current daily build available on http://sharpsvn.net/daily/

Bert Huijben