CTest git update should pass the committer as well as the author

This commit is contained in:
Zach Mullen 2010-12-20 15:33:21 -05:00
parent 34a2dee75d
commit 307b8a6e69
3 changed files with 37 additions and 0 deletions

View File

@ -526,6 +526,35 @@ private:
} }
this->Rev.Date += tz; this->Rev.Date += tz;
} }
else if(strncmp(this->Line.c_str(), "committer ", 10) == 0)
{
Person committer;
this->ParsePerson(this->Line.c_str()+10, committer);
this->Rev.Committer = committer.Name;
this->Rev.CommitterEMail = committer.EMail;
// Convert the time to a human-readable format that is also easy
// to machine-parse: "CCYY-MM-DD hh:mm:ss".
time_t seconds = static_cast<time_t>(committer.Time);
struct tm* t = gmtime(&seconds);
char dt[1024];
sprintf(dt, "%04d-%02d-%02d %02d:%02d:%02d",
t->tm_year+1900, t->tm_mon+1, t->tm_mday,
t->tm_hour, t->tm_min, t->tm_sec);
this->Rev.CommitDate = dt;
// Add the time-zone field "+zone" or "-zone".
char tz[32];
if(committer.TimeZone >= 0)
{
sprintf(tz, " +%04ld", committer.TimeZone);
}
else
{
sprintf(tz, " -%04ld", -committer.TimeZone);
}
this->Rev.CommitDate += tz;
}
} }
void DoBodyLine() void DoBodyLine()

View File

@ -228,6 +228,11 @@ void cmCTestVC::WriteXMLEntry(std::ostream& xml,
<< "\t\t\t<CheckinDate>" << cmXMLSafe(rev.Date) << "</CheckinDate>\n" << "\t\t\t<CheckinDate>" << cmXMLSafe(rev.Date) << "</CheckinDate>\n"
<< "\t\t\t<Author>" << cmXMLSafe(rev.Author) << "</Author>\n" << "\t\t\t<Author>" << cmXMLSafe(rev.Author) << "</Author>\n"
<< "\t\t\t<Email>" << cmXMLSafe(rev.EMail) << "</Email>\n" << "\t\t\t<Email>" << cmXMLSafe(rev.EMail) << "</Email>\n"
<< "\t\t\t<Committer>" << cmXMLSafe(rev.Committer) << "</Committer>\n"
<< "\t\t\t<CommitterEmail>" << cmXMLSafe(rev.CommitterEMail)
<< "</CommitterEmail>\n"
<< "\t\t\t<CommitDate>" << cmXMLSafe(rev.CommitDate)
<< "</CommitDate>\n"
<< "\t\t\t<Log>" << cmXMLSafe(rev.Log) << "</Log>\n" << "\t\t\t<Log>" << cmXMLSafe(rev.Log) << "</Log>\n"
<< "\t\t\t<Revision>" << cmXMLSafe(rev.Rev) << "</Revision>\n" << "\t\t\t<Revision>" << cmXMLSafe(rev.Rev) << "</Revision>\n"
<< "\t\t\t<PriorRevision>" << cmXMLSafe(prior) << "</PriorRevision>\n" << "\t\t\t<PriorRevision>" << cmXMLSafe(prior) << "</PriorRevision>\n"

View File

@ -74,6 +74,9 @@ protected:
std::string Date; std::string Date;
std::string Author; std::string Author;
std::string EMail; std::string EMail;
std::string Committer;
std::string CommitterEMail;
std::string CommitDate;
std::string Log; std::string Log;
}; };