- added compare against HEAD & compare against BASE
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 10 Feb 2012 12:05:50 +0100
changeset 1026 b26d2f0915ff
parent 1025 c123c8d1321a
child 1027 1f9bcfa5013b
- added compare against HEAD & compare against BASE menu entries in CommitDialog2
SVN__CommitDialog2.st
--- a/SVN__CommitDialog2.st	Fri Feb 10 12:04:21 2012 +0100
+++ b/SVN__CommitDialog2.st	Fri Feb 10 12:05:50 2012 +0100
@@ -292,6 +292,11 @@
             itemValue: doShowDiffsForEntry
             translateLabel: true
           )
+         (MenuItem
+            label: 'Show differences (against HEAD)'
+            itemValue: doShowDiffsForEntryAgainstHEAD
+            translateLabel: true
+          )
          )
         nil
         nil
@@ -404,21 +409,12 @@
 doShowDiffsForEntry
 
     self fileSelectionHolder value do:[:each|
-        self doShowDiffsForEntry: each entry
+        self doShowDiffsForEntry: each entry against: Revision base
     ].
 
-    "Modified: / 04-02-2012 / 17:15:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Created: / 09-02-2012 / 14:51:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-doShowDiffsForEntry: entry
-
-    self doShowDiffsForEntry: entry against: SVN::Revision head
-
-    "Modified: / 04-02-2012 / 17:15:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Created: / 09-02-2012 / 14:52:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 doShowDiffsForEntry: entry against: rev
     |wc wcChangeSet repoChangeSet diffset lang |
 
@@ -427,7 +423,7 @@
     (lang notNil and: [lang isSmalltalk]) ifTrue:[
         wcChangeSet := wc changeSetForContainer:entry path.
         wcChangeSet name: wcChangeSet name, ' (working copy)'.
-        repoChangeSet := wc branch changeSetForContainer:entry path revision:rev.
+        repoChangeSet := wc changeSetForContainer:entry path revision:rev.
         diffset := ChangeSetDiff versionA:wcChangeSet versionB:repoChangeSet.
         (Tools::ChangeSetDiffTool new)
             beSingleColumn;
@@ -437,7 +433,7 @@
     ] ifFalse:[
         | text1 text2 |
         text1 := (wc containerReadStreamFor: entry path) contents asString.
-        text2 := wc branch cat: entry path.
+        text2 := wc cat: entry path revision: rev.
         (Tools::TextDiffTool new)
             labelA: 'Working copy';
             labelB: ('r %1' bindWith: rev printString);
@@ -446,8 +442,16 @@
             open
     ]
 
-    "Modified: / 04-02-2012 / 17:15:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Created: / 09-02-2012 / 14:53:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+doShowDiffsForEntryAgainstHEAD
+
+    self fileSelectionHolder value do:[:each|
+        self doShowDiffsForEntry: each entry against: Revision head
+    ].
+
+    "Created: / 10-02-2012 / 10:00:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !CommitDialog2 methodsFor:'aspects'!