Improvements in merge tool jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 20 Mar 2012 16:59:54 +0000
branchjv
changeset 12201 283826cb8bcc
parent 12200 807a52b94f2a
child 12202 eaa1f6cb6ce8
Improvements in merge tool
Make.proto
Make.spec
TerminalApplication.st
Tools__ChangeSetBrowser2.st
Tools__ChangeSetDiffInfo.st
Tools__ChangeSetDiffTool.st
Tools__ChangeSetSpec.st
Tools__TextDiff3Tool.st
Tools__TextMergeInfo.st
abbrev.stc
bc.mak
libInit.cc
libtool.rc
--- a/Make.proto	Tue Mar 20 12:36:40 2012 +0000
+++ b/Make.proto	Tue Mar 20 16:59:54 2012 +0000
@@ -1,7 +1,7 @@
 # $Header$
 #
 # DO NOT EDIT
-# automagically generated from the projectDefinition: stx_libtool at 2012-03-19 15:32:38.865.
+# automagically generated from the projectDefinition: stx_libtool at 2012-03-20 16:57:24.290.
 #
 # Warning: once you modify this file, do not rerun
 # stmkmp or projectDefinition-build again - otherwise, your changes are lost.
@@ -181,6 +181,7 @@
 $(OUTDIR)Tools__BrowsletCanvas.$(O) Tools__BrowsletCanvas.$(H): Tools__BrowsletCanvas.st $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Tools__CachedTags.$(O) Tools__CachedTags.$(H): Tools__CachedTags.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Tools__ChangeSetBrowser2.$(O) Tools__ChangeSetBrowser2.$(H): Tools__ChangeSetBrowser2.st $(INCLUDE_TOP)/stx/libview2/ToolApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Tools__ChangeSetDiffInfo.$(O) Tools__ChangeSetDiffInfo.$(H): Tools__ChangeSetDiffInfo.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Tools__ChangeSetDiffTool.$(O) Tools__ChangeSetDiffTool.$(H): Tools__ChangeSetDiffTool.st $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libview2/SimpleDialog.$(H) $(STCHDR)
 $(OUTDIR)Tools__ChangeSetSelectionDialog.$(O) Tools__ChangeSetSelectionDialog.$(H): Tools__ChangeSetSelectionDialog.st $(INCLUDE_TOP)/stx/libview2/SimpleDialog.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Tools__ChangeSetSpec.$(O) Tools__ChangeSetSpec.$(H): Tools__ChangeSetSpec.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
@@ -243,7 +244,7 @@
 $(OUTDIR)NewLauncher.$(O) NewLauncher.$(H): NewLauncher.st $(INCLUDE_TOP)/stx/libtool/AbstractLauncherApplication.$(H) $(INCLUDE_TOP)/stx/libview2/ToolApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)OrderedCollectionInspectorView.$(O) OrderedCollectionInspectorView.$(H): OrderedCollectionInspectorView.st $(INCLUDE_TOP)/stx/libtool/InspectorView.$(H) $(INCLUDE_TOP)/stx/libview/SimpleView.$(H) $(INCLUDE_TOP)/stx/libview/DisplaySurface.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsMedium.$(H) $(INCLUDE_TOP)/stx/libview/DeviceGraphicsContext.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsContext.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SetInspectorView.$(O) SetInspectorView.$(H): SetInspectorView.st $(INCLUDE_TOP)/stx/libtool/InspectorView.$(H) $(INCLUDE_TOP)/stx/libview/SimpleView.$(H) $(INCLUDE_TOP)/stx/libview/DisplaySurface.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsMedium.$(H) $(INCLUDE_TOP)/stx/libview/DeviceGraphicsContext.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsContext.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)SettingsDialog.$(O) SettingsDialog.$(H): SettingsDialog.st $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalList.$(H) $(INCLUDE_TOP)/stx/libbasic2/List.$(H) $(INCLUDE_TOP)/stx/libbasic/OrderedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItemWithLabelAndIcon.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItemWithLabel.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(INCLUDE_TOP)/stx/libtool/AbstractSettingsApplication.$(H) $(STCHDR)
