diff --git a/src/Squot.package/SqueakWorkingCopy.class/instance/requestAndRememberRemoteNameAndRefFor..st b/src/Squot.package/SqueakWorkingCopy.class/instance/requestAndRememberRemoteNameAndRefFor..st new file mode 100644 index 000000000..f90f8513d --- /dev/null +++ b/src/Squot.package/SqueakWorkingCopy.class/instance/requestAndRememberRemoteNameAndRefFor..st @@ -0,0 +1,7 @@ +upstream +requestAndRememberRemoteNameAndRefFor: aString + | remoteNameAndRef | + remoteNameAndRef := self requestRemoteNameAndRefFor: aString. + (UIManager default confirm: 'Remember the remote branch for this branch?') + ifTrue: [self setUpstreamRemoteNameAndRef: remoteNameAndRef for: aString]. + ^ remoteNameAndRef \ No newline at end of file diff --git a/src/Squot.package/SqueakWorkingCopy.class/instance/requestRemoteNameAndRefFor..st b/src/Squot.package/SqueakWorkingCopy.class/instance/requestRemoteNameAndRefFor..st index 70accbe8c..12e11bea9 100644 --- a/src/Squot.package/SqueakWorkingCopy.class/instance/requestRemoteNameAndRefFor..st +++ b/src/Squot.package/SqueakWorkingCopy.class/instance/requestRemoteNameAndRefFor..st @@ -8,6 +8,4 @@ requestRemoteNameAndRefFor: aString initialAnswer: (self initialRemoteRefNameFor: aString). ref isEmptyOrNil ifTrue: [^ nil]. ref := self fsgitRepository expandRemoteRef: ref. - (UIManager default confirm: 'Remember the remote branch for this branch?') - ifTrue: [self setUpstreamRemoteName: remoteName andRef: ref for: aString]. ^ remoteName -> ref \ No newline at end of file diff --git a/src/Squot.package/SqueakWorkingCopy.class/instance/setUpstreamRemoteNameAndRefFor..st b/src/Squot.package/SqueakWorkingCopy.class/instance/setUpstreamRemoteNameAndRefFor..st new file mode 100644 index 000000000..964e26600 --- /dev/null +++ b/src/Squot.package/SqueakWorkingCopy.class/instance/setUpstreamRemoteNameAndRefFor..st @@ -0,0 +1,6 @@ +upstream +setUpstreamRemoteNameAndRefFor: aString + self + setUpstreamRemoteNameAndRef: + ((self requestRemoteNameAndRefFor: aString) ifNil: [^ self]) + for: aString. \ No newline at end of file diff --git a/src/Squot.package/SqueakWorkingCopy.class/instance/upstreamRemoteNameAndRefFor..st b/src/Squot.package/SqueakWorkingCopy.class/instance/upstreamRemoteNameAndRefFor..st index a7a864f04..cf063bec4 100644 --- a/src/Squot.package/SqueakWorkingCopy.class/instance/upstreamRemoteNameAndRefFor..st +++ b/src/Squot.package/SqueakWorkingCopy.class/instance/upstreamRemoteNameAndRefFor..st @@ -1,4 +1,4 @@ upstream upstreamRemoteNameAndRefFor: aString (self isSqueakBranchRef: aString) ifTrue: [^ self upstreamRemoteNameAndRefForBranch: aString]. - ^ self requestRemoteNameAndRefFor: aString \ No newline at end of file + ^ self requestAndRememberRemoteNameAndRefFor: aString \ No newline at end of file diff --git a/src/Squot.package/SqueakWorkingCopy.class/instance/upstreamRemoteNameAndRefForBranch..st b/src/Squot.package/SqueakWorkingCopy.class/instance/upstreamRemoteNameAndRefForBranch..st index d4cd3e844..e2d32a471 100644 --- a/src/Squot.package/SqueakWorkingCopy.class/instance/upstreamRemoteNameAndRefForBranch..st +++ b/src/Squot.package/SqueakWorkingCopy.class/instance/upstreamRemoteNameAndRefForBranch..st @@ -3,5 +3,5 @@ upstreamRemoteNameAndRefForBranch: aString | remoteName ref | remoteName := self unitOfWork upstreamRemoteOfBranchNamed: aString. ref := self unitOfWork upstreamRefOfBranchNamed: aString. - (remoteName isNil or: [ref isNil]) ifTrue: [^ self requestRemoteNameAndRefFor: aString]. + (remoteName isNil or: [ref isNil]) ifTrue: [^ self requestAndRememberRemoteNameAndRefFor: aString]. ^ remoteName -> ref \ No newline at end of file diff --git a/src/Squot.package/SqueakWorkingCopy.class/methodProperties.json b/src/Squot.package/SqueakWorkingCopy.class/methodProperties.json index 933794604..1b545f51b 100644 --- a/src/Squot.package/SqueakWorkingCopy.class/methodProperties.json +++ b/src/Squot.package/SqueakWorkingCopy.class/methodProperties.json @@ -129,12 +129,14 @@ "rename" : "mad 12/8/2023 20:04", "repository" : "mad 11/30/2023 17:02", "repositoryExists" : "mad 11/30/2023 17:03", + "requestAndRememberRemoteNameAndRefFor:" : "mad 12/13/2023 19:00", "requestCredentialsFor:ifCanceled:" : "mad 9/18/2023 12:49", - "requestRemoteNameAndRefFor:" : "mad 9/18/2023 20:04", + "requestRemoteNameAndRefFor:" : "mad 12/13/2023 18:59", "requestUnmappedPathWithTitle:initialAnswer:" : "mad 11/21/2023 14:31", "serializeChangeSets:onCommit:" : "mad 9/20/2023 12:45", "setUpstreamRemoteName:andRef:for:" : "mad 12/13/2023 18:28", "setUpstreamRemoteNameAndRef:for:" : "mad 12/8/2023 19:31", + "setUpstreamRemoteNameAndRefFor:" : "mad 12/13/2023 19:07", "splitRemoteRef:" : "mad 12/8/2023 19:45", "unitOfWork" : "mad 6/3/2023 14:15", "unmappedReferencesIn:do:" : "mad 10/21/2023 23:37", @@ -143,6 +145,6 @@ "updateHeadTo:" : "mad 6/9/2023 18:52", "updateHeadToCommit:" : "mad 6/10/2023 15:00", "updateHeadToRef:" : "mad 9/13/2023 21:36", - "upstreamRemoteNameAndRefFor:" : "mad 9/18/2023 20:01", - "upstreamRemoteNameAndRefForBranch:" : "mad 9/18/2023 20:02", + "upstreamRemoteNameAndRefFor:" : "mad 12/13/2023 19:01", + "upstreamRemoteNameAndRefForBranch:" : "mad 12/13/2023 19:02", "withUnitOfWork:" : "mad 8/31/2023 12:58" } } diff --git a/src/Squot.package/SquotBrowser.class/instance/actionSetUpstreamOfActiveBranch.st b/src/Squot.package/SquotBrowser.class/instance/actionSetUpstreamOfActiveBranch.st new file mode 100644 index 000000000..6a6834fae --- /dev/null +++ b/src/Squot.package/SquotBrowser.class/instance/actionSetUpstreamOfActiveBranch.st @@ -0,0 +1,4 @@ +actions +actionSetUpstreamOfActiveBranch + self activeRef ifNil: [^ self inform: 'Please select a branch first.']. + self activeWorkingCopy setUpstreamRemoteNameAndRefFor: self activeRef. \ No newline at end of file diff --git a/src/Squot.package/SquotBrowser.class/instance/actionUnsetUpstreamOfActiveBranch.st b/src/Squot.package/SquotBrowser.class/instance/actionUnsetUpstreamOfActiveBranch.st new file mode 100644 index 000000000..cc8dc3885 --- /dev/null +++ b/src/Squot.package/SquotBrowser.class/instance/actionUnsetUpstreamOfActiveBranch.st @@ -0,0 +1,4 @@ +actions +actionUnsetUpstreamOfActiveBranch + self activeRef ifNil: [^ self inform: 'Please select a branch first.']. + self unitOfWork unsetUpstreamOfBranchNamed: self activeRef. \ No newline at end of file diff --git a/src/Squot.package/SquotBrowser.class/instance/refListMenu..st b/src/Squot.package/SquotBrowser.class/instance/refListMenu..st index 266916b22..f27a7f54d 100644 --- a/src/Squot.package/SquotBrowser.class/instance/refListMenu..st +++ b/src/Squot.package/SquotBrowser.class/instance/refListMenu..st @@ -8,7 +8,12 @@ refListMenu: aMenu aMenu add: ('Delete this {1}' format: {refTypeName}) action: #actionDeleteActiveRef; addLine. - self commitMenu: aMenu forRef: self activeRef]. + self commitMenu: aMenu forRef: self activeRef. + isBranch ifTrue: [ + aMenu + addLine; + add: 'Set the remote branch of this branch' action: #actionSetUpstreamOfActiveBranch; + add: 'Unset the remote branch of this branch' action: #actionUnsetUpstreamOfActiveBranch]]. aMenu target: self. aMenu hasItems ifTrue: [aMenu addLine]. aMenu diff --git a/src/Squot.package/SquotBrowser.class/methodProperties.json b/src/Squot.package/SquotBrowser.class/methodProperties.json index 715a1f626..299691347 100644 --- a/src/Squot.package/SquotBrowser.class/methodProperties.json +++ b/src/Squot.package/SquotBrowser.class/methodProperties.json @@ -36,10 +36,12 @@ "actionResetToActiveCommit" : "mad 11/29/2023 16:38", "actionResetToActiveCommitAndRestoreIt" : "mad 11/29/2023 16:39", "actionSelfUpdate" : "mad 10/16/2023 23:03", + "actionSetUpstreamOfActiveBranch" : "mad 12/13/2023 19:04", "actionSwitchToActiveBranch" : "mad 11/29/2023 16:34", "actionSwitchToActiveCommit" : "mad 10/22/2023 00:43", "actionSwitchToBranch:" : "mad 11/29/2023 16:35", "actionSwitchToCommit:displayName:updateHeadTo:" : "mad 11/7/2023 15:12", + "actionUnsetUpstreamOfActiveBranch" : "mad 12/13/2023 18:57", "activeCommit" : "mad 9/14/2023 15:24", "activeCommit:" : "mad 9/14/2023 19:26", "activeCommitInfo" : "mad 9/14/2023 19:29", @@ -97,7 +99,7 @@ "projectListMenu:" : "mad 12/8/2023 17:24", "refChanged:" : "mad 9/15/2023 11:04", "refList" : "mad 11/30/2023 21:44", - "refListMenu:" : "mad 11/29/2023 16:16", + "refListMenu:" : "mad 12/13/2023 19:10", "refTypeName:" : "mad 11/29/2023 15:59", "requestBranchNameFor:fromRef:" : "mad 11/29/2023 16:11", "showGitRefs" : "mad 10/16/2023 21:39",