common/SCMAbstractFileoutLikeTask.st
changeset 53 8043f7b6f41a
parent 44 832a135ebe08
child 70 3faeae24a513
--- a/common/SCMAbstractFileoutLikeTask.st	Wed Nov 14 21:41:23 2012 +0000
+++ b/common/SCMAbstractFileoutLikeTask.st	Thu Nov 15 01:42:14 2012 +0000
@@ -161,47 +161,25 @@
 !SCMAbstractFileoutLikeTask methodsFor:'executing - private'!
 
 doAddNewContainers
-    |filesAndDirsToAdd filesToAdd containers|
+    | wcroot containers |
 
     ActivityNotification notify:'Adding new containers'.
-    containers := self isSelectiveFileoutTask ifTrue:[
-                #()
-            ] ifFalse:[
-                self containersToFileOut
-            ].
-    filesAndDirsToAdd := ((StatusCommand new)
-                workingCopy:self workingCopy;
-                paths:containers;
-                execute) 
-                    select:[:wcEntry | wcEntry status isUnversioned ]
-                    thenCollect:[:wcEntry | wcEntry path ].
-    filesToAdd := filesAndDirsToAdd select:
-        [:fname|(workingCopy path / fname) isDirectory not].
-    filesAndDirsToAdd isEmpty ifFalse:[
-        packageClassesChanged := true.
-        (AddCommand new)
-            workingCopy:self workingCopy;
-            paths:filesAndDirsToAdd;
-            execute.
-    ].
-    filesToAdd isEmpty ifFalse:[
-        (PropsetCommand new)
-            workingCopy:self workingCopy;
-            name:'svn:keywords';
-            value:'Id HeadURL';
-            paths:containers;
-            execute.
-        (PropsetCommand new)
-            workingCopy:self workingCopy;
-            name:'svn:eol-style';
-            value:'LF';
-            paths:containers;
-            execute
+    containers := 
+        self isSelectiveFileoutTask 
+            ifTrue:[#()] 
+            ifFalse:[self containersToFileOut].
+    wcroot := self workingCopyRoot.
+
+    containers do:[:nm|
+        | entry |
+
+        entry := wcroot / nm.
+        entry track.
     ]
 
     "Created: / 11-04-2008 / 10:58:53 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 19-08-2009 / 14:00:26 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 29-09-2011 / 11:47:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-11-2012 / 00:14:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doCompileCopyrightMethods
@@ -244,7 +222,10 @@
 
             metaCls := cls theMetaclass.
             ((metaCls includesSelector:versionMethodName) not 
-                or:[ ((cls perform:versionMethodName asSymbol) startsWith:'$Id') not ]) 
+                "JV@2012-11-14: libsvn did this check, however, it is not valid for
+                 SCMs that does not expand keywords. I disable it, but kept as comment
+                 as I do not remember why it was good for..."
+                "or:[ ((cls perform:versionMethodName asSymbol) startsWith:'$Id') not ]") 
                     ifTrue:[
                         metaCls compile:(metaCls 
                                     versionMethodTemplateForSourceCodeManager:self package manager)
@@ -277,7 +258,7 @@
     "Created: / 28-05-2008 / 07:43:43 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 16-08-2009 / 12:59:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 07-07-2011 / 20:15:21 / jv"
-    "Modified: / 14-11-2012 / 01:06:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 14-11-2012 / 22:34:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doFileOutPackageClasses
@@ -293,11 +274,11 @@
 
             ProgressNotification notify:'Filing out ' , cls nameWithoutPrefix
                 progress:(100 / klasses size) * index.
-            (self shouldFileOutClass:cls) ifTrue:[self workingCopy fileOutClass: cls]]
+            (self shouldFileOutClass:cls) ifTrue:[self package fileOutClass: cls]]
 
     "Created: / 11-04-2008 / 10:58:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 19-08-2009 / 13:44:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 15-10-2011 / 20:14:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-11-2012 / 00:26:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doFileOutPackageExtensions
@@ -323,49 +304,48 @@
 !
 
 doRemoveOldContainers
