Levente Uzonyi uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-ul.443.mcz ==================== Summary ==================== Name: Monticello-ul.443 Author: ul Time: 23 March 2011, 5:15:34.098 am UUID: 9617b274-a500-4c4b-a9ad-57f6f6c764bd Ancestors: Monticello-ul.441 - replaced MCReader class >> #concreteSubclasses with #concreteSubclassesDo: which saves a few seconds from each update - removed unnecessary #in: send from various MCVersionName accessors - recategorized MCVersionName's methods - MCFileBasedRepository >> #allVersionNames returns version names without file suffix or ancestor-attributes (this fixes Gofer) =============== Diff against Monticello-ul.441 =============== Item was changed: ----- Method: MCFileBasedRepository>>allVersionNames (in category 'private-files') ----- allVersionNames + + ^self readableFileNames collect: [ :each | each versionName ]! - ^ self readableFileNames! Item was removed: - ----- Method: MCReader class>>concreteSubclasses (in category 'testing') ----- - concreteSubclasses - ^ self allSubclasses reject: [:c | c isAbstract]! Item was added: + ----- Method: MCReader class>>concreteSubclassesDo: (in category 'testing') ----- + concreteSubclassesDo: aBlock + + self allSubclassesDo: [ :each | + each isAbstract ifFalse: [ aBlock value: each ] ]! Item was changed: ----- Method: MCReader class>>readerClassForFileNamed: (in category 'testing') ----- readerClassForFileNamed: fileName + + self concreteSubclassesDo: [ :each | + (each canReadFileNamed: fileName) ifTrue: [ ^each ] ]. + ^nil! - ^ self concreteSubclasses - detect: [:c | c canReadFileNamed: fileName] - ifNone: [nil]! Item was changed: + ----- Method: MCVersionName classSide>>on: (in category 'instance creation') ----- - ----- Method: MCVersionName classSide>>on: (in category 'create') ----- on: aString "aString may be with or without a mc? extension." ^ (self new: aString size) replaceFrom: 1 to: aString size with: aString startingAt: 1 ; yourself! Item was changed: + ----- Method: MCVersionName>>= (in category 'comparing') ----- - ----- Method: MCVersionName>>= (in category 'testing') ----- = aByteString "Ignore any file-extension for comparison of MCVersionNames." | myVersionName | aByteString isString ifFalse: [ ^ false ]. myVersionName := self versionName. ^ (myVersionName compare: myVersionName with: aByteString asMCVersionName versionName collated: AsciiOrder) = 2! Item was changed: + ----- Method: MCVersionName>>ancestorAuthor (in category 'accessing') ----- - ----- Method: MCVersionName>>ancestorAuthor (in category 'access') ----- ancestorAuthor "The author of the ancestor, if this is a Diffy filename." + + ^self ancestry copyUpTo: $.! - ^ self ancestry in: - [ : authorDotVersion | authorDotVersion copyUpTo: $. ]! Item was changed: + ----- Method: MCVersionName>>ancestorVersionNumber (in category 'accessing') ----- - ----- Method: MCVersionName>>ancestorVersionNumber (in category 'access') ----- ancestorVersionNumber "The author of the ancestor, if this is a Diffy filename." + + ^(self ancestry copyAfter: $.) asInteger ifNil: [ 0 ]! - ^ self ancestry in: - [ : authorDotVersion | (authorDotVersion copyAfter: $.) asInteger ifNil: [ 0 ] ]! Item was changed: + ----- Method: MCVersionName>>ancestry (in category 'accessing') ----- - ----- Method: MCVersionName>>ancestry (in category 'private') ----- ancestry "If I am a in the diffy-format which includes the ancestor attributes, answer them as a single String, separated by a dot." ^ (self copyAfterLast: $() copyUpTo: $)! Item was changed: + ----- Method: MCVersionName>>author (in category 'accessing') ----- - ----- Method: MCVersionName>>author (in category 'access') ----- author "The author initials embedded in the filename." + + ^(self versionName copyAfterLast: $-) copyUpTo: $.! - ^ self versionName in: - [ : verName | (verName copyAfterLast: $-) copyUpTo: $. ]! Item was changed: + ----- Method: MCVersionName>>hash (in category 'comparing') ----- - ----- Method: MCVersionName>>hash (in category 'testing') ----- hash ^ self versionName hash! Item was changed: + ----- Method: MCVersionName>>packageName (in category 'accessing') ----- - ----- Method: MCVersionName>>packageName (in category 'access') ----- packageName "The MC Package name embedded into this filename." + + ^self versionName copyUpToLast: $-! - ^ self versionName in: - [ : verName | verName copyUpToLast: $- ]! Item was changed: + ----- Method: MCVersionName>>versionName (in category 'accessing') ----- - ----- Method: MCVersionName>>versionName (in category 'access') ----- versionName "Answer my version name as a ByteString, without the file suffix or any ancestor-attributes." ^ self last isDigit ifTrue: [ "The whole of me, but convert to a ByteString" self copyFrom: 1 to: self size ] ifFalse: [ (self copyUpToLast: $.) copyUpTo: $( ]! Item was changed: + ----- Method: MCVersionName>>versionNumber (in category 'accessing') ----- - ----- Method: MCVersionName>>versionNumber (in category 'access') ----- versionNumber "The Integer version number identified by this filename." ^ ((self versionName copyAfterLast: $-) copyAfter: $.) asInteger ifNil: [ 0 ]! Item was changed: ----- Method: MCVersionReader class>>initialize (in category 'file services') ----- initialize "MCVersionReader initialize" Smalltalk at: #MczInstaller ifPresent: [:installer | FileList unregisterFileReader: installer]. + self concreteSubclassesDo: [:aClass | FileList registerFileReader: aClass]. - self concreteSubclasses do: [:aClass | FileList registerFileReader: aClass]. "get rid of AnObsoleteMCMcReader and AnObsoleteMCMcvReader" (FileList registeredFileReaderClasses select: [ :ea | ea isObsolete ]) do: [ :ea | FileList unregisterFileReader: ea ] ! |
Hey, thanks for your MC patches; I'm reviewing now.
> Item was changed: > + ----- Method: MCVersionName>>ancestry (in category 'accessing') ----- > - ----- Method: MCVersionName>>ancestry (in category 'private') ----- > ancestry > "If I am a in the diffy-format which includes the ancestor attributes, answer them as a single String, separated by a dot." > ^ (self copyAfterLast: $() copyUpTo: $)! This was intentionally "private" because outside code should not be depending on this method; they should use the individual accessors for diffy ancestry. Unless you object, I'd like to put it back to private. - Chris |
On Wed, 23 Mar 2011, Chris Muller wrote:
> Hey, thanks for your MC patches; I'm reviewing now. > >> Item was changed: >> + ----- Method: MCVersionName>>ancestry (in category 'accessing') ----- >> - ----- Method: MCVersionName>>ancestry (in category 'private') ----- >> ancestry >> "If I am a in the diffy-format which includes the ancestor attributes, answer them as a single String, separated by a dot." >> ^ (self copyAfterLast: $() copyUpTo: $)! > > This was intentionally "private" because outside code should not be > depending on this method; they should use the individual accessors for > diffy ancestry. > > Unless you object, I'd like to put it back to private. Levente > > - Chris > > |
Free forum by Nabble | Edit this page |