Index: wp-admin/revision.php
===================================================================
--- wp-admin/revision.php	(revision 23465)
+++ wp-admin/revision.php	(working copy)
@@ -29,7 +29,7 @@
 		break;
 
 	// Revisions disabled and we're not looking at an autosave
-	if ( ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) && !wp_is_post_autosave( $revision ) ) {
+	if ( ! wp_revisions_enabled( $post ) && !wp_is_post_autosave( $revision ) ) {
 		$redirect = 'edit.php?post_type=' . $post->post_type;
 		break;
 	}
@@ -70,7 +70,7 @@
 	else
 		break; // Don't diff two unrelated revisions
 
-	if ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) { // Revisions disabled
+	if ( ! wp_revisions_enabled( $post ) ) { // Revisions disabled
 		if (
 			// we're not looking at an autosave
 			( !wp_is_post_autosave( $left_revision ) && !wp_is_post_autosave( $right_revision ) )
@@ -112,7 +112,7 @@
 		break;
 
 	// Revisions disabled and we're not looking at an autosave
-	if ( ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) && !wp_is_post_autosave( $revision ) ) {
+	if ( ! wp_revisions_enabled( $post ) && !wp_is_post_autosave( $revision ) ) {
 		$redirect = 'edit.php?post_type=' . $post->post_type;
 		break;
 	}
@@ -210,7 +210,7 @@
 <?php
 
 $args = array( 'format' => 'form-table', 'parent' => true, 'right' => $right, 'left' => $left );
-if ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') )
+if ( ! wp_revisions_enabled( $post ) )
 	$args['type'] = 'autosave';
 
 wp_list_post_revisions( $post, $args );
Index: wp-includes/class-wp-xmlrpc-server.php
===================================================================
--- wp-includes/class-wp-xmlrpc-server.php	(revision 23465)
+++ wp-includes/class-wp-xmlrpc-server.php	(working copy)
@@ -3441,7 +3441,7 @@
 			return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );
 
 		// Check if revisions are enabled.
-		if ( ! WP_POST_REVISIONS || ! post_type_supports( $post->post_type, 'revisions' ) )
+		if ( ! wp_revisions_enabled( $post ) )
 			return new IXR_Error( 401, __( 'Sorry, revisions are disabled.' ) );
 
 		$revisions = wp_get_post_revisions( $post_id );
@@ -3506,7 +3506,7 @@
 			return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
 
 		// Check if revisions are disabled.
-		if ( ! WP_POST_REVISIONS || ! post_type_supports( $post->post_type, 'revisions' ) )
+		if ( ! wp_revisions_enabled( $post ) )
 			return new IXR_Error( 401, __( 'Sorry, revisions are disabled.' ) );
 
 		$post = wp_restore_post_revision( $revision_id );
Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 23465)
+++ wp-includes/post.php	(working copy)
@@ -5021,11 +5021,10 @@
 	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
 		return;
 
-	// WP_POST_REVISIONS = 0, false
-	if ( ! WP_POST_REVISIONS )
+	if ( !$post = get_post( $post_id, ARRAY_A ) )
 		return;
 
-	if ( !$post = get_post( $post_id, ARRAY_A ) )
+	if ( ! wp_revisions_enabled( (object) $post ) )
 		return;
 
 	if ( 'auto-draft' == $post['post_status'] )
@@ -5050,15 +5049,15 @@
 
 	$return = _wp_put_post_revision( $post );
 
-	// WP_POST_REVISIONS = true (default), -1
-	if ( !is_numeric( WP_POST_REVISIONS ) || WP_POST_REVISIONS < 0 )
+	$revisions_to_keep = wp_revisions_to_keep( (object) $post );
+
+	if ( $revisions_to_keep < 0 )
 		return $return;
 
 	// all revisions and (possibly) one autosave
 	$revisions = wp_get_post_revisions( $post_id, array( 'order' => 'ASC' ) );
 
-	// WP_POST_REVISIONS = (int) (# of autosaves to save)
-	$delete = count($revisions) - WP_POST_REVISIONS;
+	$delete = count($revisions) - $revisions_to_keep;
 
 	if ( $delete < 1 )
 		return $return;
@@ -5314,11 +5313,12 @@
  * @return array empty if no revisions
  */
 function wp_get_post_revisions( $post_id = 0, $args = null ) {
-	if ( ! WP_POST_REVISIONS )
-		return array();
 	if ( ( !$post = get_post( $post_id ) ) || empty( $post->ID ) )
 		return array();
 
+	if ( ! wp_revisions_enabled( $post ) )
+		return array();
+
 	$defaults = array( 'order' => 'DESC', 'orderby' => 'date' );
 	$args = wp_parse_args( $args, $defaults );
 	$args = array_merge( $args, array( 'post_parent' => $post->ID, 'post_type' => 'revision', 'post_status' => 'inherit' ) );
@@ -5328,6 +5328,46 @@
 	return $revisions;
 }
 
+/**
+ * Determine if revisions are enabled for a given post.
+ *
+ * @since 3.6
+ *
+ * @uses wp_revisions_to_keep
+ *
+ * @param object $post
+ * @return bool
+ */
+function wp_revisions_enabled( $post ) {
+	return wp_revisions_to_keep( $post ) != 0;
+}
+
+/**
+ * Determine how many revisions to retain for a given post.
+ * By default, an infinite number of revisions are stored if a post type supports revisions.
+ *
+ * @since 3.6
+ *
+ * @uses post_type_supports
+ * @uses apply_filters
+ *
+ * @param object $post
+ * @return int
+ */
+function wp_revisions_to_keep( $post ) {
+	$num = WP_POST_REVISIONS;
+
+	if ( true === $num )
+		$num = -1;
+	else
+		$num = intval( $num );
+
+	if ( ! post_type_supports( $post->post_type, 'revisions' ) )
+		$num = 0;
+
+	return (int) apply_filters( 'wp_revisions_to_keep', $num, $post );
+}
+
 function _set_preview($post) {
 
 	if ( ! is_object($post) )
