From cbb836a4f4cac1ee777c065346fafbee8ea0eba4 Mon Sep 17 00:00:00 2001 From: Guille Polito Date: Thu, 2 Aug 2018 15:30:42 +0200 Subject: [PATCH] Fix #932 Fix update pharo repository in case of locating already cloned repository --- .../IceMemoryProject.class/instance/refresh.st | 4 ---- .../instance/updateLocation..st | 5 ++--- .../IceAbstractProject.class/instance/refresh.st | 4 ---- .../IceWorkingCopy.class/instance/adoptCommit..st | 8 +++++++- .../IceWorkingCopy.class/instance/refreshProject.st | 1 - 5 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 Iceberg-Memory.package/IceMemoryProject.class/instance/refresh.st delete mode 100644 Iceberg.package/IceAbstractProject.class/instance/refresh.st diff --git a/Iceberg-Memory.package/IceMemoryProject.class/instance/refresh.st b/Iceberg-Memory.package/IceMemoryProject.class/instance/refresh.st deleted file mode 100644 index 1a9afa6f42..0000000000 --- a/Iceberg-Memory.package/IceMemoryProject.class/instance/refresh.st +++ /dev/null @@ -1,4 +0,0 @@ -refreshing -refresh - - "Nothing" \ No newline at end of file diff --git a/Iceberg-TipUI.package/IceTipRepositoryModel.class/instance/updateLocation..st b/Iceberg-TipUI.package/IceTipRepositoryModel.class/instance/updateLocation..st index 1c8d1b2a01..78abaa7d1b 100644 --- a/Iceberg-TipUI.package/IceTipRepositoryModel.class/instance/updateLocation..st +++ b/Iceberg-TipUI.package/IceTipRepositoryModel.class/instance/updateLocation..st @@ -3,7 +3,6 @@ updateLocation: aReference "change location" self entity location: aReference. - "force refresh packages" - self entity workingCopy project: self entity project. - + self entity postFetch. + Iceberg announcer announce: (IceRepositoryModified for: self entity) \ No newline at end of file diff --git a/Iceberg.package/IceAbstractProject.class/instance/refresh.st b/Iceberg.package/IceAbstractProject.class/instance/refresh.st deleted file mode 100644 index aeed9a3f84..0000000000 --- a/Iceberg.package/IceAbstractProject.class/instance/refresh.st +++ /dev/null @@ -1,4 +0,0 @@ -refreshing -refresh - - "Nothing for now..." \ No newline at end of file diff --git a/Iceberg.package/IceWorkingCopy.class/instance/adoptCommit..st b/Iceberg.package/IceWorkingCopy.class/instance/adoptCommit..st index 9653169bac..8e48ec7122 100644 --- a/Iceberg.package/IceWorkingCopy.class/instance/adoptCommit..st +++ b/Iceberg.package/IceWorkingCopy.class/instance/adoptCommit..st @@ -1,8 +1,14 @@ accessing adoptCommit: aCommit + | oldCommit | self referenceCommit = aCommit ifTrue: [ ^ self ]. + oldCommit := self referenceCommit. self referenceCommit: aCommit. - self forceCalculateDirtyPackages. \ No newline at end of file + + "If both commits are from a different class but still have the same ID, we do not need to force the calculation of dirty packages. + This is required for the case when a working copy existed with an unknown comit but it was not linked to a repository" + (oldCommit id = aCommit id) + ifFalse: [ self forceCalculateDirtyPackages. ] \ No newline at end of file diff --git a/Iceberg.package/IceWorkingCopy.class/instance/refreshProject.st b/Iceberg.package/IceWorkingCopy.class/instance/refreshProject.st index ffc1ad6e7e..be3790aeac 100644 --- a/Iceberg.package/IceWorkingCopy.class/instance/refreshProject.st +++ b/Iceberg.package/IceWorkingCopy.class/instance/refreshProject.st @@ -1,6 +1,5 @@ private-project refreshProject - project refresh. repository commitsInPackageCache: nil. self refreshPackages \ No newline at end of file