Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
e6f60646
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e6f60646
编写于
5月 02, 2017
作者:
A
Andrew Bayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Code review responses
上级
e4b84a2f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
30 deletion
+29
-30
core/src/main/java/hudson/model/Job.java
core/src/main/java/hudson/model/Job.java
+7
-7
core/src/main/java/hudson/model/View.java
core/src/main/java/hudson/model/View.java
+17
-20
core/src/main/java/hudson/scm/SCM.java
core/src/main/java/hudson/scm/SCM.java
+5
-3
未找到文件。
core/src/main/java/hudson/model/Job.java
浏览文件 @
e6f60646
...
...
@@ -1075,14 +1075,14 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
scmNames
.
add
(
s
.
getDescriptor
().
getDisplayName
());
}
scmDisplayName
=
" "
+
Util
.
join
(
scmNames
,
", "
);
}
for
(
RunT
r
=
getLastBuild
();
r
!=
null
;
r
=
r
.
getPreviousBuild
())
{
int
idx
=
0
;
if
(
r
instanceof
RunWithSCMMixIn
.
RunWithSCM
)
{
for
(
ChangeLogSet
<?
extends
ChangeLogSet
.
Entry
>
c
:
((
RunWithSCMMixIn
.
RunWithSCM
<?,?>)
r
).
getChangeSets
())
{
for
(
ChangeLogSet
.
Entry
e
:
c
)
{
entries
.
add
(
new
FeedItem
(
e
,
idx
++));
}
for
(
RunT
r
=
getLastBuild
();
r
!=
null
;
r
=
r
.
getPreviousBuild
())
{
int
idx
=
0
;
if
(
r
instanceof
RunWithSCMMixIn
.
RunWithSCM
)
{
for
(
ChangeLogSet
<?
extends
ChangeLogSet
.
Entry
>
c
:
((
RunWithSCMMixIn
.
RunWithSCM
<?,?>)
r
).
getChangeSets
())
{
for
(
ChangeLogSet
.
Entry
e
:
c
)
{
entries
.
add
(
new
FeedItem
(
e
,
idx
++));
}
}
}
...
...
core/src/main/java/hudson/model/View.java
浏览文件 @
e6f60646
...
...
@@ -116,7 +116,6 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_BAD_REQUEST
;
import
static
jenkins
.
model
.
Jenkins
.
checkGoodName
;
import
static
jenkins
.
scm
.
RunWithSCMMixIn
.*;
import
org.kohsuke.accmod.Restricted
;
...
...
@@ -253,7 +252,7 @@ public abstract class View extends AbstractModelObject implements AccessControll
*/
public
void
rename
(
String
newName
)
throws
Failure
,
FormException
{
if
(
name
.
equals
(
newName
))
return
;
// noop
checkGoodName
(
newName
);
Jenkins
.
checkGoodName
(
newName
);
if
(
owner
.
getView
(
newName
)!=
null
)
throw
new
FormException
(
Messages
.
Hudson_ViewAlreadyExists
(
newName
),
"name"
);
String
oldName
=
name
;
...
...
@@ -730,23 +729,21 @@ public abstract class View extends AbstractModelObject implements AccessControll
Map
<
User
,
UserInfo
>
users
=
new
HashMap
<
User
,
UserInfo
>();
for
(
Item
item
:
items
)
{
for
(
Job
<?,
?>
job
:
item
.
getAllJobs
())
{
if
(
job
instanceof
SCMTriggerItem
)
{
RunList
<?
extends
Run
<?,
?>>
runs
=
job
.
getBuilds
();
for
(
Run
<?,
?>
r
:
runs
)
{
if
(
r
instanceof
RunWithSCM
)
{
RunWithSCM
<?,?>
runWithSCM
=
(
RunWithSCM
<?,?>)
r
;
RunList
<?
extends
Run
<?,
?>>
runs
=
job
.
getBuilds
();
for
(
Run
<?,
?>
r
:
runs
)
{
if
(
r
instanceof
RunWithSCM
)
{
RunWithSCM
<?,?>
runWithSCM
=
(
RunWithSCM
<?,?>)
r
;
for
(
ChangeLogSet
<?
extends
Entry
>
c
:
runWithSCM
.
getChangeSets
())
{
for
(
Entry
entry
:
c
)
{
User
user
=
entry
.
getAuthor
();
for
(
ChangeLogSet
<?
extends
Entry
>
c
:
runWithSCM
.
getChangeSets
())
{
for
(
Entry
entry
:
c
)
{
User
user
=
entry
.
getAuthor
();
UserInfo
info
=
users
.
get
(
user
);
if
(
info
==
null
)
users
.
put
(
user
,
new
UserInfo
(
user
,
job
,
r
.
getTimestamp
()));
else
if
(
info
.
getLastChange
().
before
(
r
.
getTimestamp
()))
{
info
.
project
=
job
;
info
.
lastChange
=
r
.
getTimestamp
();
}
UserInfo
info
=
users
.
get
(
user
);
if
(
info
==
null
)
users
.
put
(
user
,
new
UserInfo
(
user
,
job
,
r
.
getTimestamp
()));
else
if
(
info
.
getLastChange
().
before
(
r
.
getTimestamp
()))
{
info
.
project
=
job
;
info
.
lastChange
=
r
.
getTimestamp
();
}
}
}
...
...
@@ -1055,7 +1052,7 @@ public abstract class View extends AbstractModelObject implements AccessControll
}
try
{
checkGoodName
(
value
);
Jenkins
.
checkGoodName
(
value
);
value
=
value
.
trim
();
// why trim *after* checkGoodName? not sure, but ItemGroupMixIn.createTopLevelItem does the same
Jenkins
.
getInstance
().
getProjectNamingStrategy
().
checkName
(
value
);
}
catch
(
Failure
e
)
{
...
...
@@ -1308,7 +1305,7 @@ public abstract class View extends AbstractModelObject implements AccessControll
||
requestContentType
.
startsWith
(
"text/xml"
));
String
name
=
req
.
getParameter
(
"name"
);
checkGoodName
(
name
);
Jenkins
.
checkGoodName
(
name
);
if
(
owner
.
getView
(
name
)!=
null
)
throw
new
Failure
(
Messages
.
Hudson_ViewAlreadyExists
(
name
));
...
...
@@ -1370,7 +1367,7 @@ public abstract class View extends AbstractModelObject implements AccessControll
try
(
InputStream
in
=
new
BufferedInputStream
(
xml
))
{
View
v
=
(
View
)
Jenkins
.
XSTREAM
.
fromXML
(
in
);
if
(
name
!=
null
)
v
.
name
=
name
;
checkGoodName
(
v
.
name
);
Jenkins
.
checkGoodName
(
v
.
name
);
return
v
;
}
catch
(
StreamException
|
ConversionException
|
Error
e
)
{
// mostly reflection errors
throw
new
IOException
(
"Unable to read"
,
e
);
...
...
core/src/main/java/hudson/scm/SCM.java
浏览文件 @
e6f60646
...
...
@@ -526,8 +526,10 @@ public abstract class SCM implements Describable<SCM>, ExtensionPoint {
* can be before/after your checkout method is invoked. So if you are going to provide information about
* check out (like SVN revision number that was checked out), be prepared for the possibility that the
* check out hasn't happened yet.
*
* @since FIXME
*/
public
void
buildEnv
Vars
(
@Nonnull
Run
<?,?>
build
,
@Nonnull
Map
<
String
,
String
>
env
)
{
public
void
buildEnv
ironment
(
@Nonnull
Run
<?,?>
build
,
@Nonnull
Map
<
String
,
String
>
env
)
{
if
(
build
instanceof
AbstractBuild
)
{
buildEnvVars
((
AbstractBuild
)
build
,
env
);
}
...
...
@@ -535,8 +537,8 @@ public abstract class SCM implements Describable<SCM>, ExtensionPoint {
@Deprecated
public
void
buildEnvVars
(
AbstractBuild
<?,?>
build
,
Map
<
String
,
String
>
env
)
{
if
(
Util
.
isOverridden
(
SCM
.
class
,
getClass
(),
"buildEnv
Vars
"
,
Run
.
class
,
Map
.
class
))
{
buildEnv
Vars
((
Run
)
build
,
env
);
if
(
Util
.
isOverridden
(
SCM
.
class
,
getClass
(),
"buildEnv
ironment
"
,
Run
.
class
,
Map
.
class
))
{
buildEnv
ironment
(
build
,
env
);
}
// default implementation is noop.
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录