Ronny Pfannschmidt avatar Ronny Pfannschmidt committed 565afcc

commit in subdir for svn

Comments (0)

Files changed (1)


             file = root.add_file(target, join(self.repo.url, src), 1)
+        def add_file(file):
+            parts = file.split('/')
+            for i in range(1, len(parts)):
+                try:
+                    root.add_directory('/'.join(parts[:i])).close()
+                except Exception as e:
+                    pass
+            try:
+                return root.add_file(file)
+            except Exception as e:
+                print e
+                return root.open_file(file)
         for file in self.contents:
-            try:
-                svnfile = root.add_file(file)
-            except Exception:
-                svnfile = root.open_file(file)
+            svnfile = add_file(file)
             txhandler = svnfile.apply_textdelta()
             f = StringIO(self.contents[file])
             delta.send_stream(f, txhandler)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.