diff -ur mediawiki-1.5beta3/includes/SpecialExport.php wiki/includes/SpecialExport.php
--- mediawiki-1.5beta3/includes/SpecialExport.php	2005-07-05 05:16:56.000000000 +0200
+++ wiki/includes/SpecialExport.php	2005-07-10 16:53:45.000000000 +0200
@@ -25,31 +25,63 @@
 /** */
 require_once( 'Revision.php' );
 
+$exportGz;
+
+/**
+ *
+ */
+function wfExportHandler( $buffer ) {
+	global $wgExportGz;
+
+	gzwrite( $wgExportGz, $buffer, strlen($buffer) );
+	return '';
+}
+
 /**
  *
  */
 function wfSpecialExport( $page = '' ) {
-	global $wgOut, $wgLang, $wgRequest;
+	global $wgOut, $wgLang, $wgRequest, $wgExportGz;
 	
 	if( $wgRequest->getVal( 'action' ) == 'submit') {
 		$page = $wgRequest->getText( 'pages' );
 		$curonly = $wgRequest->getCheck( 'curonly' );
+		$zipped = $wgRequest->getCheck( 'zipped' );
 	} else {
 		# Pre-check the 'current version only' box in the UI
 		$curonly = true;
+		$zipped = false;
 	}
 	
 	if( $page != '' ) {
 		$wgOut->disable();
-		header( "Content-type: application/xml; charset=utf-8" );
+		if( $zipped ) {
+			header( "Content-Disposition: attachment; filename=wiki.xml.gz" );
+			$tmpname = tempnam( "/tmp", "wiki" );
+			$wgExportGz = gzopen( $tmpname, "w" );
+			ob_start( "wfExportHandler", 100 );
+		} else {
+			header( "Content-type: application/xml; charset=utf-8" );
+		}
 		$pages = explode( "\n", $page );
 		
 		$db =& wfGetDB( DB_SLAVE );
 		$history = $curonly ? MW_EXPORT_CURRENT : MW_EXPORT_FULL;
 		$exporter = new WikiExporter( $db, $history );
 		$exporter->openStream();
-		$exporter->pagesByName( $pages );
+		if( strncmp( $page, '*', 1 ) != 0 ) {
+			$exporter->pagesByName( $pages );
+		} else {
+			$exporter->allPages();
+		}
 		$exporter->closeStream();
+		if ( $zipped ) {
+			ob_end_clean();
+			gzclose( $wgExportGz );
+			readfile( $tmpname );
+			unlink( $tmpname );
+		}
 		return;
 	}
 	
@@ -62,6 +94,8 @@
 <textarea name='pages' cols='40' rows='10'></textarea><br />
 <label><input type='checkbox' name='curonly' value='true' checked='checked' />
 " . wfMsg( "exportcuronly" ) . "</label><br />
+<label><input type='checkbox' name='zipped' value='true' />
+" . wfMsg( "exportzipped" ) . "</label><br />
 <input type='submit' />
 </form>
 " );
diff -ur mediawiki-1.5beta3/includes/SpecialImport.php wiki/includes/SpecialImport.php
--- mediawiki-1.5beta3/includes/SpecialImport.php	2005-07-05 23:22:20.000000000 +0200
+++ wiki/includes/SpecialImport.php	2005-07-13 11:52:40.000000000 +0200
@@ -195,6 +195,15 @@
 			$pageId = $article->insertOn( $dbw );
 		}
 		
+		$old = Revision::loadFromTimestamp( $dbw, $this->title, $this->timestamp );
+		if( ( $old != NULL ) && ( strcmp( $old->getText(), $this->getText() ) == 0 ) ) { 
+			return wfMsg( "importhistoryconflict" );
+		}
+		$old = Revision::loadFromTitle( $dbw, $this->title );
+		if( ( $old != NULL ) && ( strcmp( $old->getText(), $this->getText() ) == 0 ) ) { 
+			return wfMsg( "importhistoryconflict" );
+		}
+		
 		# FIXME: Check for exact conflicts
 		# FIXME: Use original rev_id optionally
 		# FIXME: blah blah blah
@@ -204,6 +213,10 @@
 		#}
 		
 		# Insert the row
+		global $wgDeferredUpdateList,$wgOut;
+		$oldDUL = $wgDeferredUpdateList;
+		$wgDeferredUpdateList = array();
+		
 		$revision = new Revision( array(
 			'page'       => $pageId,
 			'text'       => $this->getText(),
@@ -215,12 +228,100 @@
 			) );
 		$revId = $revision->insertOn( $dbw );
 		$article->updateIfNewerOn( $dbw, $revision );
+		$article->editUpdates($this->getText(), $this->getComment(), false, $this->timestamp);
 		
+		if (count($wgDeferredUpdateList) > 0) {
+			array_push($oldDUL, new ImporterUpdate($wgDeferredUpdateList, $this->getText(), $this->title));
+		}
+		$wgDeferredUpdateList = $oldDUL;
 		return true;
 	}
 
 }
 
