MCRepository.st
branchjv
changeset 1160 1539e58bab91
parent 1159 5f3f06a99a93
--- a/MCRepository.st	Mon Jul 25 10:53:39 2022 +0100
+++ b/MCRepository.st	Mon Jul 25 11:09:53 2022 +0100
@@ -162,6 +162,55 @@
 	self subclassResponsibility
 !
 
+storePackage: packageName
+    "Smalltalk/X specific: store (fileout) a package named `packageName` 
+     into this repository.
+
+     This is a utility method useful for automation: 
+
+        (TonelRepository directory: '/tmp') storePackage: 'stx:goodies/monticello'
+
+    "
+
+    | mcpkg mcwc mcvi mcversion |
+
+
+    mcpkg := MCPackage named: packageName.
+    mcwc := mcpkg workingCopy.
+    mcvi := MCVersionInfo forPackage: packageName.
+    [
+        mcversion := mcwc newVersion.
+        mcversion snapshot options includeExtrasForSTX:false.
+    ] on:MCVersionNameAndMessageRequest do:[:ex | 
+        ex resume:(Array with:mcvi name with:mcvi message) 
+    ].
+    mcversion info:mcvi.
+    self storeVersion:mcversion.
+
+    "
+    (TonelRepository directory: '/tmp') storePackage: 'jv:libgdbs'
+    "
+
+    "Created: / 25-07-2022 / 11:00:55 / Jan Vrany <jan.vrany@labware.com>"
+!
+
+storeVersion: aVersion
+    | info |
+
+
+    self basicStoreVersion: (self prepareVersionForStorage: aVersion).
+    self sendNotificationsForVersion: aVersion.
+
+    "/ Add entry to changeset so user can figure out when the
+    "/ package was last saved and where.
+    info := '%1 into %2' bindWith: aVersion package name with: self description.
+    ChangeSet current addChange: 
+        (InfoChange type: 'fileout' data: info timestamp: Timestamp now).
+    self class addInfoRecord: 'fileout ', info
+
+    "Modified: / 25-07-2022 / 10:42:08 / Jan Vrany <jan.vrany@labware.com>"
+!
+
 versionWithInfo: aVersionInfo
 	^ self versionWithInfo: aVersionInfo ifAbsent: [nil]
 !
@@ -182,23 +231,6 @@
 		nextPut: $(;
 		nextPutAll: self description;
 		nextPut: $).
-!
-
-storeVersion: aVersion
-    | info |
-
-
-    self basicStoreVersion: (self prepareVersionForStorage: aVersion).
-    self sendNotificationsForVersion: aVersion.
-
-    "/ Add entry to changeset so user can figure out when the
-    "/ package was last saved and where.
-    info := '%1 into %2' bindWith: aVersion package name with: self description.
-    ChangeSet current addChange: 
-        (InfoChange type: 'fileout' data: info timestamp: Timestamp now).
-    self class addInfoRecord: 'fileout ', info
-
-    "Modified: / 25-07-2022 / 10:42:08 / Jan Vrany <jan.vrany@labware.com>"
 ! !
 
 !MCRepository methodsFor:'queries'!