Index: wp-admin/includes/post.php
===================================================================
--- wp-admin/includes/post.php	(revision 24397)
+++ wp-admin/includes/post.php	(working copy)
@@ -1337,15 +1337,16 @@
 	$post = get_post($post_ID);
 
 	if ( 'page' == $post->post_type ) {
-		if ( !current_user_can('edit_page', $post_ID) )
-			wp_die(__('You are not allowed to edit this page.'));
+		if ( ! current_user_can('edit_page', $post_ID) )
+			wp_die( __('You are not allowed to edit this page.') );
 	} else {
-		if ( !current_user_can('edit_post', $post_ID) )
-			wp_die(__('You are not allowed to edit this post.'));
+		if ( ! current_user_can('edit_post', $post_ID) )
+			wp_die( __('You are not allowed to edit this post.') );
 	}
 
 	$user_id = get_current_user_id();
-	if ( 'draft' == $post->post_status && $user_id == $post->post_author ) {
+	$locked = wp_check_post_lock( $post->ID );
+	if ( ! $locked && 'draft' == $post->post_status && $user_id == $post->post_author ) {
 		$id = edit_post();
 	} else { // Non drafts are not overwritten. The autosave is stored in a special post revision.
 		$id = wp_create_post_autosave( $post->ID );
@@ -1356,11 +1357,20 @@
 	if ( is_wp_error($id) )
 		wp_die( $id->get_error_message() );
 
-	if ( $_POST['post_status'] == 'draft' && $user_id == $post->post_author ) {
+	if ( ! $locked && $_POST['post_status'] == 'draft' && $user_id == $post->post_author ) {
 		$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) );
+		$args = array(
+			'preview' => 'true',
+			'preview_id' => $id,
+			'preview_nonce' => $nonce,
+		);
+
+		if ( isset( $_POST['post_format'] ) )
+			$args['post_format'] = empty( $_POST['post_format'] ) ? 'standard' : sanitize_key( $_POST['post_format'] );
+
+		$url = add_query_arg( $args, get_permalink($id) );
 	}
 
 	return apply_filters( 'preview_post_link', $url );
Index: wp-admin/js/post.js
===================================================================
--- wp-admin/js/post.js	(revision 24397)
+++ wp-admin/js/post.js	(working copy)
@@ -898,5 +898,20 @@
 				});
 			});
 		});
+
+		// When changing post formats, change the editor body class
+		$('#post-formats-select input.post-format').on( 'change.set-editor-class', function( event ) {
+			var editor, body, format = this.id;
+
+			if ( format && $( this ).prop('checked') ) {
+				editor = tinymce.get( 'content' );
+
+				if ( editor ) {
+					body = editor.getBody();
+					body.className = body.className.replace( /\bpost-format-[^ ]+/, '' );
+					editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format );
+				}
+			}
+		});
 	}
 });
Index: wp-includes/revision.php
===================================================================
--- wp-includes/revision.php	(revision 24397)
+++ wp-includes/revision.php	(working copy)
@@ -444,6 +444,8 @@
 	$post->post_title = $preview->post_title;
 	$post->post_excerpt = $preview->post_excerpt;
 
+	add_filter( 'get_the_terms', '_wp_preview_terms_filter', 10, 3 );
+
 	return $post;
 }
 
@@ -466,6 +468,27 @@
 }
 
 /**
+ * Filters terms lookup to set the post format.
+ *
+ * @since 3.6.0
+ * @access private
+ */
+function _wp_preview_terms_filter( $terms, $post_id, $taxonomy ) {
+	if ( ! $post = get_post() )
+		return $terms;
+
+	if ( empty( $_REQUEST['post_format'] ) || $post->ID != $post_id || 'post_format' != $taxonomy || 'revision' == $post->post_type )
+		return $terms;
+
+	if ( 'standard' == $_REQUEST['post_format'] )
+		$terms = array();
+	elseif ( $term = get_term_by( 'slug', 'post-format-' . sanitize_key( $_REQUEST['post_format'] ), 'post_format' ) )
+		$terms = array( $term ); // Can only have one post format
+
+	return $terms;
+}
+
+/**
  * Gets the post revision version.
  *
  * @since 3.6.0