+$(OUTDIR)SettingsDialog.$(O) SettingsDialog.$(H): SettingsDialog.st $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libtool/AbstractSettingsApplication.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalList.$(H) $(INCLUDE_TOP)/stx/libbasic2/List.$(H) $(INCLUDE_TOP)/stx/libbasic/OrderedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItemWithLabelAndIcon.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItemWithLabel.$(H) $(INCLUDE_TOP)/stx/libwidg2/HierarchicalItem.$(H) $(STCHDR)
 $(OUTDIR)SmalltalkCodeGeneratorTool.$(O) SmalltalkCodeGeneratorTool.$(H): SmalltalkCodeGeneratorTool.st $(INCLUDE_TOP)/stx/libtool/CodeGeneratorTool.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Tools__BackgroundSourceProcessingService.$(O) Tools__BackgroundSourceProcessingService.$(H): Tools__BackgroundSourceProcessingService.st $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Tools__BreakpointService.$(O) Tools__BreakpointService.$(H): Tools__BreakpointService.st $(INCLUDE_TOP)/stx/libtool/Tools__CodeViewService.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
--- a/Make.spec	Tue Mar 20 12:36:40 2012 +0000
+++ b/Make.spec	Tue Mar 20 16:59:54 2012 +0000
@@ -1,7 +1,7 @@
 # $Header$
 #
 # DO NOT EDIT
-# automagically generated from the projectDefinition: stx_libtool at 2012-03-19 15:32:36.747.
+# automagically generated from the projectDefinition: stx_libtool at 2012-03-20 16:57:22.051.
 #
 # Warning: once you modify this file, do not rerun
 # stmkmp or projectDefinition-build again - otherwise, your changes are lost.
@@ -221,6 +221,7 @@
 	Diff3ExclusiveVisitor \
 	Tools::TextMergeInfo \
 	FileBrowserV3 \
+	Tools::ChangeSetDiffInfo \
 
 
 
@@ -397,6 +398,7 @@
     $(OUTDIR)Diff3ExclusiveVisitor.$(O) \
     $(OUTDIR)Tools__TextMergeInfo.$(O) \
     $(OUTDIR)FileBrowserV3.$(O) \
+    $(OUTDIR)Tools__ChangeSetDiffInfo.$(O) \
     $(OUTDIR)extensions.$(O) \
 
 
--- a/TerminalApplication.st	Tue Mar 20 12:36:40 2012 +0000
+++ b/TerminalApplication.st	Tue Mar 20 16:59:54 2012 +0000
@@ -480,5 +480,5 @@
 !
 
 version_SVN
-    ^ '$Id: TerminalApplication.st 7871 2012-02-05 01:49:41Z vranyj1 $'
+    ^ '$Id: TerminalApplication.st 7947 2012-03-20 16:59:54Z vranyj1 $'
 ! !
--- a/Tools__ChangeSetBrowser2.st	Tue Mar 20 12:36:40 2012 +0000
+++ b/Tools__ChangeSetBrowser2.st	Tue Mar 20 16:59:54 2012 +0000
@@ -1977,22 +1977,33 @@
 doSaveAs
 
     | file |
-    file := Dialog requestFileName:'Select File for Save' default: (changesetFile ? 'somechanges.chg') pattern:('*.chg').
+    Dialog aboutToOpenBoxNotificationSignal handle:[:ex|
+"/        OOPS, not supported!!!!!!!!
+
+"/        | box |
+"/        box := ex parameter.
+"/        box verticalPanel 
+"/                add:(CheckBox label:'x'
+"/                              model:true asValue).
+        ex pass.
+    ] do:[
+        file := Dialog requestFileName:'Select File for Save' default: (changesetFile ? 'somechanges.chg') pattern:('*.chg').
+    ].
     file isNil ifTrue:[^self].
     self doSaveAs: file.
 
     "Modified: / 27-12-2011 / 10:39:52 / cg"
+    "Modified: / 20-03-2012 / 13:52:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doSaveAs: newFile
 
-    [
-        | s |
-        s := newFile asFilename writeStream.
-        [self changeset fileOutOn: s] ensure:[s close].
-        changesetFile := newFile.
-    ] on: Error do:
-        [:ex|Dialog warn: 'Erorr saving changes: ' , ex description]
+"/    [
+        self changeset saveToFile: newFile format: #classSource.
+"/    ] on: Error do:
+"/        [:ex|Dialog warn: 'Erorr saving changes: ' , ex description]
+
+    "Modified: / 20-03-2012 / 13:52:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 setTargetNamespace
@@ -2263,12 +2274,11 @@
 
 changeMenuInspect: changeList
 
