Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [subversive-dev] How to prevent automatic merge

Hi Alexander,

I am not sure where the misunderstanding is, but let me state the problem in more detail. During an update, standard Subversion behaviour is to merge incoming changes into local files, which may contain local changes. This is only the case for text files, not for binary files. In our application, we are using text-based file formats to store our model objects. Thus, an automatic merge would normally take place on these files.

However, in our application, the user never sees the actual files; the user sees only the model objects that are persisted in the files. Therefore, automatic merging must be prevented at any price, because the user cannot verify the automatic merge. If at all, merging would have to take place on a model level, which we might implement in the future.

The behaviour must be the following: If a file has both local changes and changes in the repository, during an update, automatic merging must NOT take place. Instead, the user must be warned that the file could not be updated. The user must then resolve the conflict (move away the locally changed model object, or revert the changes) and retry the update.

One solution would be to mark all our files as binary, because binary files are never merged automatically. However, we would like to have a more elegant solution.

I have attached my ResourceMappingMerger for a start. It contains the core of what I want to accomplish (prevent merging, leave the conflict unresolved). Now I want this class to be called during ALL update operations, not just the one triggered from the synchronize view.

It will take me some more time to create a working plug-in that I can share. Let me know if I can provide you with some other concrete information in the mean time.

Thanks,
Biörn

________________________________________
From: subversive-dev-bounces@xxxxxxxxxxx [subversive-dev-bounces@xxxxxxxxxxx] on behalf of Alexander Gurov [alexander.gurov@xxxxxxxxxxxx]
Sent: 27 July 2012 9:07
To: Developers mailing list
Subject: Re: [subversive-dev] How to prevent automatic merge

Hello Biörn,

It's my fault for misleading you, I've misunderstood your question.
There is the ConflictResolverCallback interface in both libraries, if
we're talking about merging unresolved conflicts only. This interface is
mapped to the ISVNConflictResolutionCallback in Subversive, but yet to
be used anywhere. There is some merge models support in Subversive, but
it seems to be working only when it is related to Synchronize View
contents, while Merge View and Team->Update/Switch actions seems to be
unaffected. I think there should be some code that should allow to
consult models about merge through ISVNConflictResolutionCallback calls.
I'll try asking the person who did implement a models support why it is
working like it is now and how it was supposed to be.

P.S.
Also, if it is not too hard for you and you can avoid revealing any
commercial information, could you please give me some short sample of
how it should look like in code on your side (so I can use it as a test
case to ensure merge support works like it should)?

Best regards,
Alexander.

26.07.2012 15:06, Biörnstad, Biörn пишет:
> Hi Alexander,
>
> I am a bit confused by your answer. I have done tests with SVNKit and the Eclipse team framework. When using SVNKit, I am able to take control over the merging process through the ISVNMerger interface. In Eclipse, I seem to be able to do the same through a IResourceMappingMerger. However, it seems that the merger is invoked only when executing "Update All" in the synchronize view (MergeAllOperation/ModelMergeOperation), not during a "normal" update.
>
> Can you clear up my confusion? What are the missing bits in Subversive?
>
> Thanks,
> Biörn
>
> ________________________________________
> From: subversive-dev-bounces@xxxxxxxxxxx [subversive-dev-bounces@xxxxxxxxxxx] on behalf of Alexander Gurov [alexander.gurov@xxxxxxxxxxxx]
> Sent: Tuesday, July 17, 2012 21:37
> To: Developers mailing list
> Subject: Re: [subversive-dev] How to prevent automatic merge
>
> Hello Biörn,
>
> Unfortunately there is no way to interfere with the SVN client library
> merging files on update/merge/switch (neither one of both libraries -
> SVN Kit and JavaHL - provides such API) and this is why it is impossible
> in Subversive as well,
>
> Best regards,
> Alexander.
>
> 17.07.2012 16:02, Biörnstad, Biörn пишет:
>> Hi,
>>
>> What is the easiest way of preventing Subversive from automatically merging files? When the user executes an update operation, I do not want any automatic merges to take place, as with binary files.
>>
>> I have tried providing an IResourceMappingMerger and an IStorageMerger, but it did not work for me.
>>
>> Thanks,
>> Biörn

Attachment: ExampleResourceMappingMerger.java
Description: ExampleResourceMappingMerger.java


Back to the top