Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r3975 - branches/GSoC2008/gimenete/org.tigris.subversion.subclipse.graph/src/org/tigris/subversion: subclipse/graph/editors sublicpse/graph/cache

subclipse
Discussion topic

Back to topic list

svn commit: r3975 - branches/GSoC2008/gimenete/org.tigris.subversion.subclipse.graph/src/org/tigris/subversion: subclipse/graph/editors sublicpse/graph/cache

Author gimenete
Full name Alberto Gimeno
Date 2008-08-28 09:30:09 PDT
Message Author: gimenete
Date: 2008-08-28 09:30:08-0700
New Revision: 3975

Modified:
   branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/subclipse​/graph/editors/Graph​EditPart.java
   branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/sublicpse​/graph/cache/Cache.j​ava
   branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/sublicpse​/graph/cache/LogMess​age.java
   branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/sublicpse​/graph/cache/Node.ja​va

Log:
Merge information now is shown in the revision graph.

Modified: branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/subclipse​/graph/editors/Graph​EditPart.java
Url: http://subclipse.tig​ris.org/source/brows​e/subclipse/branches​/GSoC2008/gimenete/o​rg.tigris.subversion​.subclipse.graph/src​/org/tigris/subversi​on/subclipse/graph/e​ditors/GraphEditPart​.java?view=diff&​rev=3975&p1=bran​ches/GSoC2008/gimene​te/org.tigris.subver​sion.subclipse.graph​/src/org/tigris/subv​ersion/subclipse/gra​ph/editors/GraphEdit​Part.java&p2=bra​nches/GSoC2008/gimen​ete/org.tigris.subve​rsion.subclipse.grap​h/src/org/tigris/sub​version/subclipse/gr​aph/editors/GraphEdi​tPart.java&r1=39​74&r2=3975
====================​====================​====================​==================
--- branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/subclipse​/graph/editors/Graph​EditPart.java (original)
+++ branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/subclipse​/graph/editors/Graph​EditPart.java 2008-08-28 09:30:08-0700
@@ -149,6 +149,29 @@
                 }
             }
         }
+
+ // merged connections
+ for (Iterator iter = paths.iterator(); iter.hasNext(); i++) {
+ String path = (String) iter.next();
+ Branch branch = graph.getBranch(path);
+ if(branch.getView() != null) {
+ for (Iterator it = branch.getNodes().iterator(); it.hasNext();) {
+ Node node = (Node) it.next();
+ List mergedRevisions = node.getMergedRevisions();
+ if(mergedRevisions == null)
+ continue;
+
+ NodeFigure nodeFigure = (NodeFigure) node.getView();
+ for (Iterator iterator = node.getMergedRevisi​ons().iterator(); iterator
+ .hasNext();) {
+ Node merged = (Node) iterator.next();
+ NodeFigure mergedView = (NodeFigure) merged.getView();
+ if(mergedView != null)
+ makeConnection(contents, mergedView, nodeFigure, ColorConstants.red);
+ }
+ }
+ }
+ }
 
         // end layouts
         for (Iterator iter = paths.iterator(); iter.hasNext(); i++) {
@@ -176,8 +199,12 @@
 
         return contents;
     }
