summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestGIT.cxx
diff options
context:
space:
mode:
authorZach Mullen <zach.mullen@kitware.com>2010-12-20 20:33:21 (GMT)
committerZach Mullen <zach.mullen@kitware.com>2010-12-20 21:05:40 (GMT)
commit307b8a6e6995b2c08fb71d7eea202e2ab0a8a204 (patch)
tree95ef054657b2931f8056db4fb7d2578f0866f813 /Source/CTest/cmCTestGIT.cxx
parent34a2dee75d80afe175bd041e26be10da9c09a74f (diff)
downloadCMake-307b8a6e6995b2c08fb71d7eea202e2ab0a8a204.zip
CMake-307b8a6e6995b2c08fb71d7eea202e2ab0a8a204.tar.gz
CMake-307b8a6e6995b2c08fb71d7eea202e2ab0a8a204.tar.bz2
CTest git update should pass the committer as well as the author
Diffstat (limited to 'Source/CTest/cmCTestGIT.cxx')
-rw-r--r--Source/CTest/cmCTestGIT.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index a6f10ec..3456ec4 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -526,6 +526,35 @@ private:
}
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()