CTest: Submit author email in Update.xml

Add the <Email>...</Email> element in Update.xml for each commit
reported.  This field was defined by Dart but never really used.
Distributed version control systems use author name and email
instead of a user id, so now it makes sense to use this field.
This commit is contained in:
Brad King 2010-05-07 09:17:26 -04:00
parent 162597e4bf
commit 678073bec2
6 changed files with 12 additions and 2 deletions

View File

@ -292,7 +292,7 @@ private:
if(this->EmailRegex.find(this->Rev.Author))
{
this->Rev.Author = this->EmailRegex.match(1);
//email = email_regex.match(2);
this->Rev.EMail = this->EmailRegex.match(2);
}
}
else if(strcmp(name, "timestamp") == 0 && !this->CData.empty())

View File

@ -347,6 +347,7 @@ private:
Person author;
this->ParsePerson(this->Line.c_str()+7, author);
this->Rev.Author = author.Name;
this->Rev.EMail = author.EMail;
// Convert the time to a human-readable format that is also easy
// to machine-parse: "CCYY-MM-DD hh:mm:ss".

View File

@ -220,7 +220,7 @@ private:
}
else if ( strcmp(name, "email") == 0 && !this->CData.empty())
{
// this->Rev.Email.assign(&this->CData[0], this->CData.size());
this->Rev.EMail.assign(&this->CData[0], this->CData.size());
}
else if(strcmp(name, "date") == 0 && !this->CData.empty())
{

View File

@ -227,6 +227,7 @@ void cmCTestVC::WriteXMLEntry(std::ostream& xml,
<< "\t\t\t<FullName>" << cmXMLSafe(full) << "</FullName>\n"
<< "\t\t\t<CheckinDate>" << cmXMLSafe(rev.Date) << "</CheckinDate>\n"
<< "\t\t\t<Author>" << cmXMLSafe(rev.Author) << "</Author>\n"
<< "\t\t\t<Email>" << cmXMLSafe(rev.EMail) << "</Email>\n"
<< "\t\t\t<Log>" << cmXMLSafe(rev.Log) << "</Log>\n"
<< "\t\t\t<Revision>" << cmXMLSafe(rev.Rev) << "</Revision>\n"
<< "\t\t\t<PriorRevision>" << cmXMLSafe(prior) << "</PriorRevision>\n"

View File

@ -73,6 +73,7 @@ protected:
std::string Rev;
std::string Date;
std::string Author;
std::string EMail;
std::string Log;
};

View File

@ -39,6 +39,9 @@ create_content(import)
run_child(WORKING_DIRECTORY ${TOP}/import
COMMAND ${BZR} init
)
run_child(WORKING_DIRECTORY ${TOP}/import
COMMAND ${BZR} whoami --branch "Test Author <testauthor@cmake.org>"
)
run_child(WORKING_DIRECTORY ${TOP}/import
COMMAND ${BZR} add .
@ -57,6 +60,10 @@ run_child(
WORKING_DIRECTORY ${TOP}
COMMAND ${BZR} branch "${REPO}" user-source
)
run_child(
WORKING_DIRECTORY ${TOP}/user-source
COMMAND ${BZR} whoami --branch "Test Author <testauthor@cmake.org>"
)
#-----------------------------------------------------------------------------
# Make changes in the working tree.