File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
main/java/org/opengrok/indexer/history
test/java/org/opengrok/indexer/history Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,11 @@ public class SCCSRepository extends Repository {
62
62
63
63
public SCCSRepository () {
64
64
type = "SCCS" ;
65
+ /*
66
+ * Originally there was only the "yy/MM/dd" pattern however the newer SCCS implementations seem
67
+ * to use the time as well. Some historical SCCS versions might still use that, so it is left there
68
+ * for potential compatibility.
69
+ */
65
70
datePatterns = new String []{
66
71
"yy/MM/dd HH:mm:ss" ,
67
72
"yy/MM/dd"
Original file line number Diff line number Diff line change @@ -144,6 +144,12 @@ void testGetHistory() throws Exception {
144
144
assertTrue (file .isFile ());
145
145
History history = sccsRepository .getHistory (file );
146
146
assertNotNull (history );
147
+ /*
148
+ * SCCSRepository code parses the contents of the "s." files directly.
149
+ * The time strings embedded therein do not contain time zone so the expected date values
150
+ * in the HistoryEntry list are constructed using zone-less time value
151
+ * instead of time stamp in long to avoid mismatch due to time zone recalculation.
152
+ */
147
153
DateFormat dateFormat = new SimpleDateFormat ("EEE MMM dd HH:mm:ss yyyy" );
148
154
List <HistoryEntry > entries = List .of (
149
155
new HistoryEntry ("1.2" , dateFormat .parse ("Tue Aug 12 22:11:54 2008" ),
You can’t perform that action at this time.
0 commit comments