Fixes in changeset merge tool jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 16 Jan 2013 11:53:38 +0000
branchjv
changeset 12318 1dda95be3d40
parent 12317 aac0f12a3327
child 12319 6a14a7bd7539
Fixes in changeset merge tool
Tools__ChangeSetDiffTool.st
Tools__TextDiff2Tool.st
Tools__TextDiff3Tool.st
Tools__TextDiffTool.st
libtool.rc
--- a/Tools__ChangeSetDiffTool.st	Tue Jan 15 12:03:21 2013 +0000
+++ b/Tools__ChangeSetDiffTool.st	Wed Jan 16 11:53:38 2013 +0000
@@ -1229,6 +1229,7 @@
 
     mergeDataHolder isNil ifTrue:[
         mergeDataHolder := ValueHolder new.
+        mergeDataHolder addDependent:self.
     ].
     ^ mergeDataHolder
 !
@@ -1236,7 +1237,20 @@
 mergeDataHolder:something
     "set the 'mergeDataHolder' value holder (automatically generated)"
 
+    |oldValue newValue|
+
+    mergeDataHolder notNil ifTrue:[
+        oldValue := mergeDataHolder value.
+        mergeDataHolder removeDependent:self.
+    ].
     mergeDataHolder := something.
+    mergeDataHolder notNil ifTrue:[
+        mergeDataHolder addDependent:self.
+    ].
+    newValue := mergeDataHolder value.
+    oldValue ~~ newValue ifTrue:[
+        self update:#value with:newValue from:mergeDataHolder.
+    ].
 !
 
 mergeHolder
@@ -1492,6 +1506,11 @@
     "Modified: / 15-01-2013 / 11:30:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+mergeDataChanged
+
+    "Created: / 16-01-2013 / 09:24:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 selectionChanged
 
     | diffItem mergeData |
@@ -1541,9 +1560,15 @@
         ^self.
     ].
 
+    sender == mergeDataHolder ifTrue:[
+        self mergeDataChanged.
+        ^self.
+    ].
+
     ^super update: aspect with: param from: sender
 
     "Created: / 05-12-2009 / 11:02:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 16-01-2013 / 09:24:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 updateListMenu
@@ -2765,5 +2790,5 @@
 !
 
 version_SVN
-    ^ '$Id: Tools__ChangeSetDiffTool.st 8086 2013-01-15 12:03:21Z vranyj1 $'
+    ^ '$Id: Tools__ChangeSetDiffTool.st 8087 2013-01-16 11:53:38Z vranyj1 $'
 ! !
--- a/Tools__TextDiff2Tool.st	Tue Jan 15 12:03:21 2013 +0000
+++ b/Tools__TextDiff2Tool.st	Wed Jan 16 11:53:38 2013 +0000
@@ -102,8 +102,8 @@
      the UIPainter may not be able to read the specification."
 
     "
-     UIPainter new openOnClass:Tools::TextDiffTool andSelector:#diffSpec
-     Tools::TextDiffTool new openInterface:#diffSpec
+     UIPainter new openOnClass:Tools::TextDiff2Tool andSelector:#diffSpec
+     Tools::TextDiff2Tool new openInterface:#diffSpec
     "
 
     <resource: #canvas>
@@ -148,15 +148,13 @@
               hasVerticalScrollBar: false
               autoHideScrollBars: false
               hasBorder: false
-              component: #'Tools::Diff2CodeView2'
+              component: diffView
               postBuildCallback: postBuildDiffView:
             )
            )
          
         )
       )
-
-    "Modified: / 16-03-2012 / 13:16:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 nothingSpec
@@ -536,6 +534,16 @@
     "Created: / 16-03-2012 / 13:30:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!TextDiff2Tool methodsFor:'initialization'!
+
+initializeDiffView
+    "superclass Tools::TextDiffTool says that I am responsible to implement this method"
+
+    ^ Tools::Diff3CodeView2 new
+
+    "Modified: / 16-01-2013 / 09:52:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !TextDiff2Tool methodsFor:'private'!
 
 showDiff
@@ -593,7 +601,7 @@
 !TextDiff2Tool class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Tools__TextDiff2Tool.st 7981 2012-04-18 20:29:40Z vranyj1 $'
+    ^ '$Id: Tools__TextDiff2Tool.st 8087 2013-01-16 11:53:38Z vranyj1 $'
 !
 
 version_CVS
