[ENH] ChangeSet files out names with author initials

Andres Valloud avalloud at exobox.com
Tue May 23 19:48:30 UTC 2000


Hi.

This implements two little changes in ChangeSet. Now, when changesets
are filed out, the author's initials are added at the beginning.
Includes a check so that this is not done more than once. It does not
affect the name of the changeset internally.

Yes, you may argue that initials at the beginning of the file name are
bad. You may go and change the code so that initials are added at the
end. I like initials at the beginning better.

Andres.

-------------- next part --------------
'From Squeak2.8alpha of 19 January 2000 [latest update: #2158] on 23 May 2000 at 12:42:36 pm'!
"Change Set:		ChangeSetFileOut
Date:			23 May 2000
Author:			Andres Valloud

Automatic initials in the changeset
fileout file. Format is:

someInitials followedByDash
thenBusinessAsUsual"!


!ChangeSet methodsFor: 'accessing' stamp: 'SqR 5/23/2000 12:41'!
nameForFileOut
	| selfName initials |

	selfName _ self name.
	initials _ Utilities authorInitials.
	^(selfName indexOfSubCollection: initials
		startingAt: 1 ifAbsent: [0]) = 1
			ifTrue: [selfName]
			ifFalse: [Utilities authorInitials, '-', selfName]! !

!ChangeSet methodsFor: 'fileIn/Out' stamp: 'SqR 5/19/2000 14:12'!
fileOut
	"File out the receiver, to a file whose name is a function of the change-set name and either of the date & time or chosen to have a unique numeric tag, depending on the preference 'sequentialChangeSetRevertableFileNames'"

	| file slips nameToUse |
	self checkForConversionMethods.
	nameToUse _ Preferences changeSetVersionNumbers
		ifTrue:
			[FileDirectory default nextNameFor: self nameForFileOut extension: 'cs']
		ifFalse:
			[(self nameForFileOut, FileDirectory dot, Utilities dateTimeSuffix, 
				FileDirectory dot, 'cs') asFileName].
	Cursor write showWhile:
		[file _ FileStream newFileNamed: nameToUse.
		file header; timeStamp.
		self fileOutPreambleOn: file.
		self fileOutOn: file.
		self fileOutPostscriptOn: file.
		file trailer; close].

	Preferences suppressCheckForSlips ifTrue: [^ self].

	slips _ self checkForSlips.
	(slips size > 0 and: [self confirm: 'Methods in this fileOut have halts
or references to the Transcript
or other ''slips'' in them.
Would you like to browse them?'])
		ifTrue: [Smalltalk browseMessageList: slips
							name: 'Possible slips in ', name]! !



More information about the Squeak-dev mailing list