You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by claudia logan <cv...@yahoo.com> on 2007/07/11 21:18:14 UTC

Merging Binary files

Hi all,
   
  We recently migrated all our efforts into subversion and started creating branches and tags.   Our process states that all changes are made in the trunk.  Once we determine to "formally" create a branch in prep. for release, a POC (yours truly) creates the branch.  which then goes to testing...etc. days later an approved change is made in the trunk then is merged to the branch.  So having said this, I have two questions:
   
  1.  When I try to do a merge of only binary files, ie. word docs into the branch, I keep getting:  Skipped FolderName.... and conflicts, and creates 2 files: filenameRright and FilenameRleft.  When I do a status It states it as "C" conflict.  How do I merge a binary file? AND include the Skipped Foldername?  
   
  I am executing the following command:
   
  svn merge http://:my_repo/trunk/projectA/doc \
  http:/my_repo/branch/BranchName/doc   .
   
  I want the latest and greatest from the trunk into the branch.  Is this cor
   
  2.  From the best practices point of view, is this the best way to implement our process? 
   
  Thanks sooo much for your help!
   

 
---------------------------------
8:00? 8:25? 8:40?  Find a flick in no time
 with theYahoo! Search movie showtime shortcut.

Re: Merging Binary files

Posted by Marc Haisenko <ha...@comdasys.com>.
On Thursday 12 July 2007 12:40, claudia logan wrote:
> Thanks Ryan et al,
>    
>   But is there a way to just force binary merge since I know this is what I 
want, or "turn off" the diff for them.  This process should be completed with 
minimal effort and short amount of time.  It seems is almost easier to 
just "copy-n-paste" from trunk to branch and finish sooner. 
>    
>   Again, thanks for the advice, I will now try it. 
>    
>   C.

It's just not possible because SubVersion doesn't know anything about the 
binary file formats and would most propably corrupt the file if it would try 
to "merge" them.

SubVersion can merge text files because it knows about the format: it knows 
that text files consist of records, and each record is separated by some kind 
of line separator (which is different on UNIX, Windows and MacOS but well 
known). So SubVersion can look at each record (line) and if no changes in the 
same record happened SubVersion can merge them. But if the same line was 
changed in both sides of the revisions to merge then SubVersion simply can't 
guess what to do and will report a conflict which it can't merge.

For binary files no record separator is known (sometimes there just isn't 
any), it differs from format to format. So you would need a program that 
understand the format in question and would understand how to merge two 
versions. And there's really just no way SubVersion could ever merge binary 
files except maybe through the help of such external merge tools.

Hope that helps you understand the issue :-)
Bye,
	Marc

-- 
Marc Haisenko
Comdasys AG

Rüdesheimer Straße 7
D-80686 München
Tel:   +49 (0)89 - 548 433 321
e-mail: haisenko@comdasys.com
http://www.comdasys.com

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

Re: Merging Binary files

Posted by claudia logan <cv...@yahoo.com>.
Yes, you are correct.  99.9% of the time, there is only one author per document. So conflicts may be minimal or not at all.  Our process states that once a baseline is created (i.e. branches) only approved changes are made to it, while new dev. is made in the trunk. This great with code, while documents are not as dynamic (I mean, who likes to write documents..right).  Anyway, I think I am not quite yet used to Subversion's paradigm of one repo revision.  I am more familiar with other CM systems where each file has its own version and thus easier to "thread/tag".  I am sure the right process will handle this, I just need to find it.  
   
  C.

Matt Madrid <ad...@gmail.com> wrote: 
  Ok, so you want to basically copy the file from one place to another
using svn merge. Yes.

Understand what merge realy does....

svn merge FROM_THIS_FILE@HEAD TO_THIS_FILE@HEAD PUT_IT_HERE

So, since you know the file that is to be replaced, that would be the
FROM_THIS_FILE ... AND... the PUT_IT_HERE

There are situations where you sould get conflicts, but I'm guessing
in your situation that wouldn't happen often.

Matt

