Skip to content

Commit

Permalink
Add GSChangesTo{Show,Materialize,Commit}
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDoe committed Oct 11, 2024
1 parent 289d9f6 commit 4a2db0e
Show file tree
Hide file tree
Showing 89 changed files with 435 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
actionLabel
^ self isMerge ifTrue: ['Merge'] ifFalse: ['Commit']
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
actionLabelInIngForm
^ self isMerge ifTrue: ['merging'] ifFalse: ['committing']
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
alwaysMaterialize
self shouldAlwaysMaterialize: true.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
actions-private
basicCommit
self workingCopy
commitChangeSets: self changeSets
message: self message
parents: self parents.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
actions-private
basicRunNow
self
basicCommit;
materializeIfNecessary.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
actions-private
beforeDialogOpen
super beforeDialogOpen.
self dialog message: self initialMessage.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
checking
checkIsAtOriginalHeadCommit
self isAtOriginalHeadCommit ifTrue: [^ true].
self inform: 'These changes are outdated. Aborting.'.
^ false
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
checking
checkIsMessageEmpty
self isMessageEmpty ifFalse: [^ false].
self inform: 'Empty message, aborting.'.
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
actions
commit
^ self runAs: GSChangesToCommit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
currentHeadCommit
^ self workingCopy headCommit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
actions-private
dialogAction
self checkIsAtOriginalHeadCommit ifFalse: [^ self].
self checkHasConflicts ifTrue: [^ self].
self checkIsMessageEmpty ifTrue: [^ self].
self runNow.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
dialogClass
^ GSChangesDialogWithMessage
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
configuring
doAmend
self parents: self originalHeadCommit parents.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
configuring
doMerge: aCommit
self
parents: {self originalHeadCommit. aCommit};
alwaysMaterialize.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
configuring
doRegularCommit
self parents: {self originalHeadCommit}.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
initialMessage: aString
initialMessage := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
initialMessage
^ initialMessage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialize-release
initialize
super initialize.
self shouldAlwaysMaterialize: false.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isAtOriginalHeadCommit
^ self currentHeadCommit = self originalHeadCommit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isEmpty
^ self isMerge not and: [super isEmpty]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isMerge
^ self parents size > 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isMessageEmpty
^ self message isEmpty
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
actions-private
materializeIfNecessary
self shouldMaterialize ifTrue: [self basicMaterialize].
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
message
^ self dialog ifNotNil: #message ifNil: [self initialMessage]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
nothingToDoMessage
^ 'No changes to {1}.' format: {self actionLabel withFirstCharacterDownshifted}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
originalHeadCommit: aCommit
originalHeadCommit := aCommit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
originalHeadCommit
^ originalHeadCommit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
parents: aCollection
parents := aCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
parents
^ parents
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
shouldAlwaysMaterialize: aBoolean
shouldAlwaysMaterialize := aBoolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
shouldAlwaysMaterialize
^ shouldAlwaysMaterialize
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
testing
shouldMaterialize
self shouldAlwaysMaterialize ifTrue: [^ true].
self dialog ifNil: [^ false].
self dialog wasEdited ifFalse: [^ false].
^ self confirm: 'You edited some changes. Do you wish to load them into the image?'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessing
workingCopy: aWorkingCopy
super workingCopy: aWorkingCopy.
self
originalHeadCommit: self currentHeadCommit;
doRegularCommit.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"class" : {
},
"instance" : {
"actionLabel" : "mad 10/8/2024 21:21",
"actionLabelInIngForm" : "mad 10/8/2024 21:21",
"alwaysMaterialize" : "mad 10/8/2024 21:22",
"basicCommit" : "mad 10/8/2024 21:14",
"basicRunNow" : "mad 10/8/2024 21:14",
"beforeDialogOpen" : "mad 10/8/2024 21:28",
"checkIsAtOriginalHeadCommit" : "mad 10/8/2024 21:20",
"checkIsMessageEmpty" : "mad 10/8/2024 21:20",
"commit" : "mad 10/8/2024 21:22",
"currentHeadCommit" : "mad 10/8/2024 21:32",
"dialogAction" : "mad 10/8/2024 21:24",
"dialogClass" : "mad 10/9/2024 14:51",
"doAmend" : "mad 10/8/2024 21:31",
"doMerge:" : "mad 10/8/2024 21:31",
"doRegularCommit" : "mad 10/8/2024 21:31",
"initialMessage" : "mad 10/8/2024 21:15",
"initialMessage:" : "mad 10/8/2024 21:22",
"initialize" : "mad 10/8/2024 21:31",
"isAtOriginalHeadCommit" : "mad 10/8/2024 21:30",
"isEmpty" : "mad 10/8/2024 21:12",
"isMerge" : "mad 10/8/2024 21:13",
"isMessageEmpty" : "mad 10/9/2024 14:52",
"materializeIfNecessary" : "mad 10/8/2024 21:14",
"message" : "mad 10/8/2024 21:26",
"nothingToDoMessage" : "mad 10/8/2024 21:13",
"originalHeadCommit" : "mad 10/8/2024 21:16",
"originalHeadCommit:" : "mad 10/8/2024 21:22",
"parents" : "mad 10/8/2024 21:15",
"parents:" : "mad 10/8/2024 21:22",
"shouldAlwaysMaterialize" : "mad 10/8/2024 21:15",
"shouldAlwaysMaterialize:" : "mad 10/8/2024 21:22",
"shouldMaterialize" : "mad 10/8/2024 21:14",
"workingCopy:" : "mad 10/8/2024 21:17" } }
17 changes: 17 additions & 0 deletions src/GitS-Core.package/GSChangesToCommit.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"category" : "GitS-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"initialMessage",
"parents",
"originalHeadCommit",
"shouldAlwaysMaterialize" ],
"name" : "GSChangesToCommit",
"pools" : [
],
"super" : "GSChangesToMaterialize",
"type" : "normal" }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
actionLabel
^ 'Load changes'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
actionLabelInIngForm
^ 'loading changes'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
alwaysOpenDialog
self shouldAlwaysOpenDialog: true.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
actions-private
basicMaterialize
self workingCopy materializeChangeSets: self changeSets.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
actions-private
basicRunNow
self basicMaterialize.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
actions-private
beforeDialogOpen
super beforeDialogOpen.
self dialog addButton: self actionLabel action: [self dialogAction].
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
checking
checkHasConflicts
self hasConflicts ifFalse: [^ false].
self inform: ('There are conflicts. Please resolve them before {1}. Aborting.'
format: {self actionLabelInIngForm}).
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
closeButtonName
^ 'Cancel'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
actions-private
dialogAction
self checkHasConflicts ifTrue: [^ self].
self runNow.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
hasConflicts
^ self changeSets anySatisfy: #hasConflicts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialize-release
initialize
super initialize.
self shouldAlwaysOpenDialog: false.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
actions
materialize
^ self runAs: GSChangesToMaterialize
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
actions-private
materializeNow
self assert: self hasConflicts not.
^ self
basicMaterialize;
done
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
nothingToDoMessage
^ 'No changes to load.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
actions-private
openDialogToMaterialize
^ self openDialogWithAction: [self postDialogMaterialize] doing: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
actions-private
openDialogWithAction: aBlock doing: anotherBlock
^ self openDialogDoing: [self dialog addButton: self actionLabel action: aBlock. anotherBlock value]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
actions-private
runIfNotEmpty
self shouldOpenDialog ifTrue: [^ self openDialog].
^ self runNow
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
actions-private
runNow
^ self
assert: self hasConflicts not;
basicRunNow;
done
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
shouldAlwaysOpenDialog: aBoolean
shouldAlwaysOpenDialog := aBoolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
shouldAlwaysOpenDialog
^ shouldAlwaysOpenDialog
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testing
shouldOpenDialog
self shouldAlwaysOpenDialog ifTrue: [^ true].
^ GSChangeSet anyIncludesConflicts: self changeSets
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
windowTitle
^ self shouldAlwaysOpenDialog
ifTrue: [self basicWindowTitle]
ifFalse: ['Resolve conflicts to ', self basicWindowTitle withFirstCharacterDownshifted]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
workingCopy: aWorkingCopy
workingCopy := aWorkingCopy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
workingCopy
^ workingCopy
Loading

0 comments on commit 4a2db0e

Please sign in to comment.