diff --git a/src/Squot.package/SqueakWorkingCopy.class/instance/basicName..st b/src/Squot.package/SqueakWorkingCopy.class/instance/basicName..st new file mode 100644 index 000000000..473ce5ee7 --- /dev/null +++ b/src/Squot.package/SqueakWorkingCopy.class/instance/basicName..st @@ -0,0 +1,3 @@ +accessing +basicName: aString + name := aString. \ No newline at end of file diff --git a/src/Squot.package/SqueakWorkingCopy.class/instance/name..st b/src/Squot.package/SqueakWorkingCopy.class/instance/name..st index e8cfe90d7..0492e8d0f 100644 --- a/src/Squot.package/SqueakWorkingCopy.class/instance/name..st +++ b/src/Squot.package/SqueakWorkingCopy.class/instance/name..st @@ -1,3 +1,10 @@ accessing name: aString - name := aString \ No newline at end of file + self name = aString ifTrue: [^ self]. + self isRegistered ifFalse: [^ self basicName: aString]. + (self class isNameRegistered: aString) + ifTrue: [^ self error: 'Cannot rename to a name that is already taken.']. + self + unregister; + basicName: aString; + register. \ No newline at end of file diff --git a/src/Squot.package/SqueakWorkingCopy.class/instance/rename.st b/src/Squot.package/SqueakWorkingCopy.class/instance/rename.st new file mode 100644 index 000000000..9319240af --- /dev/null +++ b/src/Squot.package/SqueakWorkingCopy.class/instance/rename.st @@ -0,0 +1,3 @@ +accessing +rename + self name: ((self class requestUnregisteredNameFrom: self name) ifNil: [^ self]). \ 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 1b57f4df6..3697ef82f 100644 --- a/src/Squot.package/SqueakWorkingCopy.class/methodProperties.json +++ b/src/Squot.package/SqueakWorkingCopy.class/methodProperties.json @@ -34,6 +34,7 @@ "allMappers" : "mad 10/21/2023 22:58", "allReferences" : "mad 11/30/2023 21:44", "basicHeadRef" : "mad 11/30/2023 13:15", + "basicName:" : "mad 12/8/2023 17:30", "branchName:" : "mad 6/4/2023 16:09", "branchesBaseName" : "mad 6/4/2023 16:09", "changeSetsFromCommit:toCommit:" : "mad 9/6/2023 19:28", @@ -109,7 +110,7 @@ "mergeCommit:into:withBase:" : "mad 8/23/2023 19:49", "mergeFSCommit:into:withBase:" : "mad 9/20/2023 13:01", "name" : "mad 9/19/2023 11:52", - "name:" : "mad 9/19/2023 11:52", + "name:" : "mad 12/8/2023 17:31", "pushRef:" : "mad 9/18/2023 20:07", "refChanged:" : "mad 9/15/2023 11:05", "refName:" : "mad 6/3/2023 14:17", @@ -124,6 +125,7 @@ "remoteRefName:" : "mad 11/29/2023 16:15", "removeCredentialsFor:" : "mad 10/17/2023 12:01", "removeMapper:" : "mad 9/20/2023 17:30", + "rename" : "mad 12/8/2023 17:33", "repository" : "mad 11/30/2023 17:02", "repositoryExists" : "mad 11/30/2023 17:03", "requestCredentialsFor:ifCanceled:" : "mad 9/18/2023 12:49", diff --git a/src/Squot.package/SquotBrowser.class/instance/actionRenameActiveProject.st b/src/Squot.package/SquotBrowser.class/instance/actionRenameActiveProject.st new file mode 100644 index 000000000..1bda0c7fb --- /dev/null +++ b/src/Squot.package/SquotBrowser.class/instance/actionRenameActiveProject.st @@ -0,0 +1,6 @@ +actions +actionRenameActiveProject + | workingCopy | + workingCopy := self activeWorkingCopyIfNilInformAnd: [^ self]. + workingCopy rename. + self activeWorkingCopy: workingCopy. "gets reset to nil during rename" \ No newline at end of file diff --git a/src/Squot.package/SquotBrowser.class/instance/projectListMenu..st b/src/Squot.package/SquotBrowser.class/instance/projectListMenu..st index 5a4669c58..b48e4b112 100644 --- a/src/Squot.package/SquotBrowser.class/instance/projectListMenu..st +++ b/src/Squot.package/SquotBrowser.class/instance/projectListMenu..st @@ -3,6 +3,7 @@ projectListMenu: aMenu self activeWorkingCopy ifNotNil: [ aMenu target: self; + add: 'Rename this project' action: #actionRenameActiveProject; add: 'Remove this project' action: #actionRemoveActiveProject; add: 'Manage remotes' target: SquotRemotesBrowser diff --git a/src/Squot.package/SquotBrowser.class/methodProperties.json b/src/Squot.package/SquotBrowser.class/methodProperties.json index 89d09e043..ac0e14656 100644 --- a/src/Squot.package/SquotBrowser.class/methodProperties.json +++ b/src/Squot.package/SquotBrowser.class/methodProperties.json @@ -32,6 +32,7 @@ "actionPush:" : "mad 9/26/2023 16:57", "actionRefreshRefList" : "mad 10/24/2023 19:54", "actionRemoveActiveProject" : "mad 9/21/2023 11:55", + "actionRenameActiveProject" : "mad 12/8/2023 18:46", "actionResetToActiveCommit" : "mad 11/29/2023 16:38", "actionResetToActiveCommitAndRestoreIt" : "mad 11/29/2023 16:39", "actionSelfUpdate" : "mad 10/16/2023 23:03", @@ -92,7 +93,7 @@ "openDialogToShowChangeSetsFromCommit:to:" : "mad 10/22/2023 00:56", "openDialogToShowChangeSetsFromImageTo:" : "mad 11/29/2023 16:48", "otherMenu:" : "mad 10/24/2023 17:14", - "projectListMenu:" : "mad 11/3/2023 15:11", + "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",