-    | changes |
-    changes := OrderedCollection new: 1.
-    self selectionDo:[:chg|changes add: chg].
-    changes size = 1
-        ifTrue:[changes anyOne inspect]
-        ifFalse:[changes inspect].
+    changeList selection size == 1 ifTrue:[
+        changeList selection anyOne change inspect
+    ] ifFalse:[
+        (changeList selection collect:[:each|each change]) inspect
+    ]
 
     "Created: / 04-08-2011 / 17:28:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
@@ -2477,6 +2487,8 @@
 
 selectionDo: aBlock
 
+    self changeList selection do:[:item|aBlock value: item change].
+
 "/    | applyBlock |
 "/    applyBlock := [:e|aBlock value: e change].
 "/
@@ -2490,8 +2502,8 @@
 "/    self redrawChangeListViews
 
     "Created: / 29-10-2010 / 13:47:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 08-04-2011 / 10:15:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 04-08-2011 / 19:06:31 / cg"
+    "Modified: / 20-03-2012 / 16:24:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 showProgress: label while: block
@@ -2846,7 +2858,7 @@
 !ChangeSetBrowser2 class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Tools__ChangeSetBrowser2.st 7925 2012-03-16 17:08:17Z vranyj1 $'
+    ^ '$Id: Tools__ChangeSetBrowser2.st 7947 2012-03-20 16:59:54Z vranyj1 $'
 !
 
 version_CVS
@@ -2854,5 +2866,5 @@
 !
 
 version_SVN
-    ^ '$Id: Tools__ChangeSetBrowser2.st 7925 2012-03-16 17:08:17Z vranyj1 $'
+    ^ '$Id: Tools__ChangeSetBrowser2.st 7947 2012-03-20 16:59:54Z vranyj1 $'
 ! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Tools__ChangeSetDiffInfo.st	Tue Mar 20 16:59:54 2012 +0000
