Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
Clarifying comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pimotte committed May 12, 2015
1 parent a7243d3 commit b6c3924
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Expand Up @@ -247,13 +247,18 @@ public PartialFileHistory getFileHistoryWithLastVersionByPath(String path) {
return null;
}

// Find for the latest file history the last file version to check if the file has moved
// Get the last FileVersion of the FileHistory in the database with the largest vectorclock.
PartialFileHistory fileHistory = getLastVersionByFileHistoryId(latestFileHistoryId);

// The above query does not guarantee the resulting version is the last in its
// history. We need to check this before returning the file.
if (fileHistory.getLastVersion().getVersion() == latestFileVersion) {
return fileHistory;
}
else {
// The version retrieved by the path query is not a fileversion which is in the current
// filetree. Since it was the last version with this path, there is no other history
// which should be continued.
return null;
}
}
Expand Down
Expand Up @@ -7,7 +7,10 @@
-- - Rule out deleted versions (where)
--
-- Please note: It is important that the initial inner select (fvmax) does not rule out deleted versions, as this has caused trouble in the past

--
-- Note that we only select the newest version from every filehistory, since we use this query to
-- find filehistories to build on, so older versions are not needed. In addition, we only consider
-- versions in MASTER, since we can't build on DIRTY databases.
SELECT fvmax.version AS version,
fvmax.filehistory_id AS filehistory_id,
dbv.vectorclock_serialized AS vectorclock_serialized
Expand Down

0 comments on commit b6c3924

Please sign in to comment.