Changeset 641
- Timestamp:
- 02/02/10 19:59:34 (3 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 2 modified
-
jlatexeditor/JLatexEditorJFrame.java (modified) (2 diffs)
-
jlatexeditor/tools/SVN.java (modified) (4 diffs)
-
util/Pair.java (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/jlatexeditor/JLatexEditorJFrame.java
r638 r641 25 25 import sce.component.*; 26 26 import sce.syntaxhighlighting.SyntaxHighlighting; 27 import util.Pair; 27 28 import util.StreamUtils; 28 29 import util.filechooser.SCEFileChooser; … … 697 698 ""); 698 699 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>"); 705 702 } 706 703 } else -
trunk/src/jlatexeditor/tools/SVN.java
r633 r641 2 2 3 3 import jlatexeditor.errorhighlighting.LatexCompileError; 4 import util.Pair; 4 5 import util.ProcessUtil; 5 6 … … 53 54 } 54 55 55 public synchronized booleancommit(File dir, String message) {56 public synchronized Pair<Boolean,String> commit(File dir, String message) { 56 57 message = message.replace('"', ' '); 57 58 message = message.replace('\\', ' '); … … 62 63 } catch(Exception e){ 63 64 e.printStackTrace(); 64 return false;65 return new Pair<Boolean,String>(false,""); 65 66 } 66 67 67 68 boolean success = true; 68 69 70 StringBuilder builder = new StringBuilder(); 71 69 72 BufferedReader in = new BufferedReader(new InputStreamReader(svn.getInputStream()), 100000); 70 73 try{ 71 74 String line, lastLine = null; 72 75 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 } 74 81 if(line.startsWith("svn: Commit failed")) success = false; 75 82 lastLine = line; … … 77 84 if(lastLine != null && !lastLine.startsWith("Committed revision")) success = false; 78 85 } catch(IOException ignored){ 86 success = false; 87 builder.append("<font color=red><b>Exception: " + ignored.getMessage() + "</b></font>"); 79 88 } 80 89 81 return success;90 return new Pair<Boolean,String>(success, builder.toString()); 82 91 } 83 92
![(please configure the [header_logo] section in trac.ini)](http://jlatexeditor.endrullis.de/chrome/site/logo.png)