Index: wp-includes/class-wp-xmlrpc-server.php
===================================================================
--- wp-includes/class-wp-xmlrpc-server.php	(revision 21896)
+++ wp-includes/class-wp-xmlrpc-server.php	(working copy)
@@ -82,6 +82,8 @@
 			'wp.getPostFormats'     => 'this:wp_getPostFormats',
 			'wp.getPostType'		=> 'this:wp_getPostType',
 			'wp.getPostTypes'		=> 'this:wp_getPostTypes',
+			'wp.getRevisions'		=> 'this:wp_getRevisions',
+			'wp.restoreRevision'	=> 'this:wp_restoreRevision',
 
 			// Blogger API
 			'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs',
@@ -1271,6 +1273,13 @@
 
 		$post = get_post( $post_id, ARRAY_A );
 
+    if ( isset( $content_struct['only_if_no_new_revision'] ) ) {
+      // if there's a newer revision, return an error
+      if ( mysql2date( 'U', $post['post_modified_gmt'] ) > $content_struct['only_if_no_new_revision']->getTimestamp() ) {
+        return new IXR_Error( 409, __( 'There is a revision of this post that is more recent' ) );
+      }
+    }
+
 		if ( empty( $post['ID'] ) )
 			return new IXR_Error( 404, __( 'Invalid post ID.' ) );
 
@@ -1287,10 +1296,30 @@
 		$this->escape( $post );
 		$merged_content_struct = array_merge( $post, $content_struct );
 
+		$id = $post_id;
+		if ( isset( $content_struct['return_preview_url'] ) && ( 'draft' != $post['post_status'] ) ) {
+			$id = wp_create_post_autosave( $post_id, $merged_content_struct );
+			if ( is_wp_error( $id ) )
+				return new IXR_Error( 500, $id->get_error_message() );
+
+			if ( ! $id )
+				return new IXR_Error( 401, __( 'Sorry, your entry could not be posted. Something wrong happened.' ) );
+		}
+
 		$retval = $this->_insert_post( $user, $merged_content_struct );
 		if ( $retval instanceof IXR_Error )
 			return $retval;
 
+		if ( isset( $content_struct['return_preview_url'] ) && $content_struct['return_preview_url'] ) {
+			if ( $post['post_status'] == 'draft'  ) {
+				$url = add_query_arg( 'preview', 'true', get_permalink($id) );
+			} else {
+				$nonce = wp_create_nonce('post_preview_' . $id);
+				$url = add_query_arg( array( 'preview' => 'true', 'preview_id' => $id, 'preview_nonce' => $nonce ), get_permalink($id) );
+			}
+
+			return array( 'preview_url' => $url );
+		}
 		return true;
 	}
 
@@ -3495,6 +3524,111 @@
 		return $struct;
 	}
 
+	/**
+	 * Retrieve revisions for a specific post.
+	 *
+	 * @since 3.5.0
+	 *
+	 * The optional $fields parameter specifies what fields will be included
+	 * in the response array.
+	 *
+	 * @uses wp_get_post_revisions()
+	 * @see wp_getPost() for more on $fields
+	 *
+	 * @param array $args Method parameters. Contains:
+	 *  - int     $blog_id
+	 *  - string  $username
+	 *  - string  $password
+	 *  - int     $post_id
+	 *  - array   $fields
+	 * @return array contains a collection of posts.
+	 */
+	function wp_getRevisions( $args ) {
+		if ( ! $this->minimum_args( $args, 4 ) )
+			return $this->error;
+		$this->escape( $args );
+
+		$blog_id    = (int) $args[0];
+		$username   = $args[1];
+		$password   = $args[2];
+		$post_id    = (int) $args[3];
+
+		if ( isset( $args[4] ) )
+			$fields = $args[4];
+		else
+			$fields = apply_filters( 'xmlrpc_default_revision_fields', array( 'post' ), 'wp.getRevisions' );
+
+		if ( ! $user = $this->login( $username, $password ) )
+			return $this->error;
+
+		do_action( 'xmlrpc_call', 'wp.getRevisions' );
+
+    $post_type = get_post_type_object( 'post' );
+
+		if ( ! current_user_can( $post_type->cap->edit_posts ) )
+			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type' ));
+
+		$posts_list = wp_get_post_revisions( $post_id );
+
+		if ( ! $posts_list )
+			return array();
+
+		// holds all the posts data
+		$struct = array();
+
+		foreach ( $posts_list as $post ) {
+      $post_data = get_object_vars( $post );
+			$post_type = get_post_type_object( $post_data['post_type'] );
+			if ( ! current_user_can( $post_type->cap->edit_post, $post_data['ID'] ) )
+				continue;
+
+			$struct[] = $this->_prepare_post( $post_data, $fields );
+		}
+
+		return $struct;
+	}
+
+	/**
+	 * Restore a post revision
+	 *
+	 * @since 3.5.0
+	 *
+	 * @uses wp_restore_post_revision()
+	 *
+	 * @param array $args Method parameters. Contains:
+	 *  - int     $blog_id
+	 *  - string  $username
+	 *  - string  $password
+	 *  - int     $post_id
+	 * @return bool false if there was an error restoring, true if success.
+	 */
+	function wp_restoreRevision( $args ) {
+		if ( ! $this->minimum_args( $args, 3 ) )
+			return $this->error;
+
+		$this->escape( $args );
+
+		$blog_id    = (int) $args[0];
+		$username   = $args[1];
+		$password   = $args[2];
+		$post_id    = (int) $args[3];
+
+		if ( ! $user = $this->login( $username, $password ) )
+			return $this->error;
+
+		do_action( 'xmlrpc_call', 'wp.restoreRevision' );
+
+		$post = get_post( $post_id, ARRAY_A );
+    $post_type = get_post_type_object( $post['post_type'] );
+
+		if ( ! current_user_can( $post_type->cap->edit_posts ) )
+			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type' ));
+
+		$post = wp_restore_post_revision( $post_id );
+
+		return (bool)$post;
+	}
+
 	/* Blogger API functions.
 	 * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/
 	 */
Index: wp-admin/includes/post.php
===================================================================
--- wp-admin/includes/post.php	(revision 21896)
+++ wp-admin/includes/post.php	(working copy)
@@ -1234,24 +1234,26 @@
  *
  * @return unknown
  */
-function wp_create_post_autosave( $post_id ) {
-	$translated = _wp_translate_postdata( true );
-	if ( is_wp_error( $translated ) )
-		return $translated;
+function wp_create_post_autosave( $post_id, $post_data = null ) {
+	if ( empty($post_data) ) {
+		$post_data = _wp_translate_postdata( true, $_POST );
+		if ( is_wp_error( $post_data ) )
+			return $post_data;
+	}
 
 	// Only store one autosave. If there is already an autosave, overwrite it.
 	if ( $old_autosave = wp_get_post_autosave( $post_id ) ) {
-		$new_autosave = _wp_post_revision_fields( $_POST, true );
+		$new_autosave = _wp_post_revision_fields( $post_data, true );
 		$new_autosave['ID'] = $old_autosave->ID;
 		$new_autosave['post_author'] = get_current_user_id();
 		return wp_update_post( $new_autosave );
 	}
 
 	// _wp_put_post_revision() expects unescaped.
-	$_POST = stripslashes_deep($_POST);
+	$post_data = stripslashes_deep($post_data);
 
 	// Otherwise create the new autosave as a special post revision
-	return _wp_put_post_revision( $_POST, true );
+	return _wp_put_post_revision( $post_data, true );
 }
 
 /**
