Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 23794)
+++ wp-includes/post.php	(working copy)
@@ -1734,9 +1734,11 @@
  * @return bool False on failure, true if success.
  */
 function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '') {
-	// make sure meta is added to the post, not a revision
-	if ( $the_post = wp_is_post_revision($post_id) )
-		$post_id = $the_post;
+	if ( ! apply_filters( 'wp_revisions_keep_meta', true ) ) {
+		// make sure meta is added to the post, not a revision
+		if ( $the_post = wp_is_post_revision($post_id) )
+			$post_id = $the_post;
+	}
 
 	return update_metadata('post', $post_id, $meta_key, $meta_value, $prev_value);
 }
@@ -1768,8 +1770,10 @@
  */
 function get_post_custom( $post_id = 0 ) {
 	$post_id = absint( $post_id );
-	if ( ! $post_id )
-		$post_id = get_the_ID();
+	if ( ! apply_filters( 'wp_revisions_keep_meta', true ) ) {
+			if ( ! $post_id )
+				$post_id = get_the_ID();
+	}
 
 	return get_post_meta( $post_id );
 }
Index: wp-includes/revision.php
===================================================================
--- wp-includes/revision.php	(revision 23794)
+++ wp-includes/revision.php	(working copy)
@@ -60,6 +60,96 @@
 }
 
 /**
+ * Saves post meta as part of a revision.
+ *
+ * Called immedately after revision restore, with wp_restore_post_revision hook
+ *
+ * @package WordPress
+ * @subpackage Post_Revisions
+ * @since 3.6.0
+ *
+ *
+ * @param int $post_id The ID of the post saved as a revision.
+ * @param int $revision_id The ID of the revision.
+ * @return false error, true if success.
+ */
+function wp_restore_post_revision_meta( $post_id, $revision_id ) {
+	if ( ! apply_filters( 'wp_revisions_keep_meta', true ) )
+		return false;
+
+	//revision the post format
+	$format = get_post_meta( $revision_id, '_revisioned_post_format', true);
+	if ( '' !== $format ) {
+		set_post_format( $post_id, $format );
+		error_log('restoring ' . $format  );
+		error_log('from ' . $revision_id);
+
+	}
+
+	$current_meta = get_post_meta( $revision_id );
+	if ( is_array( $current_meta ) ) {
+		foreach ( $current_meta as $meta_key => $meta_value ) {
+			update_post_meta( $post_id, $meta_key, $meta_value[0] );
+		}
+	}
+	return true;
+
+}
+
+/**
+ * Saves post meta as part of a revision.
+ *
+ * Called immedately after revision storage
+ *
+ * @package WordPress
+ * @subpackage Post_Revisions
+ * @since 3.6.0
+ *
+ *
+ * @param int $post_id The ID of the post saved as a revision.
+ * @param int $revision_id The ID of the revision.
+ * @return false error, true if success.
+ */
+function wp_save_post_revision_meta( $post_id, $revision_id ) {
+	// hook for 'wp_revisions_keep_meta', return false to disable revisioning for post met
+	if ( ! apply_filters( 'wp_revisions_keep_meta', true ) )
+		return false;
+
+	if ( ! wp_first_revision_matches_current_version( $post_id ) )
+		return false;
+
+	// list of post meta that should be excluded from revisioning
+	// filter 'revision_meta_do_not_copy' to allow exclusion of specific meta from revisioning
+	$exclude_meta_keys = apply_filters( 'revision_meta_do_not_copy', array(
+		'_encloseme',
+		'_pingme',
+		'_edit_last',
+		'_edit_lock',
+		'_revisioned_post_format',
+	) );
+
+	//revision the post format
+	if ( '' !== get_post_format( $post_id ) )
+		update_post_meta( $revision_id, '_revisioned_post_format', get_post_format( $post_id ) );
+
+	error_log('storing ' . get_post_format( $post_id ) );
+	error_log('on ' . $revision_id);
+
+	$current_meta = get_post_meta( $post_id );
+
+	if ( is_array( $current_meta ) ) {
+		foreach ( $current_meta as $meta_key => $meta_value ) {
+			if ( in_array( $meta_key, $exclude_meta_keys ) )
+				continue;
+
+				update_post_meta( $revision_id, $meta_key, $meta_value[0]);
+			}
+
+	}
+	return true;
+}
+
+/**
  * Saves an already existing post as a post revision.
  *
  * Typically used immediately prior to post updates.
@@ -142,7 +232,7 @@
  * @subpackage Post_Revisions
  * @since 2.6.0
  * @uses wp_get_post_revisions()
- *  
+ *
  * @param int $post_id The post ID.
  * @param int $user_id optional The post author ID.
  * @return object|bool The autosaved data or false on failure or when no autosave exists.
@@ -201,13 +291,14 @@
 }
 
 /**
- * Inserts post data into the posts table as a post revision.
+ * Inserts post data into the posts table as a post revision. Since 3.6 also stores post meta.
  *
  * @package WordPress
  * @subpackage Post_Revisions
  * @since 2.6.0
  *
  * @uses wp_insert_post()
+ * @uses wp_save_post_revision_meta()
  *
  * @param int|object|array $post Post ID, post object OR post array.
  * @param bool $autosave Optional. Is the revision an autosave?
@@ -222,6 +313,8 @@
 	if ( !$post || empty($post['ID']) )
 		return;
 
+	$post_id = $post['ID'];
+
 	if ( isset($post['post_type']) && 'revision' == $post['post_type'] )
 		return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
 
@@ -229,6 +322,9 @@
 	$post = wp_slash($post); //since data is from db
 
 	$revision_id = wp_insert_post( $post );
+	if ( wp_first_revision_matches_current_version( $post_id ) )
+		wp_save_post_revision_meta($post_id, $revision_id );
+
 	if ( is_wp_error($revision_id) )
 		return $revision_id;
 
Index: wp-admin/revision.php
===================================================================
--- wp-admin/revision.php	(revision 23794)
+++ wp-admin/revision.php	(working copy)
@@ -21,7 +21,6 @@
 	if ( ! current_user_can( 'edit_post', $revision->post_parent ) )
 		break;
 
-
 	if ( ! $post = get_post( $revision->post_parent ) )
 		break;
 
@@ -33,6 +32,7 @@
 
 	check_admin_referer( "restore-post_{$revision->ID}" );
 
+	wp_restore_post_revision_meta( $post->ID, $revision->ID  );
 	wp_restore_post_revision( $revision->ID );
 	$redirect = add_query_arg( array( 'message' => 5, 'revision' => $revision->ID ), get_edit_post_link( $post->ID, 'url' ) );
 	break;
