Skip to content

Commit

Permalink
WIP: add SquotPendingChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDoe committed Oct 8, 2024
1 parent 6cbb37e commit bc02589
Show file tree
Hide file tree
Showing 77 changed files with 370 additions and 41 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
actions
actionChooseNewRepositoryLocationForActiveProject
(self activeWorkingCopyIfNilInformAnd: [^ self]) requestAndMoveToNewRepositoryLocation.
self everythingChanged.
self workingCopyAction: [:workingCopy |
workingCopy requestAndMoveToNewRepositoryLocation.
self everythingChanged].
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
actions
actionCommit
self activeWorkingCopyIfNilInformAnd: [^ self].
self openDialogToCommitImageWithInitialMessage: ''.
self workingCopyAction: #openDialogToCommitImage.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
actions
workingCopyAction: aBlock
self activeWorkingCopy ifNil: [
self inform: 'Please select a project first.'.
^ self].
aBlock value: self activeWorkingCopy.
10 changes: 4 additions & 6 deletions src/Squot-Core.package/SquotBrowser.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
"unload" : "mad 9/26/2023 15:50",
"unregisterFromWorldMenu" : "mad 9/19/2023 13:45" },
"instance" : {
"actionCherryPick:" : "mad 4/5/2024 00:37",
"actionChooseNewRepositoryLocationForActiveProject" : "mad 12/22/2023 18:15",
"actionChooseNewRepositoryLocationForActiveProject" : "mad 10/7/2024 22:56",
"actionCloneProject" : "mad 10/6/2024 20:42",
"actionCommit" : "mad 4/5/2024 15:21",
"actionCommit" : "mad 10/7/2024 19:52",
"actionCompareActiveCommitToImage" : "mad 4/5/2024 19:07",
"actionCompareActiveCommitToParent" : "mad 4/5/2024 19:07",
"actionCompareCommitToImage:" : "mad 4/5/2024 19:00",
Expand Down Expand Up @@ -129,9 +128,7 @@
"newProject:" : "mad 3/19/2024 21:29",
"onConflictOpenDialogToMaterializeChangeSets:windowTitle:" : "mad 4/10/2024 16:16",
"open" : "mad 8/30/2023 17:41",
"openDialogToCommitChangeSets:initialMessage:" : "mad 4/5/2024 15:17",
"openDialogToCommitChangeSets:windowTitle:initialMessage:additionalParents:onlyAdditionalParents:materializeChangeSets:" : "mad 4/5/2024 01:20",
"openDialogToCommitImageWithInitialMessage:" : "mad 4/5/2024 15:20",
"openDialogToMaterializeChangeSets:windowTitle:" : "mad 10/24/2023 16:22",
"openDialogToMaterializeCommit:" : "mad 10/24/2023 17:36",
"openDialogToMaterializeCommit:displayName:windowTitlePrefix:" : "mad 8/13/2024 17:56",
Expand Down Expand Up @@ -160,4 +157,5 @@
"validateDialogState:andOriginalHeadCommit:before:" : "mad 9/19/2023 12:37",
"warnIfImageNotClean:" : "mad 11/7/2023 15:24",
"windowTitle" : "mad 10/18/2023 15:14",
"withUnitOfWork:" : "mad 9/19/2023 12:37" } }
"withUnitOfWork:" : "mad 9/19/2023 12:37",
"workingCopyAction:" : "mad 10/7/2024 19:52" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
git-operations
cherryPick: aCommit
^ (self pendingChangeSetsForPick: aCommit)
prefixWindowTitle: 'Cherry-pick ';
initialMessage: aCommit message;
commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dialog
openDialogToCommitImage
^ self openDialogToCommitImageWithInitialMessage: ''
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dialog
openDialogToCommitImageWithInitialMessage: aString
^ (self pendingChangeSetsToCommit: self changeSetsFromHeadCommitToImage)
initialMessage: aString;
alwaysOpenDialog;
commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pending-changes
pendingChangeSets: aCollection
^ self pendingChanges
changeSets: aCollection;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pending-changes
pendingChangeSetsForPick: aCommit
^ (self pendingChangeSets:
(self
changeSetsToMergeCommitIntoHead: aCommit
withBase: (self parentForPick: aCommit)))
windowTitle: aCommit showOneLine;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pending-changes
pendingChangeSetsForPick: aCommit
windowTitlePrefix: aString
^ (self pendingChangeSets: (self
changeSetsToMergeCommitIntoHead: aCommit
withBase: (self parentForPick: aCommit)))
windowTitle: ('{1} {2}' format: {aString. aCommit showOneLine});
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pending-changes
pendingChangeSetsToCommit: aCollection
^ (self pendingChangeSets: aCollection)
windowTitle: 'Changes to commit';
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pending-changes
pendingChanges
^ SquotPendingChanges new
workingCopy: self;
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"checkForMissingHead" : "mad 3/19/2024 21:45",
"checkRefExists:displayName:" : "mad 10/16/2023 21:31",
"checkoutReflogMessageTo:" : "mad 11/30/2023 13:19",
"cherryPick:" : "mad 10/7/2024 22:54",
"chooseRemoteName" : "mad 10/16/2023 20:48",
"clearLastImageHashForMigration" : "mad 11/29/2023 15:08",
"cloneFrom:" : "mad 5/23/2024 21:00",
Expand Down Expand Up @@ -97,6 +98,13 @@
"materializeCommit:" : "mad 9/6/2023 19:27",
"materializeHead" : "mad 8/24/2023 23:49",
"moveToNewRepositoryLocation:" : "mad 12/22/2023 17:50",
"openDialogToCommitImage" : "mad 10/7/2024 19:46",
"openDialogToCommitImageWithInitialMessage:" : "mad 10/7/2024 19:46",
"pendingChangeSets:" : "mad 10/7/2024 19:36",
"pendingChangeSetsForPick:" : "mad 10/7/2024 22:54",
"pendingChangeSetsForPick:windowTitlePrefix:" : "mad 10/7/2024 19:59",
"pendingChangeSetsToCommit:" : "mad 10/7/2024 19:46",
"pendingChanges" : "mad 10/7/2024 19:36",
"pushRef:force:" : "mad 5/18/2024 11:31",
"refChanged:" : "mad 5/15/2024 21:20",
"refName:" : "mad 6/3/2023 14:17",
Expand Down
Empty file.
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,3 @@
accessing
alwaysOpenDialog
self shouldAlwaysOpenDialog: 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,3 @@
actions-private
basicMaterialize
self workingCopy materializeChangeSets: self changeSets.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
basicWindowTitle
^ windowTitle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
changeSets: aCollection
changeSets := aCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
changeSets
^ changeSets
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
checks
checkHasConflictsWhile: aString
self hasConflicts ifFalse: [^ false].
self inform: ('There are conflicts. Please resolve them before {1}. Aborting.' format: {aString}).
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
checks
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 @@
checks
checkIsMessageEmpty
self isMessageEmpty ifFalse: [^ false].
self inform: 'Empty message, aborting.'.
^ true
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
actions
commit
(self isMerge not and: [self isEmpty]) ifTrue: [^ self nothingToCommit].
self shouldOpenDialog ifTrue: [^ self openDialogToCommit].
^ self commitNow
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
commitActionName
^ self isMerge ifTrue: ['merging'] ifFalse: ['committing']
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
commitButtonLabel
^ self isMerge ifTrue: ['Merge'] ifFalse: ['Commit']
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
actions-private
commitNow
^ self
basicCommit;
materializeIfNecessary;
done
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,3 @@
accessing
dialog: aChangesDialog
dialog := aChangesDialog
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
dialog
^ dialog
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,5 @@
actions-private
done
self dialog ifNotNil: #close.
self promise resolveWith: nil.
^ self promise
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,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,6 @@
initialize-release
initialize
super initialize.
self
shouldAlwaysOpenDialog: false;
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
isMerge
^ self parents size > 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
actions
materialize
self isEmpty ifTrue: [^ self nothingToMaterialize].
self shouldOpenDialog ifTrue: [^ self openDialogToMaterialize].
^ self materializeNow
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,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
message
^ self dialog ifNotNil: #message ifNil: [self initialMessage]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
actions-private
nothingToCommit
self inform: 'Nothing to commit.'.
^ self done
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
actions-private
nothingToMaterialize
self inform: 'No changes to load.'.
^ self done
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
actions-private
openDialog: aChangesDialogClass action: aBlock label: aString
self dialog: (aChangesDialogClass onChangeSets: self changeSets).
self dialog
windowTitle: self windowTitle;
addCloseButton: 'Cancel';
addButton: aString action: aBlock;
open.
^ self promise
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
actions-private
openDialogToCommit
self
openDialog: SquotChangesDialogWithMessage
action: [self postDialogCommit]
label: self commitButtonLabel.
self dialog message: self initialMessage.
^ self promise
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
actions-private
openDialogToMaterialize
^ self
openDialog: SquotChangesDialog
action: [self postDialogMaterialize]
label: 'Load changes'.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
originalHeadCommit: aCommit
originalHeadCommit := aCommit
Loading

0 comments on commit bc02589

Please sign in to comment.