File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 19
19
20
20
/*
21
21
* Copyright (c) 2009, 2011, Jens Elkner.
22
- * Copyright (c) 2009, 2021 , Oracle and/or its affiliates. All rights reserved.
22
+ * Copyright (c) 2009, 2023 , Oracle and/or its affiliates. All rights reserved.
23
23
* Portions Copyright (c) 2020, Chris Fraire <[email protected] >.
24
24
*/
25
25
package org .opengrok .web ;
@@ -91,6 +91,14 @@ public String getRev(int index) {
91
91
return rev [index ];
92
92
}
93
93
94
+ /**
95
+ * @param index index of the revision
96
+ * @return shortened revision string (maximum 8 characters) with ".." appended
97
+ */
98
+ public String getShortRev (int index ) {
99
+ return rev [index ].substring (0 , Integer .min (rev [index ].length (), 8 )) + ".." ;
100
+ }
101
+
94
102
public String [] getFile (int index ) {
95
103
return file [index ];
96
104
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ information: Portions Copyright [yyyy] [name of copyright owner]
16
16
17
17
CDDL HEADER END
18
18
19
- Copyright (c) 2006, 2022 , Oracle and/or its affiliates. All rights reserved.
19
+ Copyright (c) 2006, 2023 , Oracle and/or its affiliates. All rights reserved.
20
20
Portions Copyright 2011 Jens Elkner.
21
21
Portions Copyright (c) 2020, Chris Fraire <[email protected] >.
22
22
--%>
@@ -163,9 +163,9 @@ include file="/mast.jsp"
163
163
if (type == t) {
164
164
% > <span class =" active" ><%= t. toString() % ><%
165
165
if (t == DiffType . OLD ) {
166
- % > ( <%= data. getRev(0 ) % > )<%
166
+ % > (<%= data. getRev(0 ) % > )<%
167
167
} else if (t == DiffType . NEW ) {
168
- % > ( <%= data. getRev(1 ) % > )<%
168
+ % > (<%= data. getRev(1 ) % > )<%
169
169
}
170
170
% > </span ><%
171
171
} else {
@@ -175,9 +175,9 @@ include file="/mast.jsp"
175
175
<%= QueryParameters . DIFF_LEVEL_PARAM_EQ % ><%= full ? ' 1' : ' 0' % >" ><%= t. toString() % >
176
176
<%
177
177
if (t == DiffType . OLD ) {
178
- % > ( <%= data. getRev (0 ) % > )<%
178
+ % > (<%= data. getShortRev (0 ) % > )<%
179
179
} else if (t == DiffType . NEW ) {
180
- % > ( <%= data. getRev (1 ) % > )<%
180
+ % > (<%= data. getShortRev (1 ) % > )<%
181
181
}
182
182
% > </a ></span ><%
183
183
}
You can’t perform that action at this time.
0 commit comments