@@ -601,5 +609,5 @@
 !
 
 version_SVN
-    ^ '$Id: Tools__TextDiff2Tool.st 7981 2012-04-18 20:29:40Z vranyj1 $'
+    ^ '$Id: Tools__TextDiff2Tool.st 8087 2013-01-16 11:53:38Z vranyj1 $'
 ! !
--- a/Tools__TextDiff3Tool.st	Tue Jan 15 12:03:21 2013 +0000
+++ b/Tools__TextDiff3Tool.st	Wed Jan 16 11:53:38 2013 +0000
@@ -174,7 +174,7 @@
               hasVerticalScrollBar: false
               autoHideScrollBars: false
               hasBorder: false
-              component: #'Tools::Diff3CodeView2'
+              component: diffView
               postBuildCallback: postBuildDiffView:
             )
            )
@@ -693,6 +693,16 @@
     "Modified: / 30-11-2012 / 13:47:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!TextDiff3Tool methodsFor:'initialization'!
+
+initializeDiffView
+    "superclass Tools::TextDiffTool says that I am responsible to implement this method"
+
+    ^ Tools::Diff3CodeView2 new
+
+    "Modified: / 16-01-2013 / 09:52:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !TextDiff3Tool methodsFor:'menu actions'!
 
 doMergeAllAuto
@@ -708,13 +718,13 @@
     | left wc right merge |
 
     left := Filename newTemporary.
-    left writingFileDo:[:s|s nextPutAll: self textC].
+    left writingFileDo:[:s|s nextPutAll: self textC ? ''].
 
     wc := Filename newTemporary.
-    wc writingFileDo:[:s|s nextPutAll: self textA].
+    wc writingFileDo:[:s|s nextPutAll: self textA ? ''].
 
     right := Filename newTemporary.
-    right writingFileDo:[:s|s nextPutAll: self textB].
+    right writingFileDo:[:s|s nextPutAll: self textB ? ''].
 
     merge := Filename newTemporary.
 
@@ -737,7 +747,7 @@
         merge exists ifTrue:[merge remove].
     ]
 
-    "Modified: / 30-11-2012 / 14:13:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 16-01-2013 / 10:02:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doMergeAllUsingA
@@ -1089,5 +1099,5 @@
 !TextDiff3Tool class methodsFor:'documentation'!
 
 version_SVN
-    ^ '$Id: Tools__TextDiff3Tool.st 8086 2013-01-15 12:03:21Z vranyj1 $'
+    ^ '$Id: Tools__TextDiff3Tool.st 8087 2013-01-16 11:53:38Z vranyj1 $'
 ! !
--- a/Tools__TextDiffTool.st	Tue Jan 15 12:03:21 2013 +0000
+++ b/Tools__TextDiffTool.st	Wed Jan 16 11:53:38 2013 +0000
@@ -512,6 +512,15 @@
     ].
 !
 
+diffView
+"/    diffView isNil ifTrue:[
+        diffView := self initializeDiffView.
+"/    ].
+    ^diffView
+
+    "Created: / 16-01-2013 / 09:45:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 labelHolder
     "return/create the 'labelAHolder' value holder (automatically generated)"
 
@@ -794,6 +803,13 @@
     textAChanged := textBChanged := textBChanged := false.
 
     "Modified: / 16-03-2012 / 12:40:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+initializeDiffView
+
+    self subclassResponsibility
+
+    "Created: / 16-01-2013 / 09:45:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TextDiffTool methodsFor:'testing'!
@@ -819,5 +835,5 @@
 !TextDiffTool class methodsFor:'documentation'!
 
 version_SVN
-    ^ '$Id: Tools__TextDiffTool.st 8027 2012-07-26 18:46:57Z vranyj1 $'
+    ^ '$Id: Tools__TextDiffTool.st 8087 2013-01-16 11:53:38Z vranyj1 $'
 ! !
--- a/libtool.rc	Tue Jan 15 12:03:21 2013 +0000
+++ b/libtool.rc	Wed Jan 16 11:53:38 2013 +0000
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2012\nCopyright eXept Software AG 1998-2012\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Tue, 15 Jan 2013 12:04:28 GMT\0"
+      VALUE "ProductDate", "Wed, 16 Jan 2013 11:53:00 GMT\0"
     END
 
   END