Refactoring (part 2): Rename SCMAbstractPackageModel>>workingCopy to temporaryWorkingCopy
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sat, 01 Dec 2012 01:00:13 +0000
changeset 118 5a8b78ad48ae
parent 117 3014c22e2eab
child 119 f77801e5484c
Refactoring (part 2): Rename SCMAbstractPackageModel>>workingCopy to temporaryWorkingCopy
mercurial/HGChangesetId.st
mercurial/HGCommitDialog.st
mercurial/HGCommitTask.st
mercurial/HGPackageModel.st
mercurial/HGPackageModelRegistry.st
mercurial/HGStXTests.st
mercurial/mercurial.rc
--- a/mercurial/HGChangesetId.st	Sat Dec 01 00:50:48 2012 +0000
+++ b/mercurial/HGChangesetId.st	Sat Dec 01 01:00:13 2012 +0000
@@ -273,7 +273,7 @@
 
     aStream nextPutAll: (self copyTo: 6) hexPrintString asLowercase
 
-    "Modified: / 30-11-2012 / 23:42:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-12-2012 / 00:55:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGChangesetId methodsFor:'queries'!
--- a/mercurial/HGCommitDialog.st	Sat Dec 01 00:50:48 2012 +0000
+++ b/mercurial/HGCommitDialog.st	Sat Dec 01 01:00:13 2012 +0000
@@ -125,7 +125,7 @@
     showOnlyModified := fileListShowOnlyModifiedHolder value.
     "HACK..."
 
-    wcroot := self model package root.
+    wcroot := self model package temporaryWorkingCopyRoot.
     wcrootPathNameRelative := wcroot pathNameRelative.
     wcrootPathNameRelativeLen := wcrootPathNameRelative size.
 
@@ -151,7 +151,7 @@
     self fileListHolder value: entries
 
     "Created: / 08-02-2012 / 18:05:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 16-11-2012 / 11:27:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-12-2012 / 00:48:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGCommitDialog methodsFor:'private'!
@@ -160,8 +160,8 @@
     | heads changeset |
 
     super doUpdateWorkingCopy.
-    heads := self task package workingCopy heads.
-    changeset := self task package workingCopy changeset.
+    heads := self task package temporaryWorkingCopy heads.
+    changeset := self task package temporaryWorkingCopy changeset.
     (heads includes: changeset) ifFalse:[
         self infoPanel 
             reset;
@@ -173,6 +173,7 @@
     ]
 
     "Created: / 27-11-2012 / 23:36:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-12-2012 / 00:49:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGCommitDialog class methodsFor:'documentation'!
--- a/mercurial/HGCommitTask.st	Sat Dec 01 00:50:48 2012 +0000
+++ b/mercurial/HGCommitTask.st	Sat Dec 01 01:00:13 2012 +0000
@@ -14,19 +14,19 @@
     "Actually commit the changes, To be overridden by subclasses"
 
     self synchronized:[    
-        self package workingCopy commit: msg files: containers.
-        self package workingCopy repository push: nil force: true.
+        self package temporaryWorkingCopy commit: msg files: containers.
+        self package temporaryWorkingCopy repository push: nil force: true.
     ].
 
     "Created: / 15-11-2012 / 16:52:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 27-11-2012 / 21:59:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-12-2012 / 00:27:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doPrepareWorkingCopy2
 
     self isPackageCommit ifTrue:[
         self do:[
-            self package ensureWorkingCopyAtRevision: self package revision.
+            self package ensureTemporaryWorkingCopyAtRevision:self package revision.
             self doFileOut
         ]
     ].
--- a/mercurial/HGPackageModel.st	Sat Dec 01 00:50:48 2012 +0000
+++ b/mercurial/HGPackageModel.st	Sat Dec 01 01:00:13 2012 +0000
@@ -25,10 +25,12 @@
 !
 
 repository
-    self ensureWorkingCopy.
-    ^wc repository
+    "Returns original package repository (not the temporary repository)"
+
+    ^repository
 
     "Created: / 15-11-2012 / 09:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-12-2012 / 00:33:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 revision
@@ -40,14 +42,11 @@
     "Created: / 28-11-2012 / 09:41:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-upstreamRepository
-    "Returns original package repository (not the temporary repository)"
+temporaryRepository
+    self ensureTemporaryWorkingCopy.
+    ^wc repository
 
-    "Stupid naming here..."
-
-    ^repository
-
-    "Created: / 27-11-2012 / 23:22:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 01-12-2012 / 00:31:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGPackageModel methodsFor:'accessing-classes'!
@@ -87,43 +86,47 @@
 
 !HGPackageModel methodsFor:'utils'!
 
-ensureWorkingCopy
+ensureTemporaryWorkingCopy
     "raise an error: must be redefined in concrete subclass(es)"