@@ -0,0 +1,158 @@
+"
+ COPYRIGHT (c) 2006 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+"{ Package: 'stx:libtool' }"
+
+"{ NameSpace: Tools }"
+
+Object subclass:#ChangeSetDiffInfo
+	instanceVariableNames:'specBase specA specB specMerge diffset same'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Interface-Diff'
+!
+
+!ChangeSetDiffInfo class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 2006 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+! !
+
+!ChangeSetDiffInfo class methodsFor:'instance creation'!
+
+specA: specA specB: specB
+
+    ^self specA: specA specB: specB specBase: nil
+
+    "Created: / 20-03-2012 / 11:17:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+specA: specA specB: specB specBase: specBase
+
+    ^self specA: specA specB: specB specBase: specBase specMerge: nil
+
+    "Created: / 20-03-2012 / 11:19:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+specA: specA specB: specB specBase: specBase specMerge: specMerge
+
+    ^self new 
+        specA: specA; 
+        specB: specB; 
+        specBase: specBase;
+        specMerge: specMerge
+
+    "Created: / 20-03-2012 / 11:19:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetDiffInfo methodsFor:'accessing'!
+
+diffset
+    ^ diffset
+!
+
+same
+    ^ same
+!
+
+specA
+    ^ specA
+!
+
+specA:something
+    specA := something.
+!
+
+specB
+    ^ specB
+!
+
+specB:something
+    specB := something.
+!
+
+specBase
+    ^ specBase
+!
+
+specBase:something
+    specBase := something.
+!
+
+specMerge
+    ^ specMerge
+!
+
+specMerge:something
+    specMerge := something.
+!
+
+specMergeFile
+    ^ specMerge file
+
+    "Created: / 20-03-2012 / 15:04:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetDiffInfo methodsFor:'queries'!
+
+isDiff2
+
+    ^specBase isNil
+
+    "Created: / 20-03-2012 / 10:22:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isDiff3
+
+    ^specBase notNil
+
+    "Created: / 20-03-2012 / 10:23:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isMerge
+
+    ^specBase notNil and:[specMerge notNil]
+
+    "Created: / 20-03-2012 / 10:23:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetDiffInfo methodsFor:'read / write'!
+
+read
+    "Reads changesets and generates diffset and 'same' change list"
+
+    | diff |
+    diff := ChangeSetDiff new.
+    diff
+        versionA: specA changeSet
+        versionB: specB changeSet
+        versionBase: (specBase notNil ifTrue:[specBase changeSet] ifFalse:[nil]).
+    diffset := diff diffset.
+    same := diff same.
+
+    "Created: / 19-03-2012 / 22:10:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetDiffInfo class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id: Tools__ChangeSetDiffInfo.st 7947 2012-03-20 16:59:54Z vranyj1 $'
+! !
--- a/Tools__ChangeSetDiffTool.st	Tue Mar 20 12:36:40 2012 +0000
+++ b/Tools__ChangeSetDiffTool.st	Tue Mar 20 16:59:54 2012 +0000
@@ -689,7 +689,20 @@
                   shortcutKey: Ctrlo
                 )
                (MenuItem
-                  enabled: false
+                  enabled: canSave
+                  label: 'Save'
+                  itemValue: fileMenuSave
+                  translateLabel: true
+                  shortcutKey: Ctrls
+                )
+               (MenuItem
+                  enabled: canSaveAs
+                  label: 'Save As...'
+                  itemValue: fileMenuSaveAs
+                  translateLabel: true
+                )
+               (MenuItem
+                  enabled: canSaveAsPatch
                   label: 'Save as patch '
                   itemValue: fileMenuSaveAsPatch
                   translateLabel: true
@@ -714,16 +727,29 @@
            (Menu
               (
                (MenuItem
+                  enabled: isDiff2Or3
                   label: 'Browse changes (A)'
                   itemValue: changesetMenuBrowseA
                   translateLabel: true
                 )
-                (MenuItem
-                    label: 'Browse changes (B)'
-                    itemValue: changesetMenuBrowseB
-                    translateLabel: true
-                    )
-
+               (MenuItem
+                  enabled: isDiff2Or3
+                  label: 'Browse changes (B)'
+                  itemValue: changesetMenuBrowseB
+                  translateLabel: true
+                )
+               (MenuItem
+                  enabled: isDiff3
+                  label: 'Browse changes (Base)'
+                  itemValue: changesetMenuBrowseBase
+                  translateLabel: true
+                )
+               (MenuItem
+                  enabled: isMerge
+                  label: 'Browse changes (Merge)'
+                  itemValue: changesetMenuBrowseMerge
+                  translateLabel: true
+                )
                )
               nil
               nil
@@ -738,8 +764,6 @@
         nil
         nil
       )
-
-    "Modified: / 16-12-2011 / 14:24:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ChangeSetDiffTool class methodsFor:'plugIn spec'!
@@ -1344,25 +1368,39 @@
 
 changesetMenuBrowse: changeset
 
-    Tools::ChangeSetBrowser2 openOn: changeset
+    Tools::ChangeSetBrowser2 openOn: (changeset , self diffInfo same)
 
     "Created: / 16-12-2011 / 14:31:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 changesetMenuBrowseA
 
-    self changesetMenuBrowse: self diffsetHolder value changesetA
+    self changesetMenuBrowse: self diffInfo diffset changesetA
 
     "Created: / 16-12-2011 / 14:23:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 changesetMenuBrowseB
 
-    self changesetMenuBrowse: self diffsetHolder value changesetB
+    self changesetMenuBrowse: self diffInfo diffset changesetB
 
     "Created: / 16-12-2011 / 14:27:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+changesetMenuBrowseBase
+
+    self changesetMenuBrowse: self diffInfo diffset changesetBase
+
+    "Created: / 20-03-2012 / 13:34:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+changesetMenuBrowseMerge
+
+    self changesetMenuBrowse: self diffInfo diffset changesetMerged
+
+    "Created: / 20-03-2012 / 14:34:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 fileMenuOpen
 
     | dlg info |
@@ -1386,6 +1424,42 @@
     "Created: / 20-03-2012 / 00:04:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+fileMenuSave
+    self fileMenuSaveAs: self diffInfo specMergeFile.
+
+    "Modified: / 20-03-2012 / 15:07:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+fileMenuSaveAs
+    | info file suggestion |
+
+    info := self diffInfo.
+    suggestion := (info specMerge isFile ifTrue:['merged.chg'] ifFalse:[info specMergeFile]).
+    file := Dialog requestFileName:'Select File for Save' default: (suggestion) pattern:('*.chg;*.st').
+    file isNil ifTrue:[^self].
+    self fileMenuSaveAs: file.
+
+    "Modified: / 20-03-2012 / 15:07:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+fileMenuSaveAs: aFilename
+
+    self fileMenuSaveAs: aFilename format: #classSource
+
+    "Created: / 20-03-2012 / 15:07:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+fileMenuSaveAs: aFilename format: format
+
+    | changesToSave |
+
+    changesToSave := (self diffInfo diffset changesetMerged) , (self diffInfo same).
+    changesToSave := changesToSave reject:[:chg|chg isDoIt].
+    changesToSave saveToFile: aFilename format: format.
+
+    "Created: / 20-03-2012 / 15:09:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 fileMenuSaveAsPatch
 
     | filename |
@@ -1490,11 +1564,64 @@
     "Modified: / 21-11-2009 / 18:46:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+canSave
+    "Returns true, if a merged file can be saved"
+
+    | info |
+    info := self diffInfo.
+    ^info isMerge and:[info specMerge isFile and:[info diffset isMerged]]
+
+    "Created: / 20-03-2012 / 15:00:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+canSaveAs
+    "Returns true, if a merged file can be saved"
+
+    | info |
+    info := self diffInfo.
+    ^info isMerge and:[info diffset isMerged]
+
+    "Created: / 20-03-2012 / 15:03:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+canSaveAsPatch
+
+    ^false
+
+    "Created: / 20-03-2012 / 14:55:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 hasSelection
 
     ^[self selection notNil]
 
     "Created: / 03-11-2009 / 10:48:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetDiffTool methodsFor:'testing'!
+
+isDiff2
+    ^self diffInfo notNil and:[self diffInfo isDiff2]
+
+    "Created: / 20-03-2012 / 13:27:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isDiff2Or3
+    ^self diffInfo notNil and:[self diffInfo isDiff2 or:[self diffInfo isDiff3]]
+
+    "Created: / 20-03-2012 / 13:29:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isDiff3
+    ^self diffInfo notNil and:[self diffInfo isDiff3]
+
+    "Created: / 20-03-2012 / 13:27:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isMerge
+    ^self diffInfo notNil and:[self diffInfo isMerge]
+
+    "Created: / 19-03-2012 / 11:53:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 isOneColumnBrowser
@@ -1504,15 +1631,6 @@
     "Created: / 05-12-2009 / 11:04:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!ChangeSetDiffTool methodsFor:'testing'!
-
-isMerge
-
-    ^self mergeHolder value
-
-    "Created: / 19-03-2012 / 11:53:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
 !ChangeSetDiffTool::OpenDialog class methodsFor:'image specs'!
 
 versionA24x24
@@ -2332,5 +2450,5 @@
 !
 
 version_SVN
-    ^ '$Id: Tools__ChangeSetDiffTool.st 7946 2012-03-20 12:36:40Z vranyj1 $'
+    ^ '$Id: Tools__ChangeSetDiffTool.st 7947 2012-03-20 16:59:54Z vranyj1 $'
 ! !
--- a/Tools__ChangeSetSpec.st	Tue Mar 20 12:36:40 2012 +0000
+++ b/Tools__ChangeSetSpec.st	Tue Mar 20 16:59:54 2012 +0000
@@ -152,6 +152,38 @@
     "Created: / 19-03-2012 / 23:31:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!ChangeSetSpec methodsFor:'testing'!
+
+isChangeSet
+    ^self isExplicit
+
+    "Created: / 20-03-2012 / 14:58:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isDirectory
+    ^false
+
+    "Created: / 20-03-2012 / 14:59:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isExplicit
+    ^false
+
+    "Created: / 20-03-2012 / 14:58:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isFile
+    ^false
+
+    "Created: / 20-03-2012 / 14:58:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isPackage
+    ^false
+
+    "Created: / 20-03-2012 / 14:58:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !ChangeSetSpec::Directory class methodsFor:'accessing'!
 
 editorSpecSelector
@@ -195,6 +227,14 @@
     directory := aStringOrFilename.
 ! !
 
+!ChangeSetSpec::Directory methodsFor:'testing'!
+
+isDirectory
+    ^true
+
+    "Created: / 20-03-2012 / 14:59:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !ChangeSetSpec::Explicit class methodsFor:'accessing'!
 
 editorSpecSelector
@@ -219,6 +259,14 @@
     ^ self shouldImplement
 ! !
 
+!ChangeSetSpec::Explicit methodsFor:'testing'!
+
+isExplicit
+    ^true
+
+    "Created: / 20-03-2012 / 14:59:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !ChangeSetSpec::File class methodsFor:'accessing'!
 
 editorSpecSelector
@@ -262,6 +310,14 @@
     file := something.
 ! !
 
+!ChangeSetSpec::File methodsFor:'testing'!
+
+isFile
+    ^true
+
+    "Created: / 20-03-2012 / 14:59:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !ChangeSetSpec::Package class methodsFor:'accessing'!
 
 editorSpecSelector
@@ -299,6 +355,14 @@
     package := aStringOrSymbol.
 ! !
 
+!ChangeSetSpec::Package methodsFor:'testing'!
+
+isPackage
+    ^true
+
+    "Created: / 20-03-2012 / 14:59:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !ChangeSetSpec class methodsFor:'documentation'!
 
 version_CVS
@@ -306,5 +370,5 @@
 !
 
 version_SVN
-    ^ '$Id: Tools__ChangeSetSpec.st 7946 2012-03-20 12:36:40Z vranyj1 $'
+    ^ '$Id: Tools__ChangeSetSpec.st 7947 2012-03-20 16:59:54Z vranyj1 $'
 ! !
--- a/Tools__TextDiff3Tool.st	Tue Mar 20 12:36:40 2012 +0000
+++ b/Tools__TextDiff3Tool.st	Tue Mar 20 16:59:54 2012 +0000
@@ -395,6 +395,13 @@
     self mergeHolder value: true
 
     "Created: / 17-03-2012 / 12:23:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+mergeData
+
+    ^self mergeDataHolder value
+
+    "Created: / 20-03-2012 / 14:17:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TextDiff3Tool methodsFor:'actions'!
@@ -407,21 +414,21 @@
 
 doMergeUsingA
 
-    self textMergedHolder value: self textAHolder value
+    self mergeData mergeUsingA
 
     "Created: / 17-03-2012 / 12:55:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doMergeUsingB
 
-    self textMergedHolder value: self textBHolder value
+    self mergeData mergeUsingB
 
     "Created: / 17-03-2012 / 12:55:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doMergeUsingBase
 
-    self textMergedHolder value: self textCHolder value
+    self mergeData mergeUsingBase
 
     "Created: / 17-03-2012 / 12:55:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
@@ -740,6 +747,8 @@
     textView changedLines: changed.
     textView diffMode: true.
     textView list: data list.
+    textView invalidate.
+    gutterView invalidate.
 
     "Created: / 19-03-2012 / 12:41:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
@@ -813,5 +822,5 @@
 !TextDiff3Tool class methodsFor:'documentation'!
 
 version_SVN
-    ^ '$Id: Tools__TextDiff3Tool.st 7944 2012-03-19 15:32:45Z vranyj1 $'
+    ^ '$Id: Tools__TextDiff3Tool.st 7947 2012-03-20 16:59:54Z vranyj1 $'
 ! !
--- a/Tools__TextMergeInfo.st	Tue Mar 20 12:36:40 2012 +0000
+++ b/Tools__TextMergeInfo.st	Tue Mar 20 16:59:54 2012 +0000
@@ -106,6 +106,46 @@
     "Created: / 19-03-2012 / 12:10:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!TextMergeInfo methodsFor:'merging'!
+
+mergeUsingA
+    | changed |
+
+    changed := false.
+    1 to: list size do:[:lineNr|
+        | lineInfo |
+
+        lineInfo := listInfos at: lineNr.
+        lineInfo conflict notNil ifTrue:[
+            self list at: lineNr put: (lineInfo conflict left first).
+            lineInfo resolution: #MergedUsingA.
+            changed := true
+        ].
+    ].
+    changed ifTrue:[self changed: #resolution].
+
+    "Created: / 20-03-2012 / 14:28:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+mergeUsingB
+    | changed |
+
+    changed := false.
+    1 to: list size do:[:lineNr|
+        | lineInfo |
+
+        lineInfo := listInfos at: lineNr.
+        lineInfo conflict notNil ifTrue:[
+            self list at: lineNr put: (lineInfo conflict right first).
+            lineInfo resolution: #MergedUsingB.
+            changed := true
+        ].
+    ].
+    changed ifTrue:[self changed: #resolution].
+
+    "Created: / 20-03-2012 / 14:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !TextMergeInfo methodsFor:'testing'!
 
 isMerged
@@ -134,7 +174,12 @@
 
 color
 
-    self isMerged ifTrue:[ ^ Tools::TextDiff3Tool colorMerged ].
+    self isMerged ifTrue:[ 
+        self isMergedUsingA ifTrue:[ ^Tools::TextDiff3Tool colorA].
+        self isMergedUsingB ifTrue:[ ^Tools::TextDiff3Tool colorB].
+        self isMergedUsingBase ifTrue:[ ^Tools::TextDiff3Tool colorBase].
+        ^ Tools::TextDiff3Tool colorMerged 
+    ].
     self isConflict ifTrue:[ ^ Tools::TextDiff3Tool colorConflict ].
 
     "Created: / 19-03-2012 / 15:05:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -162,6 +207,10 @@
 
 resolution
     ^ resolution
+!
+
+resolution:something
+    resolution := something.
 ! !
 
 !TextMergeInfo::LineInfo methodsFor:'printing & storing'!
@@ -192,13 +241,37 @@
 
 isMerged
 
-    ^resolution == #Merged
+    ^(resolution == #Merged) 
+        or:[self isMergedUsingA
+            or:[self isMergedUsingB
+                or:[self isMergedUsingBase]]]
 
     "Created: / 19-03-2012 / 15:06:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isMergedUsingA
+
+    ^resolution == #MergedUsingA
+
+    "Created: / 20-03-2012 / 14:21:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isMergedUsingB
+
+    ^resolution == #MergedUsingB
+
+    "Created: / 20-03-2012 / 14:21:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isMergedUsingBase
+
+    ^resolution == #MergedUsingB
+
+    "Created: / 20-03-2012 / 14:21:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TextMergeInfo class methodsFor:'documentation'!
 
 version_SVN
-    ^ '$Id: Tools__TextMergeInfo.st 7944 2012-03-19 15:32:45Z vranyj1 $'
+    ^ '$Id: Tools__TextMergeInfo.st 7947 2012-03-20 16:59:54Z vranyj1 $'
 ! !
--- a/abbrev.stc	Tue Mar 20 12:36:40 2012 +0000
+++ b/abbrev.stc	Tue Mar 20 16:59:54 2012 +0000
@@ -216,3 +216,4 @@
 Diff3ExclusiveVisitor Diff3ExclusiveVisitor stx:libtool 'Collections-Sequenceable-Diff3' 0
 Tools::TextMergeInfo Tools__TextMergeInfo stx:libtool 'Interface-Diff' 0
 FileBrowserV3 FileBrowserV3 stx:libtool 'Interface-Tools-File' 3
+Tools::ChangeSetDiffInfo Tools__ChangeSetDiffInfo stx:libtool 'Interface-Diff' 0
--- a/bc.mak	Tue Mar 20 12:36:40 2012 +0000
+++ b/bc.mak	Tue Mar 20 16:59:54 2012 +0000
@@ -1,7 +1,7 @@
 # $Header$
 #
 # DO NOT EDIT
-# automagically generated from the projectDefinition: stx_libtool at 2012-03-19 15:32:39.991.
+# automagically generated from the projectDefinition: stx_libtool at 2012-03-20 16:57:25.229.
 #
 # Warning: once you modify this file, do not rerun
 # stmkmp or projectDefinition-build again - otherwise, your changes are lost.
@@ -123,6 +123,7 @@
 $(OUTDIR)Tools__BrowsletCanvas.$(O) Tools__BrowsletCanvas.$(H): Tools__BrowsletCanvas.st $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Tools__CachedTags.$(O) Tools__CachedTags.$(H): Tools__CachedTags.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Tools__ChangeSetBrowser2.$(O) Tools__ChangeSetBrowser2.$(H): Tools__ChangeSetBrowser2.st $(INCLUDE_TOP)\stx\libview2\ToolApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Tools__ChangeSetDiffInfo.$(O) Tools__ChangeSetDiffInfo.$(H): Tools__ChangeSetDiffInfo.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Tools__ChangeSetDiffTool.$(O) Tools__ChangeSetDiffTool.$(H): Tools__ChangeSetDiffTool.st $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libview2\SimpleDialog.$(H) $(STCHDR)
 $(OUTDIR)Tools__ChangeSetSelectionDialog.$(O) Tools__ChangeSetSelectionDialog.$(H): Tools__ChangeSetSelectionDialog.st $(INCLUDE_TOP)\stx\libview2\SimpleDialog.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Tools__ChangeSetSpec.$(O) Tools__ChangeSetSpec.$(H): Tools__ChangeSetSpec.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -185,7 +186,7 @@
 $(OUTDIR)NewLauncher.$(O) NewLauncher.$(H): NewLauncher.st $(INCLUDE_TOP)\stx\libtool\AbstractLauncherApplication.$(H) $(INCLUDE_TOP)\stx\libview2\ToolApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)OrderedCollectionInspectorView.$(O) OrderedCollectionInspectorView.$(H): OrderedCollectionInspectorView.st $(INCLUDE_TOP)\stx\libtool\InspectorView.$(H) $(INCLUDE_TOP)\stx\libview\SimpleView.$(H) $(INCLUDE_TOP)\stx\libview\DisplaySurface.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsMedium.$(H) $(INCLUDE_TOP)\stx\libview\DeviceGraphicsContext.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsContext.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SetInspectorView.$(O) SetInspectorView.$(H): SetInspectorView.st $(INCLUDE_TOP)\stx\libtool\InspectorView.$(H) $(INCLUDE_TOP)\stx\libview\SimpleView.$(H) $(INCLUDE_TOP)\stx\libview\DisplaySurface.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsMedium.$(H) $(INCLUDE_TOP)\stx\libview\DeviceGraphicsContext.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsContext.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)SettingsDialog.$(O) SettingsDialog.$(H): SettingsDialog.st $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalList.$(H) $(INCLUDE_TOP)\stx\libbasic2\List.$(H) $(INCLUDE_TOP)\stx\libbasic\OrderedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItemWithLabelAndIcon.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItemWithLabel.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(INCLUDE_TOP)\stx\libtool\AbstractSettingsApplication.$(H) $(STCHDR)
+$(OUTDIR)SettingsDialog.$(O) SettingsDialog.$(H): SettingsDialog.st $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libtool\AbstractSettingsApplication.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalList.$(H) $(INCLUDE_TOP)\stx\libbasic2\List.$(H) $(INCLUDE_TOP)\stx\libbasic\OrderedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItemWithLabelAndIcon.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItemWithLabel.$(H) $(INCLUDE_TOP)\stx\libwidg2\HierarchicalItem.$(H) $(STCHDR)
 $(OUTDIR)SmalltalkCodeGeneratorTool.$(O) SmalltalkCodeGeneratorTool.$(H): SmalltalkCodeGeneratorTool.st $(INCLUDE_TOP)\stx\libtool\CodeGeneratorTool.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Tools__BackgroundSourceProcessingService.$(O) Tools__BackgroundSourceProcessingService.$(H): Tools__BackgroundSourceProcessingService.st $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Tools__BreakpointService.$(O) Tools__BreakpointService.$(H): Tools__BreakpointService.st $(INCLUDE_TOP)\stx\libtool\Tools__CodeViewService.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
--- a/libInit.cc	Tue Mar 20 12:36:40 2012 +0000
+++ b/libInit.cc	Tue Mar 20 16:59:54 2012 +0000
@@ -74,6 +74,7 @@
 _Tools__BrowsletCanvas_Init(pass,__pRT__,snd);
 _Tools__CachedTags_Init(pass,__pRT__,snd);
 _Tools__ChangeSetBrowser2_Init(pass,__pRT__,snd);
+_Tools__ChangeSetDiffInfo_Init(pass,__pRT__,snd);
 _Tools__ChangeSetDiffTool_Init(pass,__pRT__,snd);
 _Tools__ChangeSetSelectionDialog_Init(pass,__pRT__,snd);
 _Tools__ChangeSetSpec_Init(pass,__pRT__,snd);
--- a/libtool.rc	Tue Mar 20 12:36:40 2012 +0000
+++ b/libtool.rc	Tue Mar 20 16:59:54 2012 +0000
@@ -3,7 +3,7 @@
 // automagically generated from the projectDefinition: stx_libtool.
 //
 VS_VERSION_INFO VERSIONINFO
-  FILEVERSION     6,2,7943,7943
+  FILEVERSION     6,2,7945,7945
   PRODUCTVERSION  6,2,1,1
 #if (__BORLANDC__)
   FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
@@ -20,12 +20,12 @@
     BEGIN
       VALUE "CompanyName", "eXept Software AG\0"
       VALUE "FileDescription", "Smalltalk/X Tools (LIB)\0"
-      VALUE "FileVersion", "6.2.7943.7943\0"
+      VALUE "FileVersion", "6.2.7945.7945\0"
       VALUE "InternalName", "stx:libtool\0"
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.1.1\0"
-      VALUE "ProductDate", "Mon, 19 Mar 2012 15:33:03 GMT\0"
+      VALUE "ProductDate", "Tue, 20 Mar 2012 16:58:57 GMT\0"
     END
 
   END