On 7/12/07, Ryan Schmidt wrote:
> On Jul 12, 2007, at 05:40, claudia logan wrote:
>
> > But is there a way to just force binary merge since I know this is
> > what I want, or "turn off" the diff for them. This process should
> > be completed with minimal effort and short amount of time. It
> > seems is almost easier to just "copy-n-paste" from trunk to branch
> > and finish sooner.
>
> I think you're asking: is there a way to "turn off" the conflict, and
> have Subversion just use the new version, overwriting the old
> version, regardless of conflicts. No, there isn't. After you merge,
> you will probably get a conflict. If you want to overwrite the old
> version, then do that (move the new file over the original file, and
> then tell Subversion the conflict is resolved). If this is too much
> work, then you can write a wrapper around svn merge, which does the
> merge and then does the moving and resolving. Call this wrapper
> instead of calling svn merge directly.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

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



 
---------------------------------
Don't be flakey. Get Yahoo! Mail for Mobile and 
always stay connected to friends.

Re: Merging Binary files

Posted by Matt Madrid <ad...@gmail.com>.
On 7/13/07, Matt Madrid <ad...@gmail.com> wrote:
> Ok, so you want to basically copy the file from one place to another
> using svn merge. Yes.
>
> Understand what merge realy does....
>
> svn merge FROM_THIS_FILE@HEAD TO_THIS_FILE@HEAD PUT_IT_HERE

Sorry, maybe not enough info....

The FROM_THIS_FILE and PUT_IT_HERE should be the same. The
TO_THIS_FILE is the url to the file that is the "latest and greatest."

See, merge says... I want you to change FROM_THIS_FILE@REVISION  ...
TO_THIS_FILE@REVISION .... and I want you to put the changed file in
PUT_IT_HERE

for binary files, there is rarely going to be a conflict here.

>
> So, since you know the file that is to be replaced, that would be the
> FROM_THIS_FILE  ... AND... the PUT_IT_HERE
>
> There are situations where you sould get conflicts, but I'm guessing
> in your situation that wouldn't happen often.
>
> Matt
>
> On 7/12/07, Ryan Schmidt <su...@ryandesign.com> wrote:
> > On Jul 12, 2007, at 05:40, claudia logan wrote:
> >
> > > But is there a way to just force binary merge since I know this is
> > > what I want, or "turn off" the diff for them.  This process should
> > > be completed with minimal effort and short amount of time.  It
> > > seems is almost easier to just "copy-n-paste" from trunk to branch
> > > and finish sooner.
> >
> > I think you're asking: is there a way to "turn off" the conflict, and
> > have Subversion just use the new version, overwriting the old
> > version, regardless of conflicts. No, there isn't. After you merge,
> > you will probably get a conflict. If you want to overwrite the old
> > version, then do that (move the new file over the original file, and
> > then tell Subversion the conflict is resolved). If this is too much
> > work, then you can write a wrapper around svn merge, which does the
> > merge and then does the moving and resolving. Call this wrapper
> > instead of calling svn merge directly.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: users-help@subversion.tigris.org
> >
> >
>

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

Re: Merging Binary files

Posted by Matt Madrid <ad...@gmail.com>.
Ok, so you want to basically copy the file from one place to another
using svn merge. Yes.

Understand what merge realy does....

svn merge FROM_THIS_FILE@HEAD TO_THIS_FILE@HEAD PUT_IT_HERE

So, since you know the file that is to be replaced, that would be the
FROM_THIS_FILE  ... AND... the PUT_IT_HERE

There are situations where you sould get conflicts, but I'm guessing
in your situation that wouldn't happen often.

Matt

On 7/12/07, Ryan Schmidt <su...@ryandesign.com> wrote:
> On Jul 12, 2007, at 05:40, claudia logan wrote:
>
> > But is there a way to just force binary merge since I know this is
> > what I want, or "turn off" the diff for them.  This process should
> > be completed with minimal effort and short amount of time.  It
> > seems is almost easier to just "copy-n-paste" from trunk to branch
> > and finish sooner.
>
> I think you're asking: is there a way to "turn off" the conflict, and
> have Subversion just use the new version, overwriting the old
> version, regardless of conflicts. No, there isn't. After you merge,
> you will probably get a conflict. If you want to overwrite the old
> version, then do that (move the new file over the original file, and
> then tell Subversion the conflict is resolved). If this is too much
> work, then you can write a wrapper around svn merge, which does the
> merge and then does the moving and resolving. Call this wrapper
> instead of calling svn merge directly.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

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

