[squeak-dev] The Inbox: MonticelloSqueak-tfel.1.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jun 12 13:11:25 UTC 2010


A new version of MonticelloSqueak was added to project The Inbox:
http://source.squeak.org/inbox/MonticelloSqueak-tfel.1.mcz

==================== Summary ====================

Name: MonticelloSqueak-tfel.1
Author: tfel
Time: 12 June 2010, 3:11:21.978 pm
UUID: b20624b1-6525-443e-9487-51dcdf6ec633
Ancestors: 

This package includes the MCTrunkCommitHelper class which I propose to simplify contributing to the inbox for new Squeakers (or old Squeakers new to the trunk development model).
It depends on Monticello-tfel.395

==================== Snapshot ====================

SystemOrganization addCategory: #MonticelloSqueak!

Object subclass: #MCTrunkCommitHelper
	instanceVariableNames: 'workingCopy'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'MonticelloSqueak'!

!MCTrunkCommitHelper commentStamp: 'tfel 6/12/2010 14:43' prior: 0!
A MCTrunkCommitHelper is a simple wizard-ish class that leads a Squeaker new to the trunk development model of Squeak through the first steps of contributing changes to the inbox.
It adds a new entry to the Monticello Browser's context menu for that.!

----- Method: MCTrunkCommitHelper classSide>>diffExplanation (in category 'accessing-text') -----
diffExplanation

	^ 'You will now be presented a diff of your changes against current trunk.
	- If you have updated, please make sure your changes still work. 
	- Make sure you don''t submit more changes than you intent to
	  (Use method versions to remove changes you do not want to submit) '!

----- Method: MCTrunkCommitHelper classSide>>inboxSubmitQuestion (in category 'accessing-text') -----
inboxSubmitQuestion

	^ 'After reviewing the changes:
	Explain your changes in the commit message. If the changes are 
	more complex and require a longer explanation, consider writing an 
	email to the squeak-dev mailing list
	
	Do you want to commit now?'!

----- Method: MCTrunkCommitHelper classSide>>inboxUrl (in category 'accessing-urls') -----
inboxUrl 

	^ 'http://source.squeak.org/inbox'!

----- Method: MCTrunkCommitHelper classSide>>initialize (in category 'class initialization') -----
initialize

	super initialize.
	MCWorkingCopyBrowser 
		addMenuSpec: (MCMenuSpec new
			entry: 'submit to squeak inbox';
			target: self new;
			selector: #submit:;
			yourself).!

----- Method: MCTrunkCommitHelper classSide>>trunkExplanation (in category 'accessing-text') -----
trunkExplanation

	^ 'The Squeak development happens in the trunk.
	To submit patches, you have to update to the latest Squeak development version.
	This version, while not released, is used by many Developers around the world.
	However, if you have critical code running in this very image, you might want to save it
	as a new version just in case.
	
	If you want to contribute to Squeak, you might want to sign up to the squeak-dev mailinglist
	as well. For further explanation of the trunk model, see
	http://squeakboard.wordpress.com/2009/07/02/a-new-community-development-model/
	
	Do you want to update?'!

----- Method: MCTrunkCommitHelper classSide>>trunkUrl (in category 'accessing-urls') -----
trunkUrl 

	^ 'http://source.squeak.org/trunk'!

----- Method: MCTrunkCommitHelper>>checkDiff (in category 'actions') -----
checkDiff

	| patch |
	self inform: self class diffExplanation.
	patch := workingCopy changesRelativeToRepository: self trunk.
	^ (patch isNil or: [patch isEmpty])
		ifTrue: [self inform: 'No changes against trunk. Aborting submission'. false]
		ifFalse: [(MCPatchBrowser forPatch: patch)
					label: 'Patch Browser: ', workingCopy description;
					showModally.
				true].!

----- Method: MCTrunkCommitHelper>>goToTrunk (in category 'actions') -----
goToTrunk

	(MCMcmUpdater defaultUpdateURL = self class trunkUrl 
		or: [(UserDialogBoxMorph confirm: self class trunkExplanation)])
		ifTrue: [
			MCMcmUpdater defaultUpdateURL: self class trunkUrl.
			self updateToTrunk.
			^ true].
	^ false!

----- Method: MCTrunkCommitHelper>>inbox (in category 'repositories') -----
inbox

	^ MCHttpRepository allInstances 
		detect: [:r | r locationWithTrailingSlash = (self class inboxUrl, '/')]
		ifNone: [MCHttpRepository location: self class inboxUrl user: '' password: ''].!

----- Method: MCTrunkCommitHelper>>save: (in category 'actions') -----
save: aMCWorkingCopyBrowser

	aMCWorkingCopyBrowser 
		workingCopy: workingCopy;
		repository: self inbox;
		saveVersion.!

----- Method: MCTrunkCommitHelper>>submit: (in category 'actions') -----
submit: aMCWorkingCopyBrowser

	workingCopy := aMCWorkingCopyBrowser workingCopies 
		at: aMCWorkingCopyBrowser workingCopySelection.
	self goToTrunk
		ifTrue: [
			self checkDiff ifTrue: [
				(UserDialogBoxMorph confirm: self class inboxSubmitQuestion)
					ifTrue: [self save: aMCWorkingCopyBrowser]]].!

----- Method: MCTrunkCommitHelper>>trunk (in category 'repositories') -----
trunk

	^ MCHttpRepository allInstances 
		detect: [:r | r locationWithTrailingSlash = (self class trunkUrl, '/')]
		ifNone: [MCHttpRepository location: self class inboxUrl user: '' password: ''].!

----- Method: MCTrunkCommitHelper>>updateToTrunk (in category 'actions') -----
updateToTrunk

	Utilities updateFromServer.!




More information about the Squeak-dev mailing list