You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Gabriel Scolan <ga...@gmx.net> on 2008/06/22 09:30:53 UTC

merging xml files

Hello,

I'd like to know if someone has a solution to automatically merge two 
xml files (by merge or update operation) using svn ?
I've got an example where SVN doesn't solve the conflict itself :
File 1, in the repository
<node attribute="my attribute" property="my prop"/>
File 2, started from file 1 and committed to the repository
<node attribute="my attribute2" property="my prop"/>
File 3, started from file 1 but in the workarea
<node attribute="my attribute" property="my prop 2"/>
I'd like to get the following merge result,
<node attribute="my attribute2" property="my prop 2"/>

In other words, the attributes of the nodes have both changed but they 
are 2 separate entities, so mergeable without conflict (but as they are 
on the same line, svn raise the conflict)
I'm using svn-1.4.6

thanks in advance
gabriel

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: merging xml files

Posted by John Peacock <jo...@havurah-software.org>.
Gabriel Scolan wrote:
> Can you give me a tip where I can hook the "update" action to determine 
> with an other diff tool whether there is a conflict or not and indicate 
> to the user where the conflict is in such a case or simply merge without 
> any other warning to the user ?

You are looking for the 'diff3-cmd' line in the .subversion/config file. 
  You may want to take a look at svndiffwrapper:

	http://www.yolinux.com/TUTORIALS/src/svndiffwrapper.txt

for one example of how to wrap a merge tool into the Subversion 
workflow.  I have modified the above script slightly to always attempt 
the automatic merge and only call up the graphical merge tool if that 
fails (the script as it stands always prompts first).

John

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: merging xml files

Posted by Gabriel Scolan <ga...@gmx.net>.
Hi Paul,

thanks for this quick answer!
Can you give me a tip where I can hook the "update" action to determine 
with an other diff tool whether there is a conflict or not and indicate 
to the user where the conflict is in such a case or simply merge without 
any other warning to the user ?
many thanks
gabriel

Paul R a écrit :
> Gabriel Scolan <ga...@gmx.net> writes:
>
>   
>> I'd like to know if someone has a solution to automatically merge two
>> xml files (by merge or update operation) using svn ?
>>     
>
> SVN server side does NOT do any merge operation. Merge happens on the
> client side when working copy as diverged from server copy. You can
> call ANY process you want to carry ANY type of intelligent merge, this
> is NOT svn job. As a convenience, svn client is shipped with the most
> common diff/patch line-by-line merging mechanism, which can not handle
> this case. You'll have to find some dedicated xml merging tools, or
> write your own.
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: merging xml files

Posted by Paul R <pa...@gmail.com>.
Gabriel Scolan <ga...@gmx.net> writes:

> I'd like to know if someone has a solution to automatically merge two
> xml files (by merge or update operation) using svn ?

SVN server side does NOT do any merge operation. Merge happens on the
client side when working copy as diverged from server copy. You can
call ANY process you want to carry ANY type of intelligent merge, this
is NOT svn job. As a convenience, svn client is shipped with the most
common diff/patch line-by-line merging mechanism, which can not handle
this case. You'll have to find some dedicated xml merging tools, or
write your own.

-- 
      Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org