-
-    | rev tmpPath tmpRepo tmpWc |
+    
+    | rev  tmpPath  tmpRepo  tmpWc |
 
     rev := self definition hgLogicalRevision.
-    (wc notNil and:[wc path exists]) ifTrue:[ ^ self ].
-
-    tmpPath := self manager temporaryWorkingCopyDirectory / repository uuid printString.
+    (wc notNil and:[ wc path exists ]) ifTrue:[
+        ^ self
+    ].
+    tmpPath := self manager temporaryWorkingCopyDirectory 
+            / repository uuid printString.
     tmpPath exists ifTrue:[
-        tmpRepo := HGRepository on: tmpPath.
+        tmpRepo := HGRepository on:tmpPath.
         tmpRepo pull.
     ] ifFalse:[
-        tmpRepo := repository cloneTo: tmpPath update: false.
+        tmpRepo := repository cloneTo:tmpPath update:false.
     ].
     tmpWc := tmpRepo workingCopy.
-    tmpWc update: rev.
-
-    self wc: tmpWc
+    tmpWc update:rev.
+    self wc:tmpWc
 
     "Created: / 14-11-2012 / 00:16:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 28-11-2012 / 09:38:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-ensureWorkingCopyAtRevision: rev
+ensureTemporaryWorkingCopyAtRevision:rev 
     "Make sure temporary working exists and is at
      given revision"
 
-    self assert: rev revno notNil.
+    | cs |
 
-    self ensureWorkingCopy.
+    cs := self repository changesetWithId: rev.
+    
+
+    self ensureTemporaryWorkingCopy.
     rev notNil ifTrue:[
-        wc update: rev revno printString. 
+        wc update:cs id revno printString.
     ].
 
     "Created: / 28-11-2012 / 09:38:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 30-11-2012 / 23:22:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-12-2012 / 00:47:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGPackageModel class methodsFor:'documentation'!
--- a/mercurial/HGPackageModelRegistry.st	Sat Dec 01 00:50:48 2012 +0000
+++ b/mercurial/HGPackageModelRegistry.st	Sat Dec 01 01:00:13 2012 +0000
@@ -41,7 +41,7 @@
     toFlush do:[:package|
         | wcdir |
         repositories removeKey: package repository path ifAbsent:[nil].
-        wcdir := package workingCopy path.
+        wcdir := package temporaryWorkingCopy path.
         [ wcdir recursiveRemove ] on: Error do:[
             OperatingSystem isMSWINDOWSlike ifTrue:[
                 Delay waitForSeconds: 1.
@@ -52,8 +52,8 @@
     ].
 
     "Created: / 16-11-2012 / 19:40:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 22-11-2012 / 11:38:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 22-11-2012 / 16:03:07 / jv"
+    "Modified: / 01-12-2012 / 00:32:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGPackageModelRegistry class methodsFor:'documentation'!
--- a/mercurial/HGStXTests.st	Sat Dec 01 00:50:48 2012 +0000
+++ b/mercurial/HGStXTests.st	Sat Dec 01 01:00:13 2012 +0000
@@ -191,7 +191,7 @@
     self assert: ((repo @ 2 ) parent1 == (repo @ 1 )).
 
     (MockHGP1Bar compile:'zork ^ 2' classified:'test') package: MockHGP1Bar package.
-    pm workingCopy path recursiveRemove.
+    pm temporaryWorkingCopy path recursiveRemove.
 
     ct := pm commitTask.
     ct message:'test_commit_02-2'.
@@ -205,6 +205,7 @@
     "
 
     "Created: / 20-11-2012 / 19:35:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-12-2012 / 00:30:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 test_commit_03a
@@ -305,7 +306,7 @@
     self assert: ((repo @ 3 ) parent1 == (repo @ 1 )).
 
     "=== A flushed its working copy ========================= "
-    pmA workingCopy path recursiveRemove.
+    pmA temporaryWorkingCopy path recursiveRemove.
 
     
     "=== A modifies & commits =============================== "    
@@ -322,7 +323,7 @@
     "
 
     "Created: / 20-11-2012 / 19:51:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 23-11-2012 / 23:11:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-12-2012 / 00:30:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 test_commit_03c
--- a/mercurial/mercurial.rc	Sat Dec 01 00:50:48 2012 +0000
+++ b/mercurial/mercurial.rc	Sat Dec 01 01:00:13 2012 +0000
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright Jan Vrany 2012\0"
       VALUE "ProductName", "Smalltalk/X Mercurial Integration\0"
       VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Fri, 30 Nov 2012 23:52:58 GMT\0"
+      VALUE "ProductDate", "Sat, 01 Dec 2012 00:58:58 GMT\0"
     END
 
   END