简体   繁体   中英

Sharp SVN Update crashes because of non-existent file

currently I am trying to switch from the embedded use of svn to the sharp svn plugin. The program I am working with did work and do what it should do but since i try to do it with sharp svn its crashing at the update step.

The code did run with the svn command:

svn update localRepoPath

I did already found a lot of code but none of this is working for me, here is the code at the moment:

 using (SvnClient client = new SvnClient())
                    {
                        //Reporter creates standard svn output
                        StringBuilder strBuilder = new StringBuilder();
                        SvnClientReporter reporter = new SvnClientReporter(client, strBuilder);

                        SvnUpdateArgs asdf = new SvnUpdateArgs();
                        asdf.AllowObstructions = true;
                        asdf.Depth = SvnDepth.Infinity;
                        asdf.IgnoreExternals = true;
                        asdf.UpdateParents = true;
                        asdf.Revision = SvnRevision.Head;
                        asdf.ThrowOnError = false;

                        asdf.Conflict += new EventHandler<SvnConflictEventArgs>(asdf_Conflict);
                        asdf.SvnError += new EventHandler<SvnErrorEventArgs>(asdf_Error);
                        asdf.Notify += new EventHandler<SvnNotifyEventArgs>(asdf_Notify);
                        asdf.Progress += new EventHandler<SvnProgressEventArgs>(asdf_Progress);

                        client.Update(localRepoPath, asdf);
                        _logger.Info("Updated");
                        _logger.Info(strBuilder.ToString());
                    }

It didn't update anything.

When i had the property from asdf.ThrowOnError changed to true:

asdf.ThrowOnError = true;

The Log output was:

Unhandled Exception: SharpSvn.SvnSystemException: Can't open 'D:\workspace\MyRepository\trunk\.svn\tmp\svn-E2A597E3': The system cannot find the path specified.

But this file 'svn-E2A597E3' doesn't exist, why does it try to update this file? After trying to update this file it fails and the update doesn't try to update the rest of the repository.

How can I handle it that it doesn't try to update this file or that it doesn't stop the update?

It works now!

The Directory which I wanted to update was a zip file which has been unzipped earlier with SharpZipLib. Unfortunately my Method to extract this Zip File wasn't correct and did ignore empty directories. This must have been producing the crash from the svn update. The "tmp" folder from the exception message didn't exist in the working copy. The extract Method body looks now like this:

            FastZip fastZip = new FastZip();
            string fileFilter = ".*";
            fastZip.CreateEmptyDirectories = true;

            // Will always overwrite if target filenames already exist
            fastZip.ExtractZip(localZipFileNameAndPath, extractDir, fileFilter);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM