Skip to content

Commit

Permalink
WIP: git-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Andersbakken committed Dec 3, 2016
1 parent 53dfc3b commit 423953e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ bool Project::readSources(const Path &path, IndexParseData &data, String *err)
}

file >> data;

if (Sandbox::hasRoot()) {
forEachSource(data, [](Source &source) {
for (String &arg : source.arguments) {
Expand Down Expand Up @@ -709,6 +710,7 @@ void Project::onJobFinished(const std::shared_ptr<IndexerJob> &job, const std::s
updateDependencies(msg);
if (success) {
forEachSources([&msg](Sources &sources) -> VisitResult {
// error() << "finished with" << Location::path(msg->fileId()) << sources.contains(msg->fileId()) << msg->parseTime();
if (sources.contains(msg->fileId())) {
auto &ref = sources[msg->fileId()];
for (Source &src : ref) {
Expand Down Expand Up @@ -746,6 +748,7 @@ void Project::onJobFinished(const std::shared_ptr<IndexerJob> &job, const std::s

// error() << "Finished this
} else {
error() << mActiveJobs.size();
mSaveDirty = true;
}
}
Expand Down Expand Up @@ -1085,6 +1088,7 @@ int Project::startDirtyJobs(Dirty *dirty, IndexerJob::Flag flag,
const JobScheduler::JobScope scope(Server::instance()->jobScheduler());
Set<uint32_t> toIndex;
forEachSource([dirty, &toIndex](const Source &src) -> VisitResult {
error() << "STARTING DIRTY" << Location::path(src.fileId) << src.parsed;
if (dirty->isDirty(src))
toIndex.insert(src.fileId);
return Continue;
Expand Down
2 changes: 2 additions & 0 deletions src/Source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,7 @@ void Source::encode(Serializer &s, EncodeMode mode) const
s << incPaths << Sandbox::encoded(arguments)
<< sysRootIndex << Sandbox::encoded(directory) << includePathHash;
} else {
error() << "SENT A DUDE" << sourceFile() << parsed;
s << sourceFile() << fileId << compiler() << compilerId
<< extraCompiler << buildRoot() << buildRootId
<< compileCommands() << compileCommandsFileId
Expand All @@ -1025,6 +1026,7 @@ void Source::decode(Deserializer &s, EncodeMode mode)
>> lang >> parsed >> flags
>> defines >> includePaths >> arguments >> sysRootIndex
>> directory >> includePathHash;
error() << "GOT A DUDE" << source << parsed;
language = static_cast<Language>(lang);

if (mode == EncodeSandbox && !Sandbox::root().isEmpty()) { // SBROOT
Expand Down

0 comments on commit 423953e

Please sign in to comment.