-    |containers containersToKeep containersToDelete|
+    | wcroot containers containersToKeep containersToDelete |
 
     self isSelectiveFileoutTask ifTrue:[
         ^ self
     ].
     ActivityNotification notify:'Removing old containers'.
-    containers := self workingCopy containers.
-    containersToKeep := self workingCopy containersToKeep.
+    wcroot := package workingCopyRoot.
+    containers := self package containers.
+    containersToKeep := self package containersToKeep.
     containersToDelete := containers \ containersToKeep.
-    containersToDelete isEmpty ifFalse:[
-        packageClassesChanged := true.
-        (DeleteCommand new)
-            workingCopy:self workingCopy;
-            paths:containersToDelete;
-            execute
-    ].
+    containersToDelete do:[:nm|
+        | entry |
+
+        entry := wcroot / nm.
+        entry remove
+    ]
 
     "Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 08-08-2011 / 14:33:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-11-2012 / 00:54:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doRenameContainerForClassNamed: new using: renames language: lang
 
-    | old oldC newC |
+    | wcroot old oldC oldE newC newE |
     old := renames at: new.
     (renames includesKey: old) ifTrue:[
         self doRenameContainerForClassNamed: old using: renames language: lang.
     ].
+    wcroot := package workingCopyRoot.
     oldC := (SVN::Repository containerNameWithoutSuffixForClassNamed: old) , '.' , lang sourceFileSuffix.
     newC := (SVN::Repository containerNameWithoutSuffixForClassNamed: new) , '.' , lang sourceFileSuffix.
-    (workingCopy containerFilenameFor: oldC) exists ifTrue:[
+    (oldE := wcroot containerFilenameFor: oldC) exists ifTrue:[
         packageClassesChanged := true.
-        MoveCommand new
-            workingCopy: workingCopy;
-            src: oldC;
-            dst: newC;
-            execute.
+        newE := wcroot / newC.
+        newE moveTo: oldE.
     ].
 
     "Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Created: / 06-08-2011 / 21:33:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-11-2012 / 00:17:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doRenameContainers
@@ -407,7 +387,7 @@
     self filesToGenerate do:[:supportFileName | 
         | supportFile |
 
-        supportFile := self package root / (supportFileName , '.tmp').
+        supportFile := self workingCopyRoot / (supportFileName , '.tmp').
         (packageClassesChanged or:[ supportFile exists not ]) ifTrue:[
             ActivityNotification notify:'Updating ' , supportFileName.
             supportFile directory exists ifFalse: [supportFile directory makeDirectory].
@@ -423,12 +403,13 @@
         supportFile := package root / supportFileName.
         supportFileTmp := package root / (supportFileName , '.tmp').
 
-        supportFileTmp moveTo: supportFile
+        supportFileTmp moveTo: supportFile.
+        supportFile track.
     ].
 
     "Created: / 20-06-2009 / 16:01:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 21-06-2009 / 15:18:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 07-10-2012 / 10:00:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-11-2012 / 00:27:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doUpdateProjectDefinition
@@ -554,20 +535,11 @@
 
 shouldFileOutMethod: mth
 
-    ^mth package = package and:
-	[mth getSourcePosition isNil]
-
-    "
-	CommitTask basicNew
-            package: #'stx:libsvn';
-	    shouldFileOutMethod: (CommitTask >> #shouldFileOutMethod:)
-
-	CommitTask basicNew
-	    package: #'stx:libbasic';
-	    shouldFileOutMethod: (Object >> #yourself)
-    "
+    ^mth package = package name and:
+        [mth getSourcePosition isNil]
 
     "Created: / 24-06-2009 / 19:07:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified (comment): / 15-11-2012 / 00:36:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SCMAbstractFileoutLikeTask methodsFor:'queries'!
@@ -585,6 +557,11 @@
     ^thisContext method mclass theNonMetaclass instVarNamed: #revision
 !
 
+version_HG
+    "Never, ever change this method. Ask JV or CG why"
+    ^thisContext method mclass theNonMetaclass instVarNamed: #revision
+!
+
 version_SVN
     ^ '$Id::                                                                                                                        $'
 ! !