-
+
     private PolylineConnection makeConnection(IFigure contents, IFigure source, NodeFigure target) {
+ return makeConnection(contents, source, target, CONNECTION_COLOR);
+ }
+
+ private PolylineConnection makeConnection(IFigure contents, IFigure source, NodeFigure target, Color color) {
         PolylineConnection c = new PolylineConnection();
         ConnectionAnchor targetAnchor = new ChopboxAnchor(target);
         c.setTargetAnchor(ta​rgetAnchor);
@@ -185,7 +212,7 @@
         PolygonDecoration decoration = new PolygonDecoration();
         decoration.setTempla​te(PolygonDecoration​.TRIANGLE_TIP);
         c.setTargetDecoratio​n(decoration);
- c.setForegroundColor​(CONNECTION_COLOR);
+ c.setForegroundColor(color);
         ConnectionMouseListener listener = new ConnectionMouseListener(c);
         c.addMouseMotionList​ener(listener);
         c.addMouseListener(listener);

Modified: branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/sublicpse​/graph/cache/Cache.j​ava
Url: http://subclipse.tig​ris.org/source/brows​e/subclipse/branches​/GSoC2008/gimenete/o​rg.tigris.subversion​.subclipse.graph/src​/org/tigris/subversi​on/sublicpse/graph/c​ache/Cache.java?view​=diff&rev=3975​&p1=branches/GSoC2​008/gimenete/org.tig​ris.subversion.subcl​ipse.graph/src/org/t​igris/subversion/sub​licpse/graph/cache/C​ache.java&p2=bra​nches/GSoC2008/gimen​ete/org.tigris.subve​rsion.subclipse.grap​h/src/org/tigris/sub​version/sublicpse/gr​aph/cache/Cache.java​&r1=3974&r2=​3975
====================​====================​====================​==================
--- branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/sublicpse​/graph/cache/Cache.j​ava (original)
+++ branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/sublicpse​/graph/cache/Cache.j​ava 2008-08-28 09:30:08-0700
@@ -137,8 +137,10 @@
             } else {
                 if(level == 1) {
                     children.add(logMessage);
+// dump(logMessage, level);
                 } else if(level == 0) {
                     writeLogMessage(logMessage, level);
+// dump(logMessage, level);
                 }
                 
                 if(logMessage.hasChildren()) {
@@ -161,7 +163,10 @@
     }
     
     /*
- private void dump(ISVNLogMessage logMessage, String p) {
+ private void dump(ISVNLogMessage logMessage, int level) {
+ char[] c = new char[level];
+ Arrays.fill(c, '\t');
+ String p = new String(c);
         System.out.println(p+"rev : "+logMessage.getRevi​sion().getNumber());​
         System.out.println(p+"author: "+logMessage.getAuthor());
         ISVNLogMessageChangePath[] cps = logMessage.getChangedPaths();
@@ -171,14 +176,7 @@
             if(cp.getCopySrcPath() != null)
                 System.out.println(p+"copy: "+cp.getCopySrcPath());
         }
- ISVNLogMessage[] childMessages = logMessage.getChildMessages();
         System.out.println(p+"has children: "+logMessage.hasChildren());
- if(childMessages != null) {
- System.out.println(p+"child messages...");
- for (int i = 0; i < childMessages.length; i++) {
- dump(childMessages[i], p+"\t");
- }
- }
         System.out.println();
     }
     */
@@ -292,6 +290,7 @@
                     for (int i = 0; i < children; i++) {
                         childMessages[i] = readNext(file, false);
                     }
+ logMessage.setChildM​essages(childMessage​s);
                 }
             }
             
@@ -331,13 +330,14 @@
                 ISVNLogMessage lm = readNext(file, true);
 
                 ISVNLogMessageChangePath[] changedPaths = lm.getChangedPaths();
+ String[] pa = graph.getPathsAsArray();
+ Node node = null;
                 for(int n=0; n<changedPaths.length; n++) {
                     ISVNLogMessageChangePath cp = changedPaths[n];
 
                     String nodePath = cp.getPath();
                     String copySrcPath = cp.getCopySrcPath();
 
- String[] pa = graph.getPathsAsArray();
                     for (int i = 0; i < pa.length; i++) {
                         String branchPath = pa[i];
 
@@ -357,7 +357,7 @@
                                     // the branch was ended with a D action
                                     continue;
                                 }
- Node node = toNode(lm, cp);
+ node = toNode(lm, cp);
                                 node.setParent(branc​h.getLastNode());
                                 branch.addNode(node);
                                 if(node.getAction() == 'D') {
@@ -369,7 +369,7 @@
                             Node source = branch.getSource(cp.​getCopySrcRevision()​.getNumber());
                             if(source == null)
                                 continue;
- Node node = toNode(lm, cp);
+ node = toNode(lm, cp);
                             node.setSource(source);
                             String path = nodePath + branchPath.substring​(copySrcPath.length(​));
                             Branch newBranch = graph.getBranch(path);
@@ -380,6 +380,32 @@
                         }
                     }
                 }
