Changed: #1440 Return list of removed files as well

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent b6127aa582
commit c4460098f1

@ -172,7 +172,7 @@ void CFileStatus::serial(NLMISC::IStream &stream) throw (NLMISC::EStream)
stream.serial(CRC32);
}
void CFileRemoved::serial(NLMISC::IStream &stream) throw (NLMISC::EStream)
void CFileRemove::serial(NLMISC::IStream &stream) throw (NLMISC::EStream)
{
uint version = stream.serialVersion(1);
stream.serial(Lost);
@ -219,11 +219,14 @@ bool CDatabaseStatus::getFileStatus(CFileStatus &fileStatus, const std::string &
return seemsValid;
}
bool CDatabaseStatus::getFileStatus(std::map<std::string, CFileStatus> &fileStatusMap, const std::vector<std::string> &paths)
bool CDatabaseStatus::getFileStatus(std::map<std::string, CFileStatus> &fileStatusMap, std::map<std::string, CFileRemove> &fileRemoveMap, const std::vector<std::string> &paths)
{
nlassert(false); // i don't think this is used? (yet?) (maybe for slave?)
// probably just some ghost code spooking around.
// this code shall be used by the slave to get all the infos
// in the slave it will compare the returned data for example with the last successful build time and return added/changed/removed to the plugin
for (std::vector<std::string>::const_iterator it = paths.begin(), end = paths.end(); it != end; ++it)
{
@ -509,7 +512,7 @@ void updateDirectoryStatus(CDatabaseStatus* ds, CDatabaseStatusUpdater &updater,
// Create the removed tag.
std::string removedTagFile = dirPathMeta + subPathFilename + PIPELINE_DATABASE_REMOVE_SUFFIX;
uint32 time = CTime::getSecondsSince1970();
CFileRemoved removed;
CFileRemove removed;
removed.Lost = time; // Yes you're wasting time, you wouldn't have to delete anything if you did your work properly in the first place! :)
COFile of(removedTagFile, false, false, true);
removed.serial(of);

@ -92,7 +92,7 @@ public:
void serial(NLMISC::IStream &stream) throw (NLMISC::EStream);
};
struct CFileRemoved
struct CFileRemove
{
public:
uint32 Lost; // The time when it was noticed the file was removed.
@ -127,7 +127,7 @@ public:
/// Runs an update of the file status of given paths asynchronously. Warning: If g_IsExiting during callback then update is incomplete. Callback is always called when done (or failed). Do NOT use the wait parameter. Do NOT use recurse, please. Recurse directories beforehand. Paths may contain db and pl macros.
void updateDatabaseStatus(const CCallback<void> &callback, const std::vector<std::string> &paths, bool wait = false, bool recurse = false);
/// Gets the last file statuses of given paths in a map. Directories are scanned for files, non recursively. Returns false if one of the statuses is bad (not updated; file changed inbetween). Considered as build error.
bool getFileStatus(std::map<std::string, CFileStatus> &fileStatusMap, const std::vector<std::string> &paths);
bool getFileStatus(std::map<std::string, CFileStatus> &fileStatusMap, std::map<std::string, CFileRemove> &fileRemoveMap, const std::vector<std::string> &paths);
void getFileErrors(CFileErrors &fileErrors, const std::string &filePath, uint32 newerThan = 0) const;
void addFileError(const std::string &filePath, const CFileError &fileError);

Loading…
Cancel
Save