Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pharo-project/pharo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.0.4
Choose a base ref
...
head repository: pharo-project/pharo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: Pharo7.0
Choose a head ref
  • 18 commits
  • 15 files changed
  • 7 contributors

Commits on Aug 21, 2019

  1. Copy the full SHA
    94204bb View commit details

Commits on Aug 22, 2019

  1. Merge pull request #4378 from MarcusDenker/4282-Backport-Pharo7-tryin…

    …g-to-add-an-ivar-to-UndefinedObject-crashes-the-VM-4017
    
    4282-Backport-Pharo7-trying-to-add-an-ivar-to-UndefinedObject-crashes-the-VM-4017
    MarcusDenker authored Aug 22, 2019
    Copy the full SHA
    a2a2b23 View commit details

Commits on Sep 26, 2019

  1. Copy the full SHA
    890a365 View commit details
  2. Copy the full SHA
    af0b79d View commit details

Commits on Sep 30, 2019

  1. Copy the full SHA
    f850c60 View commit details

Commits on Oct 3, 2019

  1. Merge pull request #4739 from tesonep/backport-fix-in-ZnBufferedReadW…

    …riteStream
    
    Porting a new implementation of ZnBufferedReadWriteStream
    Ducasse authored Oct 3, 2019
    Copy the full SHA
    ccd2a23 View commit details

Commits on Oct 14, 2019

  1. Fixes #4875. Backporting PR #3097 to P7.0.

    Fixed "lost changes detector" and added a test. Also refactored a bit the already present tests.
    tinchodias committed Oct 14, 2019
    Copy the full SHA
    17a1374 View commit details

Commits on Oct 21, 2019

  1. Merge pull request #4908 from tinchodias/4875-Recover-lost-changes-do…

    …es-not-apply-changes-in-right-order
    
    4875-Recover-lost-changes-does-not-apply-changes-in-right-order
    Ducasse authored Oct 21, 2019
    Copy the full SHA
    504f3a5 View commit details

Commits on Oct 29, 2019

  1. - Reverting ZnBufferedReadWrite

    - Moving new implementation to SourceFiles
    - Use the new implementation only in SourceFiles
    tesonep committed Oct 29, 2019
    Copy the full SHA
    dda62d1 View commit details
  2. Removing old methods

    tesonep committed Oct 29, 2019
    Copy the full SHA
    5cba44a View commit details
  3. Merge pull request #5030 from tesonep/4764-Change-is-ZnBuffered-are-b…

    …reaking-something-
    
    4764-Change-is-ZnBuffered-are-breaking-something-
    tesonep authored Oct 29, 2019
    Copy the full SHA
    ecc855d View commit details

Commits on Nov 7, 2019

  1. This is fixing a bug while loading code.

    In Pharo 7, the loading of code is using a cache for MCDefinitions. 
    When you create a new definition, it checks if one equivalent was already created, if yes, it return this one.
    
    The equality of MCClassTraitDefinition does not take the category into account and I got bug while loading code because the MCClassTraitDefinition was wrong because it found one with another category.
    jecisc committed Nov 7, 2019
    Copy the full SHA
    cca78ad View commit details
  2. Add byteAt: as alias to digitAt: to Integer in Pharo 7 to support for…

    …ward compatibility with Pharo 8
    
    #5077
    Sven Van Caekenberghe committed Nov 7, 2019
    Copy the full SHA
    24bc6c6 View commit details
  3. Merge pull request #5079 from svenvc/5077-Add-byteAt-as-alias-to-digi…

    …tAt-to-Integer-in-Pharo-7-to-support-forward-compatibility-with-Pharo-8
    
    5077-Add-byteAt-as-alias-to-digitAt-to-Integer-in-Pharo-7-to-support-forward-compatibility-with-Pharo-8
    MarcusDenker authored Nov 7, 2019
    Copy the full SHA
    a39728a View commit details

Commits on Nov 8, 2019

  1. Add guard

    jecisc authored Nov 8, 2019
    Copy the full SHA
    8447cbc View commit details

Commits on Nov 12, 2019

  1. Copy the full SHA
    795385e View commit details

Commits on Nov 20, 2019

  1. Merge pull request #5122 from noha/fix-nextVersion-for-basenames

    Backport - Fix nextVersion for cases where an entry with basename only exists in…
    MarcusDenker authored Nov 20, 2019
    Copy the full SHA
    1d40ea7 View commit details

Commits on Nov 23, 2019

  1. Merge pull request #5075 from jecisc/Backport-5072-MCClassTraitDefini…

    …tion-should-take-category-into-account-for-equality
    
    Backport-5072-MCClassTraitDefinition-should-take-category-into-account-for-equality
    Ducasse authored Nov 23, 2019
    Copy the full SHA
    fd8c156 View commit details