+class ImporterUpdate {
+
+	/**#@+
+	 * @access private
+	 */
+	var $mUpdates, $mText, $mTitle;
+	/**#@-*/
+
+	/**
+	 * Constructor
+	 * Initialize private variables
+	 */
+	function ImporterUpdate( $updates, $text, $title ) {
+		$this->mUpdates = $updates;
+		$this->mText = $text;
+		$this->mTitle = $title;
+	}
+
+	/**
+	 * Update link tables with outgoing links from an updated article
+	 * Relies on the 'link cache' to be filled out.
+	 */
+	
+	function doUpdate() {
+		global $wgLinkCache, $wgLinkHolder, $wgOut, $wgTitle; 
+		$oldLC = $wgLinkCache;
+		$wgLinkCache = new LinkCache;
+		$wgLinkCache->forUpdate( true );
+		$oldLH = $wgLinkHolders;
+		$wgLinkHolders = array(
+			'namespaces' => array(),
+			'dbkeys' => array(),
+			'queries' => array(),
+			'texts' => array(),
+			'titles' => array()
+		);
+		$oldOut = $wgOut;
+		$wgOut = new OutputPage();
+		$oldTitle = $wgTitle;
+		$wgTitle = $this->mTitle;
+		$wgOut->addWikiText( $this->mText );
+		$wgOut->transformBuffer();
+		$wgOut->clearHTML();
+		foreach ( $this->mUpdates as $up ) {
+			$up->doUpdate();
+		}
+		$wgLinkCache = $oldLC;
+		$wgLinkHolders = $oldLH;
+		$wgOut = $oldOut;
+		$wgTitle = $oldTitle;
+	}
+
+	/**
+	  * Link update which clears the previous entries and inserts new ones
+	  * May be slower or faster depending on level of lock contention and write speed of DB
+	  * Also useful where link table corruption needs to be repaired, e.g. in refreshLinks.php
+	 */
+	function doDumbUpdate() {
+		global $wgLinkCache, $wgLinkHolder, $wgOut; 
+		$oldLC = $wgLinkCache;
+		$wgLinkCache = new LinkCache;
+		$wgLinkCache->forUpdate( true );
+		$oldLH = $wgLinkHolders;
+		$wgLinkHolders = array(
+			'namespaces' => array(),
+			'dbkeys' => array(),
+			'queries' => array(),
+			'texts' => array(),
+			'titles' => array()
+		);
+		$oldOut = $wgOut;
+		$wgOut->addWikiText( $this->mText );
+		$wgOut->transformBuffer();
+		$wgOut->clearHTML();
+		foreach ( $mUpdates as $up ) {
+			$up->doDumbUpdate();
+		}
+		$wgLinkCache = $oldLC;
+		$wgLinkHolders = $oldLH;
+		$wgOut = $oldOut;
+	}
+}
+
 /**
  *
  * @package MediaWiki
@@ -562,15 +663,15 @@
 	}
 	
 	function atEnd() {
-		return feof( $this->mHandle );
+		return gzeof( $this->mHandle );
 	}
 	
 	function readChunk() {
-		return fread( $this->mHandle, 32768 );
+		return gzread( $this->mHandle, 32768 );
 	}
 	
 	function newFromFile( $filename ) {
-		$file = @fopen( $filename, 'rt' );
+		$file = @gzopen( $filename, 'rb' );
 		if( !$file ) {
 			return new WikiError( "Couldn't open import file" );
 		}
diff -ur mediawiki-1.5beta3/languages/Language.php wiki/languages/Language.php
--- mediawiki-1.5beta3/languages/Language.php	2005-07-06 20:35:13.000000000 +0200
+++ wiki/languages/Language.php	2005-07-08 14:33:24.000000000 +0200
@@ -1609,6 +1609,7 @@
 article [[Train]].
 ',
 'exportcuronly'	=> 'Include only the current revision, not the full history',
+'exportzipped' => 'Export this file compressed',
 
 # Namespace 8 related
 
diff -ur mediawiki-1.5beta3/languages/LanguageDe.php wiki/languages/LanguageDe.php
--- mediawiki-1.5beta3/languages/LanguageDe.php	2005-07-06 15:50:48.000000000 +0200
+++ wiki/languages/LanguageDe.php	2005-07-08 14:33:24.000000000 +0200
@@ -1068,6 +1068,7 @@
 "export"        => "Seiten exportieren",
 "exporttext"    => "Sie können den Text und die Bearbeitungshistorie einer bestimmten oder einer Auswahl von Seiten nach XML exportieren. Das Ergebnis kann in ein anderes Wiki mit WikiMedia Software eingespielt werden, bearbeitet oder archiviert werden.",
 "exportcuronly" => "Nur die aktuelle Version der Seite exportieren",
+"exportzipped" => "Seiten komprimiert exportieren",
 "missingimage"          => "<b>Fehlendes Bild</b><br /><i>$1</i>\n",
 
 #Tooltips:

