提交 196e8506 编写于 作者: J jglick

[FIXED HUDSON-3361] Programmatically created jobs started builds at #0 rather than #1.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16593 71c3de6d-444a-0410-be80-ed276b4c234a
上级 fa0135f9
......@@ -155,7 +155,7 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
throw new IOException2(f + " doesn't contain a number", e);
}
} else {
// this must be the old Hudson. create this file now.
// From the old Hudson, or doCreateItem. Create this file now.
saveNextBuildNumber();
save(); // and delete it from the config.xml
}
......@@ -191,6 +191,9 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
}
protected void saveNextBuildNumber() throws IOException {
if (nextBuildNumber == 0) { // #3361
nextBuildNumber = 1;
}
getNextBuildNumberFile().write(String.valueOf(nextBuildNumber) + '\n');
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册