mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 14:02:22 +00:00
Merged revisions 24685-24686,24706,24708,24710,24713 via svnmerge from
https://svn.dev.java.net/svn/hudson/branches/rc ........ r24685 | kohsuke | 2009-12-17 11:42:34 -0800 (Thu, 17 Dec 2009) | 1 line CR6842690. if the parent directory is missing, create it. ........ r24686 | kohsuke | 2009-12-17 12:07:35 -0800 (Thu, 17 Dec 2009) | 1 line doc improvement ........ r24706 | kohsuke | 2009-12-18 15:29:32 -0800 (Fri, 18 Dec 2009) | 1 line fixed the problem pointed out by Alan in http://n4.nabble.com/Queue-Task-isConcurrent-tp974571p974571.html ........ r24708 | kohsuke | 2009-12-18 18:29:14 -0800 (Fri, 18 Dec 2009) | 1 line [maven-release-plugin] prepare release hudson-1_338 ........ r24710 | kohsuke | 2009-12-18 18:29:25 -0800 (Fri, 18 Dec 2009) | 1 line [maven-release-plugin] prepare for next development iteration ........ r24713 | kohsuke | 2009-12-18 19:05:36 -0800 (Fri, 18 Dec 2009) | 1 line updated changelog as a part of the release ........ git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@24715 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
d08181bb82
commit
df8bdd42c5
13 files changed
+36
-18
No files matched your search
@@ -247,7 +247,7 @@ public class Queue extends ResourceController implements Saveable {
|
||||
int maxId = 0;
|
||||
for (Object o : list) {
|
||||
if (o instanceof Task) {
|
||||
// backward compatiblity
|
||||
// backward compatibility
|
||||
schedule((Task)o, 0);
|
||||
} else if (o instanceof Item) {
|
||||
Item item = (Item)o;
|
||||
@@ -477,7 +477,7 @@ public class Queue extends ResourceController implements Saveable {
|
||||
|
||||
/**
|
||||
* @deprecated as of 1.311
|
||||
* Use {@link #schedule(Task, int, Action[])}
|
||||
* Use {@link #schedule(Task, int, Action...)}
|
||||
*/
|
||||
public synchronized boolean add(Task p, int quietPeriod, Action... actions) {
|
||||
return schedule(p, quietPeriod, actions)!=null;
|
||||
@@ -838,10 +838,16 @@ public class Queue extends ResourceController implements Saveable {
|
||||
* Make sure we don't queue two tasks of the same project to be built
|
||||
* unless that project allows concurrent builds.
|
||||
*/
|
||||
private boolean allowNewBuildableTask (Task t) {
|
||||
return t.isConcurrentBuild() || !buildables.containsKey(t);
|
||||
private boolean allowNewBuildableTask(Task t) {
|
||||
try {
|
||||
if (t.isConcurrentBuild())
|
||||
return true;
|
||||
} catch (AbstractMethodError e) {
|
||||
// earlier versions don't have the "isConcurrentBuild" method, so fall back gracefully
|
||||
}
|
||||
return !buildables.containsKey(t);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Queue maintenance.
|
||||
* <p>
|
||||
@@ -1047,6 +1053,8 @@ public class Queue extends ResourceController implements Saveable {
|
||||
|
||||
/**
|
||||
* True if the task allows concurrent builds
|
||||
*
|
||||
* @since 1.338
|
||||
*/
|
||||
boolean isConcurrentBuild();
|
||||
}
|
||||
|
||||
@@ -59,10 +59,12 @@ public class AtomicFileWriter extends Writer {
|
||||
* File encoding to write. If null, platform default encoding is chosen.
|
||||
*/
|
||||
public AtomicFileWriter(File f, String encoding) throws IOException {
|
||||
File dir = f.getParentFile();
|
||||
try {
|
||||
tmpFile = File.createTempFile("atomic",null,f.getParentFile());
|
||||
dir.mkdirs();
|
||||
tmpFile = File.createTempFile("atomic",null, dir);
|
||||
} catch (IOException e) {
|
||||
throw new IOException2("Failed to create a temporary file in "+f.getParentFile(),e);
|
||||
throw new IOException2("Failed to create a temporary file in "+ dir,e);
|
||||
}
|
||||
destFile = f;
|
||||
if (encoding==null)
|
||||
|
||||
Reference in new issue
Block a user