From 22746a580721d659d8bdabe00ffa639670497524 Mon Sep 17 00:00:00 2001 From: Diederik van Liere Date: Mon, 23 Jan 2012 19:48:20 +0000 Subject: [PATCH] Add the new SHA1 revision field to the XML export, add SHA1 field to export-0.6.xsd and fix namespace element from string to integer. --- docs/export-0.6.xsd | 9 +++++---- includes/Export.php | 7 +++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/export-0.6.xsd b/docs/export-0.6.xsd index a225e5206c..55428b56fa 100644 --- a/docs/export-0.6.xsd +++ b/docs/export-0.6.xsd @@ -15,8 +15,8 @@ Version 0.5 adds byte count per revision. - Version 0.6 adds a separate namespace tag, locates the - redirect target and strips of the namespace from the title. + Version 0.6 adds a separate namespace tag, and resolves the + redirect target and adds a separate sha1 tag for each revision. The canonical URL to the schema document is: http://www.mediawiki.org/xml/export-0.6.xsd @@ -106,8 +106,8 @@ - - + + @@ -137,6 +137,7 @@ + diff --git a/includes/Export.php b/includes/Export.php index 695a7f707d..7773d03c29 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -486,6 +486,13 @@ class XmlDumpWriter { $out .= ' ' . Xml::element( 'redirect', array( 'title' => self::canonicalTitle( $redirect ) ) ) . "\n"; } } + + if ( $row->rev_sha1 ) { + $out .= " " . Xml::element('sha1', null, strval($row->rev_sha1) ) . "\n"; + } else { + $out .= " \n"; + } + if ( $row->page_restrictions != '' ) { $out .= ' ' . Xml::element( 'restrictions', array(), strval( $row->page_restrictions ) ) . "\n"; -- 2.20.1