diff --git a/src/FileSystem-Git.package/GitRepository.class/instance/initializeOn..st b/src/FileSystem-Git.package/GitRepository.class/instance/initializeOn..st index a0d8e2ee2..f035b8e73 100644 --- a/src/FileSystem-Git.package/GitRepository.class/instance/initializeOn..st +++ b/src/FileSystem-Git.package/GitRepository.class/instance/initializeOn..st @@ -1,5 +1,3 @@ initialize-release initializeOn: anFSReference - reference := anFSReference. - self initializeCache. - self gitInitialize \ No newline at end of file + self workingDir: anFSReference. \ No newline at end of file diff --git a/src/FileSystem-Git.package/GitRepository.class/instance/workingDir..st b/src/FileSystem-Git.package/GitRepository.class/instance/workingDir..st new file mode 100644 index 000000000..019076211 --- /dev/null +++ b/src/FileSystem-Git.package/GitRepository.class/instance/workingDir..st @@ -0,0 +1,5 @@ +accessing +workingDir: anFSReference + reference := anFSReference. + self initializeCache. + self gitInitialize \ No newline at end of file diff --git a/src/FileSystem-Git.package/GitRepository.class/methodProperties.json b/src/FileSystem-Git.package/GitRepository.class/methodProperties.json index de2fb3cc4..3d766a036 100644 --- a/src/FileSystem-Git.package/GitRepository.class/methodProperties.json +++ b/src/FileSystem-Git.package/GitRepository.class/methodProperties.json @@ -26,7 +26,7 @@ "headsDir" : "CamilloBruni 8/9/2011 17:41", "initializeCache" : "jr 3/10/2020 21:22", "initializeHEAD" : "CamilloBruni 9/2/2012 11:47", - "initializeOn:" : "jr 3/22/2017 15:12", + "initializeOn:" : "ct 10/4/2022 20:16", "isInitialized" : "CamilloBruni 9/2/2012 11:33", "nameOf:in:" : "jr 11/23/2016 18:22", "newUnitOfWork" : "jr 4/20/2020 21:21", @@ -41,4 +41,5 @@ "unitOfWork" : "jr 2/29/2020 20:23", "validateReferenceOrReferenceName:" : "pre 11/14/2018 16:50", "withUnitOfWork:" : "jr 8/8/2020 16:30", - "workingDir" : "MaxLeske 6/24/2012 11:37" } } + "workingDir" : "MaxLeske 6/24/2012 11:37", + "workingDir:" : "ct 10/4/2022 20:16" } } diff --git a/src/Squit.package/SquitBrowser.class/instance/actionProjectChangeDirectory.st b/src/Squit.package/SquitBrowser.class/instance/actionProjectChangeDirectory.st new file mode 100644 index 000000000..d6d48a3e7 --- /dev/null +++ b/src/Squit.package/SquitBrowser.class/instance/actionProjectChangeDirectory.st @@ -0,0 +1,11 @@ +actions on working copies +actionProjectChangeDirectory + | workingCopy directory gitRepository | + workingCopy := self projectSelection. + gitRepository := workingCopy repository gitRepository. + directory := SquotGUI + chooseDirectory: 'Repository directory' + from: (FileDirectory on: gitRepository workingDir pathName). + directory ifNil: [^ self]. + gitRepository workingDir: (FileSystem disk root resolve: directory pathName). + self updateProjectSelection. \ No newline at end of file diff --git a/src/Squit.package/SquitBrowser.class/instance/buildProjectList..st b/src/Squit.package/SquitBrowser.class/instance/buildProjectList..st index 7f056f36f..4b632acb0 100644 --- a/src/Squit.package/SquitBrowser.class/instance/buildProjectList..st +++ b/src/Squit.package/SquitBrowser.class/instance/buildProjectList..st @@ -8,5 +8,5 @@ buildProjectList: builder dragItem: #dragFromProjectList:; dropAccept: #wantsProjectListDrop:type:from:; dropItem: #dropOnProjectList:at:copyIndicated:; - menu: #projectListMenu:; + menu: #projectListMenu:shifted:; frame: (0@0 corner: 1@0.5) \ No newline at end of file diff --git a/src/Squit.package/SquitBrowser.class/instance/menuProjectListWorkingCopyHook..st b/src/Squit.package/SquitBrowser.class/instance/menuProjectListWorkingCopyHook.shifted..st similarity index 63% rename from src/Squit.package/SquitBrowser.class/instance/menuProjectListWorkingCopyHook..st rename to src/Squit.package/SquitBrowser.class/instance/menuProjectListWorkingCopyHook.shifted..st index a8ef498c7..5ceabf9b0 100644 --- a/src/Squit.package/SquitBrowser.class/instance/menuProjectListWorkingCopyHook..st +++ b/src/Squit.package/SquitBrowser.class/instance/menuProjectListWorkingCopyHook.shifted..st @@ -1,13 +1,15 @@ ui menu -menuProjectListWorkingCopyHook: aMenu +menuProjectListWorkingCopyHook: aMenu shifted: shifted self projectSelection ifNil: [^ aMenu]. - aMenu addTitle: 'Working copy of ', self projectSelection name. - aMenu addList: { - {'Rename project'. #actionProjectRename}. - {'Remove project'. #actionProjectRemove}. - }. + aMenu addTitle: ('Working copy of {1}' format: {self projectSelection name}). + aMenu add: 'Rename project' action: #actionProjectRename. + (shifted or: [self projectSelection repository exists not]) ifTrue: + [aMenu addList: { + {'Change project directory'. #actionProjectChangeDirectory. 'Assign this project to a different directory. This does NOT move the existing repository to another location.'} + }]. + aMenu add: 'Remove project' action: #actionProjectRemove. aMenu addLine. aMenu addList: { diff --git a/src/Squit.package/SquitBrowser.class/instance/projectIndex..st b/src/Squit.package/SquitBrowser.class/instance/projectIndex..st index 390344688..a4aede43f 100644 --- a/src/Squit.package/SquitBrowser.class/instance/projectIndex..st +++ b/src/Squit.package/SquitBrowser.class/instance/projectIndex..st @@ -2,11 +2,4 @@ ui projectIndex: anIndex anIndex > 1 ifFalse: [^ self]. projectIndex := anIndex. - repositoryExists := self projectSelection repository exists. - selectedHistorian := self projectSelection loadedHistorian. - self changed: #branchSelection. - commitSelection := nil. - commitToDiffAgainst := nil. - cachedCommitList := #(). - repositoryExists ifFalse: [self informThatProjectDoesNotExist]. - self refresh. \ No newline at end of file + self updateProjectSelection. \ No newline at end of file diff --git a/src/Squit.package/SquitBrowser.class/instance/projectListMenu..st b/src/Squit.package/SquitBrowser.class/instance/projectListMenu..st deleted file mode 100644 index aa04d80f5..000000000 --- a/src/Squit.package/SquitBrowser.class/instance/projectListMenu..st +++ /dev/null @@ -1,3 +0,0 @@ -ui menu -projectListMenu: aMenu - ^ self menu: aMenu for: #(menuProjectList) \ No newline at end of file diff --git a/src/Squit.package/SquitBrowser.class/instance/projectListMenu.shifted..st b/src/Squit.package/SquitBrowser.class/instance/projectListMenu.shifted..st new file mode 100644 index 000000000..e5e222798 --- /dev/null +++ b/src/Squit.package/SquitBrowser.class/instance/projectListMenu.shifted..st @@ -0,0 +1,3 @@ +ui menu +projectListMenu: aMenu shifted: aBoolean + ^ self menu: aMenu for: #(menuProjectList) shifted: aBoolean \ No newline at end of file diff --git a/src/Squit.package/SquitBrowser.class/instance/updateProjectSelection.st b/src/Squit.package/SquitBrowser.class/instance/updateProjectSelection.st new file mode 100644 index 000000000..a8f7560a5 --- /dev/null +++ b/src/Squit.package/SquitBrowser.class/instance/updateProjectSelection.st @@ -0,0 +1,10 @@ +ui +updateProjectSelection + repositoryExists := self projectSelection repository exists. + selectedHistorian := self projectSelection loadedHistorian. + self changed: #branchSelection. + commitSelection := nil. + commitToDiffAgainst := nil. + cachedCommitList := #(). + repositoryExists ifFalse: [self informThatProjectDoesNotExist]. + self refresh. \ No newline at end of file diff --git a/src/Squit.package/SquitBrowser.class/methodProperties.json b/src/Squit.package/SquitBrowser.class/methodProperties.json index 301065b9f..9cfb115bb 100644 --- a/src/Squit.package/SquitBrowser.class/methodProperties.json +++ b/src/Squit.package/SquitBrowser.class/methodProperties.json @@ -61,6 +61,7 @@ "actionPackageInfoObjectEditPreamble" : "jr 5/13/2017 21:16", "actionPackageInfoObjectEditPreambleOfRemoval" : "jr 5/13/2017 21:16", "actionProjectAdd" : "jr 5/11/2017 14:09", + "actionProjectChangeDirectory" : "ct 5/2/2024 19:05", "actionProjectClone" : "jr 8/8/2020 00:31", "actionProjectRemove" : "jr 8/10/2020 00:29", "actionProjectRename" : "jr 7/24/2020 11:33", @@ -92,7 +93,7 @@ "buildMenu:from:" : "jr 6/30/2017 22:48", "buildObjectList:" : "jr 2/8/2020 23:47", "buildProjectBranchPanel:" : "jr 12/22/2021 12:51", - "buildProjectList:" : "jr 2/8/2020 23:55", + "buildProjectList:" : "ct 10/4/2022 20:28", "buildSearchBar:" : "jr 2/17/2022 23:01", "buildSearchClearButton:" : "jr 2/17/2022 23:03", "buildSearchPanel:" : "jr 2/17/2022 22:36", @@ -154,7 +155,7 @@ "menuObjectListVersionObjectEdition:" : "jr 11/3/2020 14:41", "menuObjectListWorkingCopyObject:" : "jr 11/3/2020 14:45", "menuProjectListHook:" : "jr 10/17/2018 13:31", - "menuProjectListWorkingCopyHook:" : "jr 3/13/2022 17:19", + "menuProjectListWorkingCopyHook:shifted:" : "ct 10/4/2022 20:30", "mergeBranch:into:" : "jr 8/7/2020 18:41", "mergeCommit:into:" : "jr 8/7/2020 18:36", "mergeCommit:into:mergeTitle:saveTitle:saveMessageTemplate:" : "jr 7/2/2022 22:44", @@ -172,9 +173,9 @@ "offerToAddFirstProject" : "fn 4/26/2017 16:04", "packageFormatMenuSpec" : "jr 8/31/2020 22:27", "projectIndex" : "jr 8/10/2020 00:19", - "projectIndex:" : "jr 7/9/2022 09:37", + "projectIndex:" : "ct 5/2/2024 19:05", "projectList" : "fn 4/11/2017 11:48", - "projectListMenu:" : "fn 4/11/2017 15:38", + "projectListMenu:shifted:" : "ct 5/2/2024 19:09", "projectSelection" : "fn 4/11/2017 17:12", "projectSelection:" : "jr 3/13/2022 18:05", "projectsWithRepository:do:" : "jr 3/13/2022 18:00", @@ -209,6 +210,7 @@ "timeOfLastListUpdate" : "fn 4/11/2017 18:00", "toggleMetadata" : "jr 3/17/2019 22:07", "updateHistorianDecorationsMap" : "jr 7/2/2022 21:56", + "updateProjectSelection" : "ct 5/2/2024 19:05", "wantsBranchListDrop:type:from:" : "jr 5/9/2020 14:30", "wantsCommitListDrop:type:from:" : "jr 5/9/2020 14:44", "wantsObjectListDrop:type:from:" : "jr 2/9/2020 00:08",