You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2009/01/13 11:44:49 UTC

svn commit: r734097 - /lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNode.java

Author: andreas
Date: Tue Jan 13 02:44:37 2009
New Revision: 734097

URL: http://svn.apache.org/viewvc?rev=734097&view=rev
Log:
Fix existence check for source nodes.

Modified:
    lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNode.java

Modified: lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNode.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNode.java?rev=734097&r1=734096&r2=734097&view=diff
==============================================================================
--- lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNode.java (original)
+++ lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNode.java Tue Jan 13 02:44:37 2009
@@ -396,15 +396,19 @@
 
     public boolean exists() throws RepositoryException {
         try {
-            RCMLEntry entry = getRcml().getLatestEntry();
+            RCML rcml = getRcml();
+            RCMLEntry entry = rcml.getLatestEntry();
             if (entry == null) {
                 return false;
             } else if (entry.getType() == RCML.ci) {
                 return true;
-            }
-            else {
-                // before check-in, the node exists only in the session that created it
-                return entry.getSessionId().equals(getSession().getId());
+            } else {
+                if (rcml.getLatestCheckInEntry() != null) {
+                    return true;
+                } else {
+                    // before first check-in, the node exists only in the session that created it
+                    return entry.getSessionId().equals(getSession().getId());
+                }
             }
         } catch (RevisionControlException e) {
             throw new RepositoryException(e);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org