Changeset 29683

Show
Ignore:
Timestamp:
01/27/08 18:37:54 (10 months ago)
Author:
fguillaume
Message:

NXP-1474: Restoring a version doesn't archive the current one

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core/src/main/java/org/nuxeo/ecm/core/api/AbstractSession.java

    r29680 r29683  
    16011601 
    16021602            DocumentModel docModel = readModel(doc, null); 
     1603 
     1604            // we're about to overwrite the document, make sure it's archived 
     1605            createDocumentSnapshot(docModel); 
     1606 
    16031607            final Map<String, Object> options = new HashMap<String, Object>(); 
    16041608 
     
    16221626 
    16231627            doc.restore(version.getLabel()); 
    1624             doc.checkOut(); // why isn't it already checkedout? 
     1628            // restore gives us a checked in document, so do a checkout 
     1629            doc.checkOut(); 
    16251630 
    16261631            // re-read doc model after restoration