]> git.mxchange.org Git - simgear.git/commitdiff
Avoid unlink of an open file.
authorJames Turner <zakalawe@mac.com>
Wed, 4 May 2016 21:13:15 +0000 (22:13 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 13 Aug 2016 08:21:16 +0000 (10:21 +0200)
Works on Unix, not so great on Windows it turns out. Thanks to Jasin
and Geoff for figuring this out in the end.

simgear/io/SVNDirectory.cxx
simgear/io/SVNDirectory.hxx

index a4ef9bc5247786342417551bb9ae001575de790a..267d312094f4a11044ad8b7cab90e4b076fbe306 100644 (file)
@@ -136,7 +136,7 @@ void SVNDirectory::parseCache()
         _cachedRevision = versionName;
         doneSelf = true;
       } else {
-        DAVResource* child = addChildDirectory(hrefPtr)->collection();
+        DAVResource* child = parseChildDirectory(hrefPtr)->collection();
           string s = strutils::strip(versionName);
           if (!s.empty()) {
               child->setVersionName(versionName);
@@ -235,6 +235,17 @@ SVNDirectory::addChildDirectory(const std::string& dirName)
     return child;
 }
 
+SVNDirectory*
+SVNDirectory::parseChildDirectory(const std::string& dirName)
+{
+    assert(!dav->childWithName(dirName));
+    DAVCollection* childCol = dav->createChildCollection(dirName);
+    SVNDirectory* child = new SVNDirectory(this, childCol);
+    childCol->setVersionName(child->cachedRevision());
+    _children.push_back(child);
+    return child;
+}
+
 void SVNDirectory::deleteChildByName(const std::string& nm)
 {
     DAVResource* child = dav->childWithName(nm);
index 68bca1b008b0e1384b3cff9d2736e1ce1e8be10b..1d7122cc6735f621ae69dacc56785af3a71dc2a6 100644 (file)
@@ -91,7 +91,8 @@ private:
   void writeCache();
   
   DirectoryList::iterator findChildDir(const std::string& dirName);
-      
+  SVNDirectory* parseChildDirectory(const std::string& dirName);
+
   SGPath localPath;
   DAVCollection* dav;
   SVNRepository* repo;