ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 25645] New: - [BUG][FIX] cvschangelog task - no trace/log in case of error
Date Fri, 19 Dec 2003 10:01:45 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25645>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25645

[BUG][FIX] cvschangelog task - no trace/log in case of error

           Summary: [BUG][FIX] cvschangelog task - no trace/log in case of
                    error
           Product: Ant
           Version: 1.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: tomasz.bech@bull.com.pl


In case of wrong result from cvs, only 'Error running cvs log' is visible. The
fix is to move the displaying of 'error log' from cvs, just after launching the
cvs command. Below you will find the patch. Still one issue:
- cvs is too robust in command cvs log - it often produces proper/good output
but still returns as result 1 (bad) - often when there are some warnings. Maybe
it would be nice to have additional switch: 'ignoreresult'  (cvs result)

Index: ChangeLogTask.java
===================================================================
RCS file:
/home/cvspublic/ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java,v
retrieving revision 1.25
diff -u -r1.25 ChangeLogTask.java
--- ChangeLogTask.java	17 Sep 2003 20:11:43 -0000	1.25
+++ ChangeLogTask.java	19 Dec 2003 09:49:07 -0000
@@ -283,20 +283,20 @@
             exe.setWorkingDirectory(m_dir);
             exe.setCommandline(command.getCommandline());
             exe.setAntRun(getProject());
-            try {
+
+						try {
                 final int resultCode = exe.execute();
 
+								final String errors = handler.getErrors();
+							
+								if (null != errors) {
+									log(errors, Project.MSG_ERR);
+								}
                 if (Execute.isFailure(resultCode)) {
                     throw new BuildException("Error running cvs log");
                 }
             } catch (final IOException ioe) {
                 throw new BuildException(ioe.toString());
-            }
-
-            final String errors = handler.getErrors();
-
-            if (null != errors) {
-                log(errors, Project.MSG_ERR);
             }
 
             final CVSEntry[] entrySet = parser.getEntrySetAsArray();

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message