+
+ if(node != null && lm.hasChildren()) {
+ ISVNLogMessage[] cm = lm.getChildMessages();
+ for (int i = 0; i < cm.length; i++) {
+ ISVNLogMessage child = cm[i];
+ ISVNLogMessageChangePath[] cp = child.getChangedPaths();
+
+ for (int j = 0; j < cp.length; j++) {
+ ISVNLogMessageChangePath changePath = cp[j];
+
+ for(int k=0; k<pa.length; k++) {
+ String path = pa[k];
+ if(path.equals(chang​ePath.getPath())) {
+ Branch branch = graph.getBranch(path);
+ Node source = branch.getSource(chi​ld.getRevision().get​Number());
+ if(source == null)
+ continue;
+ // add connection between "node" and "source"
+ node.addMergedRevision(source);
+ }
+ }
+ }
+ }
+ }
+
+
                 if(listener != null)
                     listener.worked();
             }

Modified: branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/sublicpse​/graph/cache/LogMess​age.java
Url: http://subclipse.tig​ris.org/source/brows​e/subclipse/branches​/GSoC2008/gimenete/o​rg.tigris.subversion​.subclipse.graph/src​/org/tigris/subversi​on/sublicpse/graph/c​ache/LogMessage.java​?view=diff&rev=3​975&p1=branches/​GSoC2008/gimenete/or​g.tigris.subversion.​subclipse.graph/src/​org/tigris/subversio​n/sublicpse/graph/ca​che/LogMessage.java​&p2=branches/GSoC​2008/gimenete/org.ti​gris.subversion.subc​lipse.graph/src/org/​tigris/subversion/su​blicpse/graph/cache/​LogMessage.java&​r1=3974&r2=3975
====================​====================​====================​==================
--- branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/sublicpse​/graph/cache/LogMess​age.java (original)
+++ branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/sublicpse​/graph/cache/LogMess​age.java 2008-08-28 09:30:08-0700
@@ -59,7 +59,7 @@
     }
     
     public boolean hasChildren() {
- throw new RuntimeException("Method not implemented");
+ return childMessages != null;
     }
 
     public void setChangedPaths(LogM​essageChangePath[] changedPaths) {

Modified: branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/sublicpse​/graph/cache/Node.ja​va
Url: http://subclipse.tig​ris.org/source/brows​e/subclipse/branches​/GSoC2008/gimenete/o​rg.tigris.subversion​.subclipse.graph/src​/org/tigris/subversi​on/sublicpse/graph/c​ache/Node.java?view=​diff&rev=3975​&p1=branches/GSoC20​08/gimenete/org.tigr​is.subversion.subcli​pse.graph/src/org/ti​gris/subversion/subl​icpse/graph/cache/No​de.java&p2=branc​hes/GSoC2008/gimenet​e/org.tigris.subvers​ion.subclipse.graph/​src/org/tigris/subve​rsion/sublicpse/grap​h/cache/Node.java​&r1=3974&r2=397​5
====================​====================​====================​==================
--- branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/sublicpse​/graph/cache/Node.ja​va (original)
+++ branches/GSoC2008/gi​menete/org.tigris.su​bversion.subclipse.g​raph/src/org/tigris/​subversion/sublicpse​/graph/cache/Node.ja​va 2008-08-28 09:30:08-0700
@@ -2,11 +2,13 @@
 
 import java.io.Serializable;
 import java.text.MessageFormat;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 public class Node implements Serializable {
     
- private static final long serialVersionUID = 7429624234964583545L;
+ private static final long serialVersionUID = 2835522933811459843L;
     
     // fields read from log messages
     private long revision;
@@ -24,6 +26,8 @@
     private int childCount;
     private transient Object view;
     
+ private List mergedRevisions;
+
     public Node() {
     }
     
@@ -130,4 +134,15 @@
             source.childCount++;
     }
     
+ public List getMergedRevisions() {
+ return mergedRevisions;
+ }
+
+ public void addMergedRevision(Node node) {
+ if(mergedRevisions == null) {
+ mergedRevisions = new ArrayList();
+ }
+ mergedRevisions.add(node);
+ }
+
 }

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r3975 - branches/GSoC2008/gimenete/org.tigris.subversion.subclipse.graph/src/org/tigris/subversion: subclipse/graph/editors sublicpse/graph/cache gimenete Alberto Gimeno 2008-08-28 09:30:09 PDT
Messages per page: