Skip to content

Commit

Permalink
Use a ChangeListItemBuilder to fill the changeList and to determine c…
Browse files Browse the repository at this point in the history
…ategories and descriptions
  • Loading branch information
Abdullatif Ghajar committed Jun 17, 2021
1 parent 1223a5b commit 57ae6a7
Show file tree
Hide file tree
Showing 73 changed files with 168 additions and 237 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ getChangeListItemsFrom: anOrderedCollectionOfChangeRecords

^ (anOrderedCollectionOfChangeRecords
reject: [:each | each isMisc])
collect: [:each | CRChangeListItem new changeRecord: each]
collect: [:each | CRChangeListItemBuilder newChangeListItemWith: each]
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ initializeChangeListItemsWith: aMultiByteFileStream
changeRecords := self class getChangeRecordsMissingInImageFrom: self usedChangeFile.
self
changeListItems: (self class getChangeListItemsFrom: changeRecords);
removeAllChangeListItemsWithEmptyDescription;
removeAllNonPersistentDoIts;
pickAllChangeListItems

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
initialize-release
removeAllNonPersistentDoIts

self changeListItems:
(self changeListItems reject: [:each | each category = #nonPersistentDoIt])
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ togglePickStatusOfSelectedChangeListItem

self hasSelectedChangeListItem ifFalse: [^ self].

self selectedChangeListItem togglePickStatus.
self selectedChangeListItem toggleIsPicked.
self updateAfterPick
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"defaultBrowserHeight" : "SV 8/7/2020 12:58",
"defaultBrowserWidth" : "SV 8/7/2020 12:58",
"extent" : "SV 8/7/2020 15:37",
"getChangeListItemsFrom:" : "abd 6/11/2021 14:36",
"getChangeListItemsFrom:" : "abd 6/17/2021 11:57",
"getChangeRecordsMissingInImageFrom:" : "abd 6/1/2021 17:26",
"newWith:" : "uh 6/21/2020 21:32",
"numberOfBytesToLoadChangesFrom" : "gf 5/20/2020 10:43",
Expand All @@ -23,7 +23,7 @@
"buildUpperButtonPanelSpecWith:" : "anonym-HPI 5/28/2021 20:24",
"buildWith:" : "anonym-HPI 5/28/2021 20:44",
"buttonHeight" : "gf 7/11/2020 20:48",
"changeDescriptions" : "anonym-HPI 6/14/2021 16:19",
"changeDescriptions" : "abd 6/17/2021 10:30",
"changeListFrame" : "mg 8/6/2020 12:28",
"changeListItems" : "gf 7/10/2020 12:13",
"changeListItems:" : "gf 7/15/2020 10:40",
Expand All @@ -36,7 +36,7 @@
"hasSelectedChangeListItem" : "SV 7/13/2020 16:15",
"hasSelectedMethodChangeListItem" : "JA 5/20/2021 17:16",
"hasValidChangeListSelectionIndex" : "gf 7/10/2020 12:33",
"initializeChangeListItemsWith:" : "anonym-HPI 6/14/2021 17:09",
"initializeChangeListItemsWith:" : "abd 6/17/2021 12:05",
"initializeWith:" : "gf 7/25/2020 21:01",
"isLoadButtonEnabled" : "mg 8/6/2020 11:27",
"isPickButtonEnabled" : "gf 7/25/2020 20:09",
Expand All @@ -52,14 +52,14 @@
"priorSourceOrNil" : "JA 5/20/2021 22:49",
"refreshChangeList" : "gf 7/10/2020 12:22",
"removeAllChangeListItemsExcept:" : "SV 8/5/2020 22:13",
"removeAllChangeListItemsWithEmptyDescription" : "anonym-HPI 6/14/2021 17:11",
"removeAllNonPersistentDoIts" : "abd 6/17/2021 12:10",
"repaintChangeListSelection" : "SV 6/27/2020 19:48",
"selectNextChangeListItem" : "mg 8/6/2020 11:23",
"selectedChangeListItem" : "gf 7/10/2020 12:48",
"selectedClass" : "JA 5/20/2021 22:50",
"selectedMessageName" : "JA 5/20/2021 22:50",
"switchToDetailedView" : "mg 8/6/2020 11:24",
"togglePickStatusOfSelectedChangeListItem" : "mg 8/7/2020 22:33",
"togglePickStatusOfSelectedChangeListItem" : "abd 6/17/2021 13:03",
"updateAfterChangeListChange" : "8/7/2020 22:50:03",
"updateAfterChangeSelection" : "SV 7/13/2020 16:17",
"updateAfterLoadingChanges" : "JA 6/11/2021 10:38",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
category: anObject

category := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
category

^ category
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
description: anObject

description := anObject
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
accessing
description

| plainDescription |
plainDescription := (CRChangeRecordDescriber descriptionFor: self) asText.
self isPicked ifFalse: [self addUnpickedAttributes: plainDescription].
^ plainDescription
^ description

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
accessing
isPicked: aBoolean

isPicked := aBoolean
isPicked := aBoolean.
self refreshDescriptionAppearance
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
text-attributes
refreshDescriptionAppearance

self isPicked
ifTrue: [self showDescriptionAsPicked]
ifFalse: [self showDescriptionAsUnpicked]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
text-attributes
showDescriptionAsPicked

self unpickedAttributes do: [:attribute | self description removeAttribute: attribute]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
text-attributes
showDescriptionAsUnpicked

self unpickedAttributes do: [:attribute | self description addAttribute: attribute]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
actions
togglePickStatus
toggleIsPicked

self isPicked: self isPicked not
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
text-attributes
unpickedAttributes

^ {TextEmphasis italic. TextEmphasis struckOut}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
"newWithRecord:" : "uh 7/2/2020 16:02" },
"instance" : {
"=" : "mg 8/7/2020 22:55",
"addUnpickedAttributes:" : "TS 5/20/2021 11:12",
"category" : "abd 6/17/2021 10:23",
"category:" : "abd 6/17/2021 12:57",
"changeRecord" : "SV 5/29/2020 22:13",
"changeRecord:" : "SV 5/29/2020 22:14",
"description" : "anonym-HPI 6/14/2021 16:02",
"changeRecord:" : "abd 6/17/2021 11:57",
"description" : "abd 6/17/2021 11:25",
"description:" : "abd 6/17/2021 13:02",
"doesNotUnderstand:" : "gf 6/15/2020 23:22",
"hash" : "SV 8/7/2020 22:07",
"initialize" : "gf 7/15/2020 10:48",
"isPicked" : "SV 7/13/2020 16:05",
"isPicked:" : "SV 7/13/2020 16:05",
"isPicked:" : "abd 6/17/2021 11:41",
"pick" : "gf 7/15/2020 10:45",
"togglePickStatus" : "mg 8/7/2020 22:33",
"unpick" : "gf 7/15/2020 10:45" } }
"refreshDescriptionAppearance" : "abd 6/17/2021 11:43",
"showDescriptionAsPicked" : "abd 6/17/2021 13:03",
"showDescriptionAsUnpicked" : "abd 6/17/2021 13:03",
"toggleIsPicked" : "abd 6/17/2021 13:03",
"unpick" : "gf 7/15/2020 10:45",
"unpickedAttributes" : "abd 6/17/2021 12:57" } }
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"commentStamp" : "SV 8/7/2020 23:43",
"instvars" : [
"changeRecord",
"isPicked" ],
"isPicked",
"category",
"description" ],
"name" : "CRChangeListItem",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
describing
categoryAndDescriptionFor: aChangeListItem
aChangeListItem type caseOf: {
[#method] -> [^ {#method. self methodDescriptionFor: aChangeListItem}].
[#classComment] -> [^ {#classComment. self classCommentDescriptionFor: aChangeListItem}].
[#doIt] -> [^ self doItCategoryAndDescriptionFor: aChangeListItem].
}
"otherwise: [^ 'MISC should be removed ']"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
regex & descriptions
categoryRegexDescriptionList

^ {
{ #categoryCreated. '^([^ ]+) (class )?organization addCategory\: #(.+)$'. [:m | '#', (m subexpression: 4), ' in #', (m subexpression: 2)]}.
{ #categoryRemoved. '^([^ ]+) (class )?organization removeCategory\: #(.+)$'. [:m | '#', (m subexpression: 4), ' from #', (m subexpression: 2)]}.
{ #categoryRenamed. '^([^ ]+) (class )?organization renameCategory\: #(.+) toBe\: #(.+)$'. [:m | '#', (m subexpression: 4), ' -> #', (m subexpression: 5), ' in #', (m subexpression: 2)]}.
{ #class. '^[^ ]+ subclass\: #([\S]+).*category\: ''([^'']+)''$'. [:m | '#', (m subexpression: 2), ' in #', (m subexpression: 3)]}.
{ #classMoved. '^SystemOrganization classify\: #(.+) under\: #(.+)$'. [:m | '#', (m subexpression: 2), ' to #', (m subexpression: 3)]}.
{ #classRemoved. '^Smalltalk removeClassNamed\: #([^ ]+)$'. [:m | '#', (m subexpression: 2)]}.
{ #classRenamed. '^Smalltalk renameClassNamed\: #([^ ]+) as\: #([^ ]+)$'. [:m | '#', (m subexpression: 2), ' -> #', (m subexpression: 3)]}.
{ #methodRecategorized. '^([^ ]+) (class )?organization classify\: #(.+) under\: #(.+)$'. [:m | '#', (m subexpression: 4), ' to #', (m subexpression: 5)]}.
{ #methodRemoved. '^([^ ]+) (class )?removeSelector\: #([^ ]+)$'. [:m | '#', (m subexpression: 4), ' from #', (m subexpression: 2)]}.
{ #packageCreated. '^SystemOrganization addCategory\: #(.+)$'. [:m | '#', (m subexpression: 2)]}.
{ #packageRemoved. '^SystemOrganization removeSystemCategory\: #(.+)$'. [:m | '#', (m subexpression: 2)]}.
{ #packageRenamed. '^SystemOrganization renameCategory\: #(.+) toBe\: #(.+)$'. [:m | '#', (m subexpression: 2), ' -> #', (m subexpression: 3)]}.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
describing
classCommentDescriptionFor: aChangeListItem

^ aChangeListItem commentClass name , ' ', aChangeListItem stamp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describing
doItCategoryAndDescriptionFor: aChangeListItem

self changeString: aChangeListItem string.
self categoryRegexDescriptionList
do: [:triple | self
if: triple second asRegex
matchesChangeString: [:matcher | ^ {triple first. triple third value: matcher}]].

"otherwise it's non persistent doits"
^ {#nonPersistentDoIt. aChangeListItem string}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
main
describing
if: anMatcher matchesChangeString: aBlock

^ (anMatcher matches: self changeString) ifTrue: [^ aBlock value: anMatcher]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
describing
methodDescriptionFor: aChangeListItem

^ aChangeListItem methodClassName , ' ' , aChangeListItem methodSelector, ' ', aChangeListItem stamp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
instance creation
newChangeListItemWith: aChangeRecord

| changeListItem |

changeListItem := CRChangeListItem new changeRecord: aChangeRecord.
self setCategoryAndDescriptionOf: changeListItem.

^ changeListItem
pick;
yourself



Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
instance creation
setCategoryAndDescriptionOf: aChangeListItem

| categoryDescriptionTuple |
categoryDescriptionTuple := (self categoryAndDescriptionFor: aChangeListItem).
aChangeListItem category: categoryDescriptionTuple first.
aChangeListItem description: (aChangeListItem category, ': ', categoryDescriptionTuple second) asText.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"class" : {
"categoryAndDescriptionFor:" : "abd 6/17/2021 12:51",
"categoryRegexDescriptionList" : "abd 6/17/2021 12:24",
"changeString" : "abd 6/8/2021 20:02",
"changeString:" : "abd 6/8/2021 19:58",
"classCommentDescriptionFor:" : "abd 6/17/2021 11:31",
"doItCategoryAndDescriptionFor:" : "abd 6/17/2021 12:51",
"if:matchesChangeString:" : "abd 6/17/2021 11:14",
"methodDescriptionFor:" : "abd 6/17/2021 11:31",
"newChangeListItemWith:" : "abd 6/17/2021 11:56",
"setCategoryAndDescriptionOf:" : "abd 6/17/2021 12:51" },
"instance" : {
} }
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"commentStamp" : "abd 6/2/2021 08:52",
"instvars" : [
],
"name" : "CRChangeRecordDescriber",
"name" : "CRChangeListItemBuilder",
"pools" : [
],
"super" : "Object",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 57ae6a7

Please sign in to comment.