Re: Merging Binary files

Posted by claudia logan <cv...@yahoo.com>.
Yes, you are correct.  If there are 15+ binary files (and associated source code) and I need to update my branch with approved new files, this task becomes...well annoying ( I cant thing of a better word).   On the other hand, I do understand the need to ensure the proper changes take place when merging.  The wrapper you mentioned, is there such a script written already?  I am not much a coder....
   
  Also, is there a better tool to control documents?  Though the idea of managing two CM systems is not very appealing...
   
  Thanks for all your inputs. 
   
  C. 

Ryan Schmidt <su...@ryandesign.com> wrote:
  On Jul 12, 2007, at 05:40, claudia logan wrote:

> But is there a way to just force binary merge since I know this is 
> what I want, or "turn off" the diff for them. This process should 
> be completed with minimal effort and short amount of time. It 
> seems is almost easier to just "copy-n-paste" from trunk to branch 
> and finish sooner.

I think you're asking: is there a way to "turn off" the conflict, and 
have Subversion just use the new version, overwriting the old 
version, regardless of conflicts. No, there isn't. After you merge, 
you will probably get a conflict. If you want to overwrite the old 
version, then do that (move the new file over the original file, and 
then tell Subversion the conflict is resolved). If this is too much 
work, then you can write a wrapper around svn merge, which does the 
merge and then does the moving and resolving. Call this wrapper 
instead of calling svn merge directly.

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



       
---------------------------------
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.

Re: Merging Binary files

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jul 12, 2007, at 05:40, claudia logan wrote:

> But is there a way to just force binary merge since I know this is  
> what I want, or "turn off" the diff for them.  This process should  
> be completed with minimal effort and short amount of time.  It  
> seems is almost easier to just "copy-n-paste" from trunk to branch  
> and finish sooner.

I think you're asking: is there a way to "turn off" the conflict, and  
have Subversion just use the new version, overwriting the old  
version, regardless of conflicts. No, there isn't. After you merge,  
you will probably get a conflict. If you want to overwrite the old  
version, then do that (move the new file over the original file, and  
then tell Subversion the conflict is resolved). If this is too much  
work, then you can write a wrapper around svn merge, which does the  
merge and then does the moving and resolving. Call this wrapper  
instead of calling svn merge directly.

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

Re: Merging Binary files

Posted by claudia logan <cv...@yahoo.com>.
Thanks Ryan et al,
   
  But is there a way to just force binary merge since I know this is what I want, or "turn off" the diff for them.  This process should be completed with minimal effort and short amount of time.  It seems is almost easier to just "copy-n-paste" from trunk to branch and finish sooner. 
   
  Again, thanks for the advice, I will now try it. 
   
  C.
   
   
   
   
  
Ryan Schmidt <su...@ryandesign.com> wrote:
  
On Jul 11, 2007, at 16:18, claudia logan wrote:

> We recently migrated all our efforts into subversion and started 
> creating branches and tags. Our process states that all changes 
> are made in the trunk. Once we determine to "formally" create a 
> branch in prep. for release, a POC (yours truly) creates the 
> branch. which then goes to testing...etc. days later an approved 
> change is made in the trunk then is merged to the branch. So 
> having said this, I have two questions:
>
> 1. When I try to do a merge of only binary files, ie. word docs 
> into the branch, I keep getting: Skipped FolderName.... and 
> conflicts, and creates 2 files: filenameRright and FilenameRleft. 
> When I do a status It states it as "C" conflict. How do I merge a 
> binary file? AND include the Skipped Foldername?
>
> I am executing the following command:
>
> svn merge http://:my_repo/trunk/projectA/doc \
> http:/my_repo/branch/BranchName/doc .
>
> I want the latest and greatest from the trunk into the branch. Is 
> this cor
>
> 2. From the best practices point of view, is this the best way to 
> implement our process?


