Index: src/main/java/com/xpn/xwiki/doc/rcs/XWikiRCSArchive.java
===================================================================
--- src/main/java/com/xpn/xwiki/doc/rcs/XWikiRCSArchive.java	(revision 11772)
+++ src/main/java/com/xpn/xwiki/doc/rcs/XWikiRCSArchive.java	(revision 11773)
@@ -73,10 +73,10 @@
                 XWikiJRCSNode node = new XWikiJRCSNode(nodeInfo.getId().getVersion(), null);
                 node.setAuthor(nodeInfo.getAuthor());
                 node.setDate(nodeInfo.getDate());
-                node.setLog(nodeInfo.getComment());
-                node.setDiff(nodeInfo.isDiff());
+                node.setLog(nodeInfo.getComment());                
                 XWikiRCSNodeContent content = nodeInfo.getContent(context);
                 node.setText(content.getPatch().getContent());
+                node.setDiff(nodeInfo.isDiff());
                 nodes.put(node.getVersion(), node);
             }
             XWikiJRCSNode last = null;
@@ -184,11 +184,19 @@
         }
         /** @return is this node store diff or full version */
         public boolean isDiff() {
-            // we need something filed in Node. locker is free
-            return !sfullVersion.equals(getState());            
+            boolean isdiff = !sfullVersion.equals(getState());
+            if (getTextString()!=null && isdiff != !getTextString().startsWith("<")) {
+                LOG.warn("isDiff: Archive is inconsistent. Text and diff field are contradicting. version=" + getVersion());
+                isdiff = !isdiff;
+            }
+            return isdiff;
         }
         /** @param isdiff - true if node stores a diff, false - if full version */
-        public void setDiff(boolean isdiff) {            
+        public void setDiff(boolean isdiff) {
+            if (getTextString()!=null && isdiff != !getTextString().startsWith("<")) {
+                LOG.warn("setDiff: Archive is inconsistent. Text and diff field are contradicting. version=" + getVersion());
+                isdiff = !isdiff;
+            }
             setState(isdiff ? sdiffVersion : sfullVersion);
         }
         /** @return is this revision has old format. (xwiki-core<1.2, without author,comment,state fields)*/
Index: src/main/java/com/xpn/xwiki/doc/rcs/XWikiPatch.java
===================================================================
--- src/main/java/com/xpn/xwiki/doc/rcs/XWikiPatch.java	(revision 11772)
+++ src/main/java/com/xpn/xwiki/doc/rcs/XWikiPatch.java	(revision 11773)
@@ -23,6 +23,8 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.suigeneris.jrcs.util.ToString;
 
 import com.xpn.xwiki.XWikiContext;
@@ -38,6 +40,9 @@
  */
 public class XWikiPatch
 {
+    /** Logger. */
+    private static final Log LOG = LogFactory.getLog(XWikiPatch.class);
+
     /** string serialization for patch. */
     private String content;
 
@@ -76,10 +81,24 @@
     }
 
     /**
+     * @return is content a difference. using content field to determine.
+     */
+    private boolean isContentDiff()
+    {
+        return !content.startsWith("<");
+    }
+
+    /**
      * @return is content a difference, or full version
      */
     public boolean isDiff()
     {
+        if (content != null) {
+            if (isDiff != isContentDiff()) {
+                LOG.warn("isDiff: Patch is inconsistent. Content and diff field are contradicting");
+                return isContentDiff();
+            }
+        }
         return isDiff;
     }
 
@@ -88,6 +107,13 @@
      */
     public void setDiff(boolean isDiff)
     {
+        if (content != null) {
+            if (isDiff != isContentDiff()) {
+                LOG.warn("setDiff: Patch is inconsistent. Content and diff field are contradicting");
+                this.isDiff = isContentDiff();
+                return;
+            }
+        }
         this.isDiff = isDiff;
     }
 
@@ -114,8 +140,8 @@
      */
     public XWikiPatch setFullVersion(String versionXml) throws XWikiException
     {
+        setContent(versionXml);
         setDiff(false);
-        setContent(versionXml);
         return this;
     }
 
@@ -167,11 +193,11 @@
      */
     public XWikiPatch setDiffVersion(String originalVersionXml, String newVersionXml,
         String docName) throws XWikiException
-    {
-        setDiff(true);
+    {        
         try {
             // The history keeps reversed patches, from the most recent to the previous version.
             setContent(XWikiPatchUtils.getDiff(newVersionXml, originalVersionXml));
+            setDiff(true);
         } catch (Exception e) {
             Object[] args = {docName};
             throw new XWikiException(XWikiException.MODULE_XWIKI_DIFF,
