Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 324635

Summary: "Attempt to modify historical revision"-Exception after branch merge
Product: [Modeling] EMF Reporter: Pascal Lehmann <pascal.lehmann>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 CC: cyril.jaquier
Version: 4.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: offline-01
Attachments:
Description Flags
TestCase
stepper: iplog+
Proposed patch stepper: iplog+

Description Pascal Lehmann CLA 2010-09-07 06:17:20 EDT
Build Identifier: 4.0

When doing a change to an object (which was already known to the view), which has been updated by a branch-merge change (change on a different branch and merged back to main), you will get an 'attempt to modify historical version' exception on commit.

This is caused by the targetGoalDelta (introduced for bug #319522) in the RevisionDelta received for the merge change, having the same version as the source when receiving it from a branch-merge change.

Reproducible: Always

Steps to Reproduce:
1. Setup 2 transactions, create an element in transaction1 and commit, touch the element in transaction2 (to load it into the view).
2. Setup another branch and do a change to the element on the branch, then merge and commit to normal branch (using transaction1).
3. do another change to the element in transaction2 and commit.
Comment 1 Pascal Lehmann CLA 2010-09-07 06:19:46 EDT
Created attachment 178306 [details]
TestCase
Comment 2 Pascal Lehmann CLA 2010-09-07 06:23:56 EDT
Created attachment 178307 [details]
Proposed patch

Here is a patch proposal, but I'm unsure if this is the correct place to patch. I first tried to patch it on the server, but then went back to patch the version in the InvalidationTransition where the version is usually increased.
I increase the version by one when the source version equals the target version, which shouldn't be valid case.
Comment 3 Pascal Lehmann CLA 2010-09-07 06:24:53 EDT
1) The number of lines that you changed is smaller than 250.
confirmed.
2) You are the only author of these changed lines.
confirmed.
3) You apply the EPL to these changed lines.
confirmed.
Comment 4 Eike Stepper CLA 2010-09-13 04:02:00 EDT
Good catch, Pascal!
Comment 5 Eike Stepper CLA 2010-09-13 04:04:00 EDT
Committed to HEAD
Comment 6 Eike Stepper CLA 2011-06-23 03:42:21 EDT
Available in R20110608-1407