提交 066d5637 编写于 作者: K kohsuke

[FIXED HUDSON-4930] Allow the build number to be set so long as it's still...

[FIXED HUDSON-4930] Allow the build number to be set so long as it's still bigger than the last build.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@31572 71c3de6d-444a-0410-be80-ed276b4c234a
上级 68a78d2f
......@@ -303,12 +303,13 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
* <p>
* Much of Hudson assumes that the build number is unique and monotonic, so
* this method can only accept a new value that's bigger than
* {@link #getNextBuildNumber()} returns. Otherwise it'll be no-op.
* {@link #getLastBuild()} returns. Otherwise it'll be no-op.
*
* @since 1.199 (before that, this method was package private.)
*/
public synchronized void updateNextBuildNumber(int next) throws IOException {
if (next > nextBuildNumber) {
RunT lb = getLastBuild();
if (lb!=null ? next>lb.getNumber() : next>0) {
this.nextBuildNumber = next;
saveNextBuildNumber();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册