Index: src/main/org/tigris/subversion/svnant/commands/Add.java
===================================================================
--- src/main/org/tigris/subversion/svnant/commands/Add.java (revision 4046)
+++ src/main/org/tigris/subversion/svnant/commands/Add.java (working copy)
@@ -67,7 +67,7 @@
/**
* svn Add. Add a file, a directory or a set of files to repository
- * @author Cédric Chabanois
+ * @author C�dric Chabanois
* cchabanois@ifrance.com
*
*/
@@ -269,7 +269,11 @@
// first : we add directories to the repository
for (int i = 0; i < dirs.length; i++) {
- svnAddFileWithDirs(new File(baseDir, dirs[i]), baseDir);
+ File aDir = new File(baseDir, dirs[i]);
+ svnAddFileWithDirs(aDir, baseDir);
+ if (recurse){
+ visitChildrenDirs(aDir);
+ }
}
// then we add files
@@ -278,6 +282,21 @@
}
}
+ private void visitChildrenDirs(File dir) throws SvnAntException {
+ String[] children = dir.list();
+ for (int i=0; icchabanois@ifrance.com
*
*/
public class SvnTask extends Task implements ISvnAntProjectComponent {
+ // see also org.apache.tools.ant.taskdefs.Echo
+ private static final int CONST_LOG_LEVEL_WARNING = 1;
+ private static final int CONST_LOG_LEVEL_VERBOSE = 3;
+
private static boolean javahlAvailableInitialized = false;
private static boolean javahlAvailable;
private static boolean svnKitAvailableInitialized = false;
@@ -123,6 +132,7 @@
private List commands = new ArrayList();
private List notifyListeners = new ArrayList();
+ private boolean verbose = false;
/* (non-Javadoc)
* @see org.tigris.subversion.svnant.ISvnAntProjectComponent#getJavahl()
@@ -221,6 +231,14 @@
this.failonerror = failonerror;
}
+ /**
+ * Sets whether or not we output the properties we set
+ * @param verbose
+ */
+ public void setVerbose(boolean verbose) {
+ this.verbose = verbose;
+ }
+
public void addCheckout(Checkout a) {
addCommand(a);
}
@@ -229,6 +247,10 @@
addCommand(a);
}
+ public void addCleanup(Cleanup a) {
+ addCommand(a);
+ }
+
public void addCommit(Commit a) {
addCommand(a);
}
@@ -418,6 +440,9 @@
ISVNClientAdapter svnClient = getClientAdapter(this);
+ if (verbose){
+ setLogLevel(CONST_LOG_LEVEL_VERBOSE);
+ }
if (username != null)
svnClient.setUsername(username);
@@ -435,9 +460,24 @@
command.executeCommand(svnClient);
svnClient.removeNotifyListener(feedback);
}
+ if (verbose){
+ setLogLevel(CONST_LOG_LEVEL_WARNING);
+ }
}
+ private void setLogLevel(int logLevel) {
+ Vector listeners = this.getProject().getBuildListeners();
+ for (Iterator i = listeners.iterator(); i.hasNext(); ) {
+ BuildListener listener = (BuildListener) i.next();
+
+ if (listener instanceof BuildLogger) {
+ BuildLogger logger = (BuildLogger) listener;
+ logger.setMessageOutputLevel(logLevel);
+ }
+ }
+ }
+
/**
* This method returns a SVN client adapter, based on the property set when the file selector
* was declared. More specifically, the 'javahl' and 'svnkit' flags are verified, as well as the
@@ -469,4 +509,5 @@
return svnClient;
}
+
}
Index: src/main/org/tigris/subversion/svnant/selectors/Conflicted.java
===================================================================
--- src/main/org/tigris/subversion/svnant/selectors/Conflicted.java (revision 4046)
+++ src/main/org/tigris/subversion/svnant/selectors/Conflicted.java (working copy)
@@ -67,7 +67,11 @@
public class Conflicted extends StatusBasedSelector {
public boolean isSelected(ISVNStatus status_) {
- return ( null != status_.getConflictWorking() );
+ if (status_.getConflictNew() == null){
+ // backward compatible
+ return false;
+ }
+ return ( !status_.getConflictWorking().isDirectory() );
}
}