Changeset 641

Show
Ignore:
Timestamp:
02/02/10 19:59:34 (3 years ago)
Author:
joerg
Message:
 
Location:
trunk/src
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/jlatexeditor/JLatexEditorJFrame.java

    r638 r641  
    2525import sce.component.*; 
    2626import sce.syntaxhighlighting.SyntaxHighlighting; 
     27import util.Pair; 
    2728import util.StreamUtils; 
    2829import util.filechooser.SCEFileChooser; 
     
    697698                          ""); 
    698699      if(message != null) { 
    699         boolean committed = SVN.getInstance().commit(getMainEditor().getFile().getParentFile(), message); 
    700         if(committed) { 
    701           statusBar.showMessage("SVN commit", "SVN commit succeeded"); 
    702         } else { 
    703           statusBar.showMessage("SVN commit failed", "SVN commit failed"); 
    704         } 
     700        Pair<Boolean,String> result = SVN.getInstance().commit(getMainEditor().getFile().getParentFile(), message); 
     701        statusBar.showMessage("SVN commit", "<html>SVN commit:<br><br>" + result.second + "</html>"); 
    705702      } 
    706703    } else 
  • trunk/src/jlatexeditor/tools/SVN.java

    r633 r641  
    22 
    33import jlatexeditor.errorhighlighting.LatexCompileError; 
     4import util.Pair; 
    45import util.ProcessUtil; 
    56 
     
    5354  } 
    5455 
    55   public synchronized boolean commit(File dir, String message) { 
     56  public synchronized Pair<Boolean,String> commit(File dir, String message) { 
    5657    message = message.replace('"', ' '); 
    5758    message = message.replace('\\', ' '); 
     
    6263    } catch(Exception e){ 
    6364      e.printStackTrace(); 
    64       return false; 
     65      return new Pair<Boolean,String>(false,""); 
    6566    } 
    6667 
    6768    boolean success = true; 
    6869 
     70    StringBuilder builder = new StringBuilder(); 
     71     
    6972    BufferedReader in = new BufferedReader(new InputStreamReader(svn.getInputStream()), 100000); 
    7073    try{ 
    7174      String line, lastLine = null; 
    7275      while((line = in.readLine()) != null){ 
    73         System.out.println(line); 
     76        if(line.startsWith("svn:")) { 
     77          builder.append("<font color=red><b>" + line + "</b></font><br>"); 
     78        } else { 
     79          builder.append(line + "<br>"); 
     80        } 
    7481        if(line.startsWith("svn: Commit failed")) success = false; 
    7582        lastLine = line; 
     
    7784      if(lastLine != null && !lastLine.startsWith("Committed revision")) success = false; 
    7885    } catch(IOException ignored){ 
     86      success = false; 
     87      builder.append("<font color=red><b>Exception: " + ignored.getMessage() + "</b></font>"); 
    7988    } 
    8089 
    81     return success; 
     90    return new Pair<Boolean,String>(success, builder.toString()); 
    8291  } 
    8392