1.1 --- a/vcscore/src/org/netbeans/modules/vcscore/cmdline/UserCommandTask.java Mon Oct 18 13:22:20 2004 +0000
1.2 +++ b/vcscore/src/org/netbeans/modules/vcscore/cmdline/UserCommandTask.java Mon Oct 18 14:53:16 2004 +0000
1.3 @@ -723,6 +723,7 @@
1.4 //System.out.println("canRun("+cmd.getName()+")");
1.5 // Do not check the maximum number of running commands -- this is checked in CommandProcessor
1.6 Collection files = vce.getFiles();
1.7 + //System.out.println(" Files = "+files);
1.8 int concurrency = VcsCommandIO.getIntegerPropertyAssumeZero(cmd,
1.9 VcsCommand.PROPERTY_CONCURRENT_EXECUTION);
1.10 String concurrencyWith = (String) cmd.getProperty(VcsCommand.PROPERTY_CONCURRENT_EXECUTION_WITH);
1.11 @@ -767,6 +768,14 @@
1.12 synchronized (runningTasks) {
1.13 tasksToTest = new HashSet(runningTasks);
1.14 }
1.15 + /*
1.16 + System.out.print(" Running tasks: ");
1.17 + for (Iterator iter = tasksToTest.iterator(); iter.hasNext(); ) {
1.18 + UserCommandTask cwTest = (UserCommandTask) iter.next();
1.19 + System.out.print(cwTest.getName()+", ");
1.20 + }
1.21 + System.out.println((tasksToTest.size() > 0) ? "\b\b" : "");
1.22 + */
1.23 Set pendingTasksToTest;
1.24 if (serialWithPending || concurrencyWith != null) {
1.25 //tasksToTest = new HashSet(runningTasks);
1.26 @@ -781,6 +790,14 @@
1.27 }
1.28 }
1.29 }
1.30 + /*
1.31 + System.out.print(" Pending tasks: ");
1.32 + for (Iterator iter = pendingTasksToTest.iterator(); iter.hasNext(); ) {
1.33 + UserCommandTask cwTest = (UserCommandTask) iter.next();
1.34 + System.out.print(cwTest.getName()+", ");
1.35 + }
1.36 + System.out.println((pendingTasksToTest.size() > 0) ? "\b\b" : "");
1.37 + */
1.38 tasksToTest.addAll(pendingTasksToTest);
1.39 } else {
1.40 pendingTasksToTest = Collections.EMPTY_SET;
1.41 @@ -799,15 +816,21 @@
1.42 haveToWait = true;
1.43 break;
1.44 }
1.45 + boolean isPending = pendingTasksToTest.contains(cwTest);
1.46 + // Do not test some properties with pending commands,
1.47 + // otherwise the command would never be run if there are
1.48 + // two pending commands with that behavior.
1.49 haveToWait = matchSerial(name, cmdName, files, cmdFiles,
1.50 - serialOnFile, serialOnPackage,
1.51 - serialWithParent, serialOfCommand);
1.52 + isPending ? false : serialOnFile,
1.53 + isPending ? false : serialOnPackage,
1.54 + serialWithParent,
1.55 + isPending ? false : serialOfCommand);
1.56 if (!haveToWait) {
1.57 if ((cmdConcurrency & VcsCommand.EXEC_SERIAL_ALL) != 0) {
1.58 haveToWait = true;
1.59 break;
1.60 }
1.61 - if (!pendingTasksToTest.contains(cwTest)) {
1.62 + if (!isPending) {
1.63 haveToWait = matchSerial(cmdName, name, cmdFiles, files,
1.64 (cmdConcurrency & VcsCommand.EXEC_SERIAL_ON_FILE) != 0,
1.65 (cmdConcurrency & VcsCommand.EXEC_SERIAL_ON_PACKAGE) != 0,
1.66 @@ -870,6 +893,7 @@
1.67 Collection files, Collection files2,
1.68 boolean serialOnFile, boolean serialOnPackage,
1.69 boolean serialWithParent, boolean serialOfCommand) {
1.70 + //System.out.println("matchSerial("+name+", "+name2+", "+files+", "+files2+", "+serialOnFile+", "+serialOnPackage+", "+serialWithParent+", "+serialOfCommand+")");
1.71 boolean matchOnFile = false;
1.72 boolean matchOnPackage = false;
1.73 boolean matchWithParent = false;
1.74 @@ -898,6 +922,7 @@
1.75 }
1.76 // if (serialOfCommand && !matchOfCommand) do not wait
1.77 //System.out.println(" matchOnFile = "+matchOnFile+", matchOnPackage = "+matchOnPackage+", matchWithParent = "+matchWithParent+", matchOfCommand = "+matchOfCommand);
1.78 + //System.out.println("return "+((!serialOfCommand || matchOfCommand) && (matchOnFile || matchOnPackage || matchWithParent || matchOfCommand)));
1.79 return (!serialOfCommand || matchOfCommand) && (matchOnFile || matchOnPackage || matchWithParent || matchOfCommand);
1.80 }
1.81