Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 298568 - Make editor clean after a commit in a push transaction
Summary: Make editor clean after a commit in a push transaction
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on: 297967
Blocks:
  Show dependency tree
 
Reported: 2009-12-28 06:01 EST by Gonzague Reydet CLA
Modified: 2010-06-29 09:21 EDT (History)
2 users (show)

See Also:
stepper: documentation-


Attachments
Patch v1 (2.95 KB, patch)
2009-12-28 06:40 EST, Eike Stepper CLA
no flags Details | Diff
Patch v2 (6.82 KB, patch)
2009-12-28 10:41 EST, Eike Stepper CLA
no flags Details | Diff
Fix for the dirty state update after importing changes and pushing diffs in repo (1.37 KB, patch)
2009-12-29 05:05 EST, Gonzague Reydet CLA
stepper: iplog+
Details | Diff
Dirty state fix v2 (1.18 KB, patch)
2009-12-31 02:39 EST, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gonzague Reydet CLA 2009-12-28 06:01:47 EST
Build Identifier: 

The editor keeps dirty when saving in push transaction.

It's a bit confusing from the user experience, the editor should be clean after a commit in push transaction.

Reproducible: Always
Comment 1 Eike Stepper CLA 2009-12-28 06:40:54 EST
Created attachment 155083 [details]
Patch v1

Please check if this suits your needs.
Comment 2 Eike Stepper CLA 2009-12-28 10:41:17 EST
Created attachment 155091 [details]
Patch v2

Added Strted and Finished events to push TX.
Comment 3 Eike Stepper CLA 2009-12-28 10:50:45 EST
Committed to HEAD
Comment 4 Gonzague Reydet CLA 2009-12-29 05:02:52 EST
There are two cases for which the editor appears to be dirty while it shouldn't:
- After re-importing local changes
- After pushing modifications in the repository

I will provide a patch to fix this
Comment 5 Gonzague Reydet CLA 2009-12-29 05:05:00 EST
Created attachment 155106 [details]
Fix for the dirty state update after importing changes and pushing diffs in repo
Comment 6 Gonzague Reydet CLA 2009-12-29 05:22:58 EST
Comment on attachment 155106 [details]
Fix for the dirty state update after importing changes and pushing diffs in repo

I confirm that I'm the only author and I apply the EPL.
Comment 7 Eike Stepper CLA 2009-12-31 02:39:17 EST
Created attachment 155149 [details]
Dirty state fix v2

I think your new code in the constructor was not very understandeable. Was your intent to set the dirty state of the push TX to the dirty state of the delegate TX before importChanges()? I guess my initial code did not consider that importChanges() causes CDOTransactionHandler events that, in turn, set the push TX to dirty.

Wouldn't it be easier to just set the push TX dirty state to the delegate's initial dirty state after calling importChanges()? Please review my easier patch and tell me if it's still correct.
Comment 8 Gonzague Reydet CLA 2010-01-04 04:09:38 EST
(In reply to comment #7)
> Created an attachment (id=155149) [details]
> Dirty state fix v2
> 
> I think your new code in the constructor was not very understandeable. Was your
> intent to set the dirty state of the push TX to the dirty state of the delegate
> TX before importChanges()? I guess my initial code did not consider that
> importChanges() causes CDOTransactionHandler events that, in turn, set the push
> TX to dirty.
> 
> Wouldn't it be easier to just set the push TX dirty state to the delegate's
> initial dirty state after calling importChanges()? Please review my easier
> patch and tell me if it's still correct.

Your modifications are ok for me.
Comment 9 Eike Stepper CLA 2010-02-02 12:58:21 EST
Committed to HEAD
Comment 10 Eike Stepper CLA 2010-06-29 04:40:39 EDT
Available in 3.0 GA:
http://download.eclipse.org/modeling/emf/cdo/updates/3.0-releases/