Subversion cannot merge binary files for you, so it gives you the 
left and right files so that you can compare them yourself. You can 
either open both of them in a program that understands those binary 
files (presumably Microsoft Word for Word documents, for example), 
visually compare them, and manually redo the changes. Or, use a tool 
that understands how to show you a diff of that binary format. For 
example, TortoiseSVN on Windows includes a diff viewer for Word 
documents, I believe. For each file format that you want to diff, you 
need a tool that understands that format.

As to why the folder was skipped, your merge command is not correct 
for what you want to do. The merge command is really just a diff and 
patch. So you have asked Subversion to compute the difference between 
the head of the trunk and the head of the branch, and apply that 
difference to the working copy. That's not what you want.

You need to keep track of revisions. Assume you created the branch 
from the trunk at revision 100. Now some time has passed and the 
repository is at revision 120 and there are more changes in the trunk 
that you would like to merge into the branch. Do this:

svn merge -r100:120 http://my_repo/trunk/projectA/doc .

...where "." is a working copy of the branch. Resolve any conflicts 
and test, and then commit, making sure to note in your commit message 
what revisions you merged, like:

svn ci -m "Merging -r100:120 from trunk into some branch"

That way, next time you want to merge, you can look into the log to 
remind yourself where you need to start. (In this case, your next 
merge would need to start at r120.)


The above is necessary because Subversion does not have merge 
tracking. That feature is currently being developed, so this process 
will probably become easier in the future, but how long you'll have 
to wait is not currently known.


An alternative is to use the svnmerge script to do all of your 
merges, which handles some of these details for you.


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



 
---------------------------------
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.

Re: Merging Binary files

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jul 11, 2007, at 16:18, claudia logan wrote:

> We recently migrated all our efforts into subversion and started  
> creating branches and tags.   Our process states that all changes  
> are made in the trunk.  Once we determine to "formally" create a  
> branch in prep. for release, a POC (yours truly) creates the  
> branch.  which then goes to testing...etc. days later an approved  
> change is made in the trunk then is merged to the branch.  So  
> having said this, I have two questions:
>
> 1.  When I try to do a merge of only binary files, ie. word docs  
> into the branch, I keep getting:  Skipped FolderName.... and  
> conflicts, and creates 2 files: filenameRright and FilenameRleft.   
> When I do a status It states it as "C" conflict.  How do I merge a  
> binary file? AND include the Skipped Foldername?
>
> I am executing the following command:
>
> svn merge http://:my_repo/trunk/projectA/doc \
> http:/my_repo/branch/BranchName/doc   .
>
> I want the latest and greatest from the trunk into the branch.  Is  
> this cor
>
> 2.  From the best practices point of view, is this the best way to  
> implement our process?


Subversion cannot merge binary files for you, so it gives you the  
left and right files so that you can compare them yourself. You can  
either open both of them in a program that understands those binary  
files (presumably Microsoft Word for Word documents, for example),  
visually compare them, and manually redo the changes. Or, use a tool  
that understands how to show you a diff of that binary format. For  
example, TortoiseSVN on Windows includes a diff viewer for Word  
documents, I believe. For each file format that you want to diff, you  
need a tool that understands that format.

As to why the folder was skipped, your merge command is not correct  
for what you want to do. The merge command is really just a diff and  
patch. So you have asked Subversion to compute the difference between  
the head of the trunk and the head of the branch, and apply that  
difference to the working copy. That's not what you want.

You need to keep track of revisions. Assume you created the branch  
from the trunk at revision 100. Now some time has passed and the  
repository is at revision 120 and there are more changes in the trunk  
that you would like to merge into the branch. Do this:

svn merge -r100:120 http://my_repo/trunk/projectA/doc .

...where "." is a working copy of the branch. Resolve any conflicts  
and test, and then commit, making sure to note in your commit message  
what revisions you merged, like:

svn ci -m "Merging -r100:120 from trunk into some branch"

That way, next time you want to merge, you can look into the log to  
remind yourself where you need to start. (In this case, your next  
merge would need to start at r120.)


The above is necessary because Subversion does not have merge  
tracking. That feature is currently being developed, so this process  
will probably become easier in the future, but how long you'll have  
to wait is not currently known.


An alternative is to use the svnmerge script to do all of your  
merges, which handles some of these details for you.


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