diff --git a/ChangeLog b/ChangeLog index 550153cf..c2d1314e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +0.33: + * Fixed log parsing of Bazaar merges and tagged commits. + * --output-custom-log now skips unparsed log entries instead of exiting. + 0.32: * Fixed behaviour of user camera tracking. diff --git a/src/bzr.cpp b/src/bzr.cpp index f93d79bc..527cbfae 100644 --- a/src/bzr.cpp +++ b/src/bzr.cpp @@ -17,7 +17,7 @@ #include "bzr.h" -Regex bzr_commit_regex("^ *([\\d.]+) (.+)\t(\\d{4})-(\\d+)-(\\d+)$"); +Regex bzr_commit_regex("^ *([\\d.]+) (.+)\t(\\d{4})-(\\d+)-(\\d+)(?: \\{[^}]+})?(?: \\[merge\\])?$"); Regex bzr_file_regex("^ *([AMDR]) (.*[^/])$"); // parse Bazaar log entries (using the gource.style template) diff --git a/src/gource.cpp b/src/gource.cpp index 277674a5..084fc537 100644 --- a/src/gource.cpp +++ b/src/gource.cpp @@ -148,16 +148,26 @@ void Gource::writeCustomLog(const std::string& logfile, const std::string& outpu if(!fh) return; } - while(commitlog->nextCommit(commit)) { + while(!commitlog->isFinished()) { + + RCommit commit; + + if(!commitlog->nextCommit(commit)) { + if(!commitlog->isSeekable()) { + break; + } + continue; + } + for(std::list::iterator it = commit.files.begin(); it != commit.files.end(); it++) { RCommitFile& cf = *it; fprintf(fh, "%lld|%s|%s|%s\n", (long long int) commit.timestamp, commit.username.c_str(), cf.action.c_str(), cf.filename.c_str()); } + commit.files.clear(); } if(output_file != "-") fclose(fh); - } RCommitLog* Gource::determineFormat(const std::string& logfile) {