Skip to content

Commit

Permalink
Fixed log parsing of Bazaar merges and tagged commits.
Browse files Browse the repository at this point in the history
--output-custom-log now skips unparsed log entries instead of exiting.
  • Loading branch information
acaudwell committed Apr 18, 2011
1 parent 53dac06 commit d9f99a7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 4 additions & 0 deletions 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.

Expand Down
2 changes: 1 addition & 1 deletion src/bzr.cpp
Expand Up @@ -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)
Expand Down
14 changes: 12 additions & 2 deletions src/gource.cpp
Expand Up @@ -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<RCommitFile>::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) {
Expand Down

0 comments on commit d9f99a7

Please sign in to comment.