Add revision link in commit message
This commit is contained in:
parent
690409954c
commit
ed994d259a
5
wp2git.d
5
wp2git.d
|
@ -30,10 +30,13 @@ int main(string[] args)
|
||||||
foreach (child; xml[0]["page"])
|
foreach (child; xml[0]["page"])
|
||||||
if (child.tag=="revision")
|
if (child.tag=="revision")
|
||||||
{
|
{
|
||||||
|
string id = child["id"].text;
|
||||||
string summary = child["comment"] ? child["comment"].text : null;
|
string summary = child["comment"] ? child["comment"].text : null;
|
||||||
string committer = child["contributor"]["username"] ? child["contributor"]["username"].text : child["contributor"]["ip"].text;
|
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;
|
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 ~=
|
data ~=
|
||||||
"commit refs/heads/master\n" ~
|
"commit refs/heads/master\n" ~
|
||||||
"committer " ~ committer ~ " <" ~ committer ~ "@en.wikipedia.org> " ~ ISO8601toRFC2822(child["timestamp"].text) ~ "\n" ~
|
"committer " ~ committer ~ " <" ~ committer ~ "@en.wikipedia.org> " ~ ISO8601toRFC2822(child["timestamp"].text) ~ "\n" ~
|
||||||
|
|
Loading…
Reference in New Issue