Skip to content

Commit 6915308

Browse files
committed
add explanatory comments
1 parent 7794711 commit 6915308

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/SCCSRepository.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ public class SCCSRepository extends Repository {
6262

6363
public SCCSRepository() {
6464
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+
*/
6570
datePatterns = new String[]{
6671
"yy/MM/dd HH:mm:ss",
6772
"yy/MM/dd"

opengrok-indexer/src/test/java/org/opengrok/indexer/history/SCCSRepositoryTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ void testGetHistory() throws Exception {
144144
assertTrue(file.isFile());
145145
History history = sccsRepository.getHistory(file);
146146
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+
*/
147153
DateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy");
148154
List<HistoryEntry> entries = List.of(
149155
new HistoryEntry("1.2", dateFormat.parse("Tue Aug 12 22:11:54 2008"),

0 commit comments

Comments
 (0)