70 changes: 65 additions & 5 deletions src/EpiceaBrowsers-Tests/EpLostChangesDetectorTest.class.st
Original file line number Diff line number Diff line change
@@ -12,25 +12,40 @@ Class {

{ #category : #tests }
EpLostChangesDetectorTest >> testDetectInEmptyLog [

detector := EpLostChangesDetector newWithLog: monitor log.
self deny: detector hasLostChanges.
self assert: detector lostChanges isEmpty.

self assert: monitor log entries isEmpty. "Just to be sure of the assumed precondition"

self assert: monitor log entries isEmpty
]

{ #category : #tests }
EpLostChangesDetectorTest >> testDetectNoChange [

classFactory newClass.
monitor log store flush.
detector := EpLostChangesDetector newWithLog: monitor log.
self deny: detector hasLostChanges.
self assert: detector lostChanges isEmpty.

self assert: monitor log entriesCount equals: 2. "Just to be sure of the assumed precondition: category and only one class created"
self assert: monitor log entriesCount equals: 2 "Just to be sure of the assumed precondition: category and only one class created"
]

{ #category : #tests }
EpLostChangesDetectorTest >> testDetectNoChangeBecauseLogFileWasDeleted [

| logWithALostChange |
"Build a fake log with a lost change"
classFactory newClass.
logWithALostChange := EpLog newWithStore: monitor sessionStore store flush copyReopened refresh.
classFactory newClass.
monitor sessionStore flush.

"Delete the file"
monitor sessionStore store ensureDeleteFile.

detector := EpLostChangesDetector newWithLog: logWithALostChange.
self deny: detector hasLostChanges.
self assert: detector lostChanges isEmpty.

]

@@ -69,3 +84,48 @@ EpLostChangesDetectorTest >> testDetectOneChangeButFileDeleted [
self assert: detector lostChanges isEmpty.

]

{ #category : #tests }
EpLostChangesDetectorTest >> testDetectOneChangeDetectedAndOneIgnored [

| logWithALostChange |
"Create an initial change that will be ignored by the detector (read below)"
classFactory newClass.

"Simulate the image session starts here (then previous change shouldn't be detected as lost... that's how it works)."
logWithALostChange := EpLog newWithStore: monitor sessionStore store flush copyReopened refresh.
classFactory newClass.
monitor sessionStore flush.

"At this moment, the log meets the conditions of opening an image after a crash."
detector := EpLostChangesDetector newWithLog: logWithALostChange.

self assert: detector hasLostChanges.
self assert: detector lostChanges size equals: 1.
self assert: monitor log entriesCount > 1. "Just to ensure assumptions of this test"

]

{ #category : #tests }
EpLostChangesDetectorTest >> testDetectThreeChanges [

| logWithLostChanges numberOfLostChanges expectedLostClassNames detectedLostChanges |

"Build a log with several lost changes (class additions)"
numberOfLostChanges := 3.
logWithLostChanges := EpLog newWithStore: monitor sessionStore store flush copyReopened refresh.
expectedLostClassNames := (1 to: numberOfLostChanges) collect: [ :each | classFactory newClass name ] as: Array.
monitor sessionStore flush.

"At this moment, the log meets the conditions of opening an image after a crash."
detector := EpLostChangesDetector newWithLog: logWithLostChanges.

detectedLostChanges := detector lostChanges.
detectedLostChanges do: [ :each | self assert: each content isEpClassChange ].

self assert: detectedLostChanges size equals: numberOfLostChanges.
self
assert: (detectedLostChanges collect: [ :each | each content behaviorAffectedName ]) asArray
equals: expectedLostClassNames.

]
2 changes: 1 addition & 1 deletion src/EpiceaBrowsers/EpLostChangesDetector.class.st
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ EpLostChangesDetector >> lostChanges [
"Then, there are lost events"
entries := freshLog priorEntriesFrom: freshLog headReference upTo: lastSessionHeadReference.

^ entries ifNotEmpty: [ entries allButLast "reject lastSessionHeadReference's change"]
^ entries ifNotEmpty: [ entries allButLast reversed ]
]

{ #category : #accessing }
10 changes: 9 additions & 1 deletion src/FileSystem-Core/FileReference.class.st
Original file line number Diff line number Diff line change
@@ -366,7 +366,8 @@ FileReference >> nextVersion [
parent := self parent.
nameWithoutExtension := self basename copyUpTo: $..

versionNumbers := parent children
"Check for filenames with the assumption it consists at least of basename and a single dot"
versionNumbers := (parent childrenMatching: nameWithoutExtension, '.*')
select: [ :f|
(f basename beginsWith: nameWithoutExtension) ]
thenCollect: [ :f|
@@ -465,6 +466,13 @@ FileReference >> size [
^ filesystem sizeOf: path
]

{ #category : #streams }
FileReference >> unbufferedBinaryWriteStream [
"Answer a binary read/write stream on the receiver"

^ filesystem binaryWriteStreamOn: self path
]

{ #category : #streams }
FileReference >> writeStream [

12 changes: 12 additions & 0 deletions src/FileSystem-Memory/MemoryFileWriteStream.class.st
Original file line number Diff line number Diff line change
@@ -46,6 +46,12 @@ MemoryFileWriteStream >> isBinary [
^ self stream isBinary
]

{ #category : #writing }
MemoryFileWriteStream >> next: numberOfElements putAll: aCollection startingAt: startingAt [

^ stream next: numberOfElements putAll: aCollection startingAt: startingAt
]

{ #category : #writing }
MemoryFileWriteStream >> nextPut: aCollection [
^ self stream nextPut: aCollection
@@ -61,6 +67,12 @@ MemoryFileWriteStream >> position [
^ self stream position
]

{ #category : #position }
MemoryFileWriteStream >> position: aPosition [

stream position: aPosition
]

{ #category : #positioning }
MemoryFileWriteStream >> setToEnd [
^ self stream setToEnd
7 changes: 7 additions & 0 deletions src/Kernel/Integer.class.st
Original file line number Diff line number Diff line change
@@ -567,6 +567,13 @@ Integer >> bitXor: n [
length: (self digitLength max: norm digitLength)
]

{ #category : #'system primitives' }
Integer >> byteAt: index [
"Alias to support forward compatibility with Pharo 8"

^ self digitAt: index
]

{ #category : #'truncation and round off' }
Integer >> ceiling [
"Refer to the comment in Number|ceiling."
13 changes: 6 additions & 7 deletions src/Monticello/MCClassTraitDefinition.class.st
Original file line number Diff line number Diff line change
@@ -28,11 +28,10 @@ MCClassTraitDefinition class >> baseTraitName: aString classTraitComposition: cl

{ #category : #comparing }
MCClassTraitDefinition >> = aDefinition [
^ (super = aDefinition)
and: [baseTrait = aDefinition baseTrait
and: [self classTraitCompositionString = aDefinition classTraitCompositionString]]


^ super = aDefinition
and: [ baseTrait = aDefinition baseTrait
and: [ self classTraitCompositionString = aDefinition classTraitCompositionString
and: [ category = aDefinition category ] ] ]
]

{ #category : #visiting }
@@ -91,8 +90,8 @@ MCClassTraitDefinition >> hash [
| hash |
hash := String stringHash: baseTrait initialHash: 0.
hash := String stringHash: self classTraitCompositionString initialHash: hash.
^hash

category ifNotNil: [ :cat | hash := String stringHash: cat initialHash: hash ].
^ hash
]

{ #category : #initialization }
2 changes: 2 additions & 0 deletions src/Shift-ClassBuilder/DangerousClassNotifier.class.st
Original file line number Diff line number Diff line change
@@ -93,5 +93,7 @@ DangerousClassNotifier class >> tooDangerousClasses [
#ProtoObject #Object
"Contexts and their superclasses"
#InstructionStream #Context #BlockClosure #CompiledMethod #CompiledCode #CompiledBlock
"UndefinedObject crashes the VM"
#UndefinedObject
)
]
10 changes: 6 additions & 4 deletions src/System-Sources/SourceFile.class.st
Original file line number Diff line number Diff line change
@@ -241,14 +241,16 @@ SourceFile >> tryOpenReadOnly: readOnly [
readOnly ifFalse: [
potentialLocations
do: [ :each |
[ stream := ZnCharacterReadWriteStream
on: (each asFileReference / basename) binaryReadWriteStream
[ stream := SourceFileCharacterReadWriteStream
on: (SourceFileBufferedReadWriteStream on:(each asFileReference / basename) unbufferedBinaryWriteStream)
encoding: 'utf8'.
^ self ] on: Error do: [ ] ] ].

potentialLocations do: [ :each |
[ stream := (each asFileReference / basename) readStream.
^ self ] on: Error do: [ ] ]
[ stream := ZnCharacterReadStream
on: (each asFileReference / basename) binaryReadStream
encoding: 'utf8'.
^ self ] on: Error do: [ ] ]
]

{ #category : #accessing }
Loading