Add revision link in commit message

This commit is contained in:
Vladimir Panteleev 2010-06-16 02:26:01 +03:00
parent 690409954c
commit ed994d259a
1 changed files with 4 additions and 1 deletions

View File

@ -30,10 +30,13 @@ int main(string[] args)
foreach (child; xml[0]["page"])
if (child.tag=="revision")
{
string id = child["id"].text;
string summary = child["comment"] ? child["comment"].text : null;
string committer = child["contributor"]["username"] ? child["contributor"]["username"].text : child["contributor"]["ip"].text;
fwritefln(stderr, "Revision %s by %s: %s", child["id"].text, committer, summary);
string text = child["text"].text;
fwritefln(stderr, "Revision %s by %s: %s", id, committer, summary);
summary ~= "\n\nhttp://en.wikipedia.org/w/index.php?oldid=" ~ id;
data ~=
"commit refs/heads/master\n" ~
"committer " ~ committer ~ " <" ~ committer ~ "@en.wikipedia.org> " ~ ISO8601toRFC2822(child["timestamp"].text) ~ "\n" ~