#FEATURE by cg
class: MCFileTreeRepository
changed:
#repositoryBranchName
#repositoryProperties
#repositoryVersionString
class: MCFileTreeRepository class
comment/format in: #parseName:extension:
--- a/MCFileTreeRepository.st Sat Sep 01 17:33:17 2018 +0200
+++ b/MCFileTreeRepository.st Sat Sep 01 17:35:45 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"{ Package: 'stx:goodies/monticello' }"
"{ NameSpace: Smalltalk }"
@@ -89,7 +91,7 @@
parseName: aString extension: extension
"picked up from GoferVersionReference>>parseName:"
- | info basicName package branch author versionNumber packageName |
+ | "info" basicName package branch author versionNumber packageName |
basicName := aString last isDigit
ifTrue: [ aString ]
ifFalse: [ (aString copyUpToLast: $.) copyUpTo: $( ].
@@ -109,6 +111,8 @@
author.
versionNumber.
(packageName , extension)}
+
+ "Modified (comment): / 01-09-2018 / 17:33:38 / Claus Gittinger"
!
urlAsFileReference: aZnUrl
@@ -151,9 +155,13 @@
repositoryBranchName
"extract a branch name from the repository ... if possible"
- (MetacelloPlatform current gitBranchNameFor: self directory fullName)
- ifNotNil: [ :sha | ^ sha ].
+ |sha|
+
+ (sha := MetacelloPlatform current gitBranchNameFor: self directory fullName)
+ notNil ifTrue:[ ^ sha ].
^ super repositoryBranchName
+
+ "Modified: / 01-09-2018 / 17:34:23 / Claus Gittinger"
!
repositoryDescription
@@ -164,9 +172,13 @@
repositoryVersionString
"extract a version string from the repository ... if possible"
- (MetacelloPlatform current gitCommitShaFor: self directory fullName)
- ifNotNil: [ :sha | ^ sha ].
+ |sha|
+
+ (sha := MetacelloPlatform current gitCommitShaFor: self directory fullName)
+ notNil ifTrue: [^ sha ].
^ super repositoryVersionString
+
+ "Modified: / 01-09-2018 / 17:34:51 / Claus Gittinger"
! !
!MCFileTreeRepository methodsFor:'*metacello-mc'!
@@ -235,6 +247,8 @@
!
repositoryProperties
+ |configEntry|
+
repositoryProperties
ifNil: [
repositoryProperties := Dictionary new.
@@ -246,16 +260,18 @@
,
(self fileUtils directoryPathString: self directory) printString
, ' does not exist.' ].
- (self directory entries
+ (configEntry := self directory entries
detect: [ :entry | entry name = '.filetree' ]
ifNone: [ ])
- ifNil: [
+ isNil ifTrue: [
repositoryProperties := self defaultRepositoryProperties.
self writeRepositoryProperties ]
- ifNotNil: [ :configEntry |
+ ifFalse: [
configEntry
readStreamDo: [ :fileStream | repositoryProperties := MCFileTreeJsonParser parseStream: fileStream ] ] ].
^ repositoryProperties
+
+ "Modified: / 01-09-2018 / 17:35:33 / Claus Gittinger"
!
versionFrom: aVersionReferenceString