changed: #doSVNAddFiles:
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 28 Feb 2012 15:05:40 +0100
changeset 1050 e7a45066062b
parent 1049 98d2212ba6c8
child 1051 ce27ce3ab6c1
changed: #doSVNAddFiles:
SVN__SyncWithCVSTask.st
--- a/SVN__SyncWithCVSTask.st	Thu Feb 23 16:11:53 2012 +0100
+++ b/SVN__SyncWithCVSTask.st	Tue Feb 28 15:05:40 2012 +0100
@@ -265,14 +265,37 @@
 !
 
 doSVNAddFiles: files 
+
+    | filesToAdd |
     files isEmpty ifTrue: [ ^ self ].
+    filesToAdd := Set new.
+    files do:[:f|
+        | d |
+
+        d := f directory.
+        (d / '.svn') exists ifTrue:[
+            filesToAdd add: f
+        ] ifFalse:[
+            | pd |
+            pd := d.
+            d := d directory.
+            [ (d / '.svn') exists ] whileFalse:[
+                pd := d.
+                d := d directory.
+            ].
+            filesToAdd add: pd.
+        ]
+    ].
+
+
     (AddCommand new)
         workingCopy: workingCopy;
-        paths: (files collect: [:e | e pathName ]);
+        paths: (filesToAdd collect: [:e | e pathName ]);
         execute.
 
     "Created: / 02-06-2009 / 19:39:28 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 19-08-2009 / 11:27:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified (format): / 16-11-2011 / 12:13:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SyncWithCVSTask methodsFor:'initialization'!