Re: Issue with merge/integration algorithm?
On Fri, Jul 27, 2012 at 08:03:22AM -0700, Arunmozhi wrote: I am resending the initial mail as the mail format other than text is not supported. I feel that the SVN branching and merging/integration algorithm is flawed. However I am not sure if this is a known limitation of SVN. I did 2 tests to compare SVN against Perforce/git. The intention of the test is to see if a change done by a user at some point in time and taken to multiple branches comes back to the main branch duplicated multiple times without indicating a conflict. Please look into the attached tests.txt. Each column shows the contents of a file as we do successive changes to the file. Also please refer below the explanatory steps. I use tortoisesvn 1.7.5 as the user interface and hence I can just list the menu commands corresponding to each step and not the exact SVN commands (I am not used to the command line). The following are the steps I executed for Test 1. (1) Create a file myfile.txt with following contents and add it to the repository (TortoiseSVN - Add, SVN Commit). a b c z (2) Branch the file myfile.txt to a new location (TortoiseSVN - Branch/Tag (From:myfile.txt To:branch1/myfile.txt), SVN update). Now the contents of branch1/myfile.txt is a b c z (3) Edit the branch1/myfile.txt by inserting a line 'd' as follows and then commit the changes (SVN Commit). Now the contents of branch1/myfile.txt is a b c d z (4) Now branch the file branch1/myfile.txt to branch2/myfile.txt (TortoiseSVN - Branch/Tag (From:branch1/myfile.txt To:branch2/myfile.txt), SVN update). Now the contents of branch2/myfile.txt is a b c d z (5) Now edit the file branch2/myfile.txt by changing the 'c' to 'x' and then commit the changes (SVN commit). Now the contents of branch2/myfile.txt is a b x d z (6) Now integrate the branch1/myfile.txt back to myfile.txt (TortoiseSVN - Merge (Reintegrate a branch From:branch1/myfile.txt To working copy:myfile.txt), SVN commit). Now the contents of myfile.txt is a b c d z (7) Now integrate the branch2/myfile.txt back to myfile.txt (TortoiseSVN - Merge (Reintegrate a branch From:branch2/myfile.txt To working copy:myfile.txt), SVN commit). Now the contents of myfile.txt is a b x d d z You can see that the line 'd' appears twice in the integrated file. 'd' is inserted only once in the revision history. The expected output (verified in perforce and git) is a b x d z Yes, I can see the problem now, thanks. I suppose it depends on the way Subversion selects a common ancestor to use as merge base. Git, perforce and svn internally all use the diff3 algorithm to perform file merges. The result of that algorithm depends on the set of input files, often called base, merge-left, merge-right, where the merge-left and merge-right version of the file are both derived from the same base file. Subversion's selection of the common ancestor (the base) is affected by mergeinfo. The order in which merges are performed matters since it affects merge-tracking information present during the final merge. If you reintegrate branch2/myfile.txt into branch1/myfile.txt first, and then reintegrate branch1/myfile.txt to /myfile.txt, the result of the last merge is the same as with git and perforce: $ svn diff Index: myfile.txt === --- myfile.txt (revision 7) +++ myfile.txt (working copy) @@ -1,4 +1,5 @@ a b -c +x +d z If you want to understand in more detail how Subversion's merges behaves I'd recommend reading http://wiki.apache.org/subversion/SymmetricMerge Git and perforce perform merge-tracking in a different way, and might always select the same common ancestor independently of the order merges are performed in.
Issue with merge/integration algorithm?
I feel that the SVN branching and merging/integration algorithm is flawed. However I am not sure if this is a known limitation of SVN. I did 2 tests to compare SVN against Perforce/git. The intention of the test is to see if a change done by a user at some point in time and taken to multiple branches comes back to the main branch duplicated multiple times without indicating a conflict. (Look at the attached tests.txt if the following looks misaligned) Test 1: --- Integrate B1 back to main +---+ | V Main - Branch1 - Branch2 Main Main a a a a a a a b b b b b b b c c c c x c x z z d d d d d z z z z d | z | ^ +-+ Integrate B2 back to main In Perforce/git the result is (without conflict) a b x d z Test 2: --- Integrate B1 back to main ++ | V Main - Branch1 - Branch2 Main Main a a a a a a a a b b b b d d b d c c c c z b c b z z d d c d c z z z z d | z | ^ +-+ Integrate B2 back to main In Perforce/git the result is (without conflict) a d b c z Any thoughts? Test 1: --- Integrate B1 back to main +---+ | V Main - Branch1 - Branch2 Main Main a aa aaaa b bb bbbb c cc cxcx z zd dddd z zzzd | z | ^ +-+ Integrate B2 back to main In Perforce the result is (without conflict) a b x d z Test 2: --- Integrate B1 back to main ++ |V Main - Branch1 - Branch2 Main Main a aa a a aaa b bb b d dbd c cc c z bcb z zd d cdc z z zzd | z | ^ +-+ Integrate B2 back to main In Perforce the result is (without conflict) a d b c z
Re: Issue with merge/integration algorithm?
On Fri, Jul 27, 2012 at 06:11:34AM -0700, Arunmozhi wrote: I feel that the SVN branching and merging/integration algorithm is flawed. However I am not sure if this is a known limitation of SVN. I did 2 tests to compare SVN against Perforce/git. The intention of the test is to see if a change done by a user at some point in time and taken to multiple branches comes back to the main branch duplicated multiple times without indicating a conflict. I'm afraid it's hard to help you based on the information you've given. You're not showing any svn commands you're running. You're not showing the results you got from svn. Without that information it's impossible to tell what you were really doing.
Re: Issue with merge/integration algorithm?
Please look into the attached tests.txt file attached in the initial mail for the input and the result. Each column shows the contents of a file as we do successive changes to the file. I use tortoisesvn 1.7.5 as the user interface and hence I can just list the menu commands corresponding to each step and not the exact SVN commands (I am not used to the command line). The following are the steps I executed for Test 1. (1) Create a file myfile.txt with following contents and add it to the repository (TortoiseSVN - Add, SVN Commit). a b c z (2) Branch the file myfile.txt to a new location (TortoiseSVN - Branch/Tag (From:myfile.txt To:branch1/myfile.txt), SVN update). Now the contents of branch1/myfile.txt is a b c z (3) Edit the branch1/myfile.txt by inserting a line 'd' as follows and then commit the changes (SVN Commit). Now the contents of branch1/myfile.txt is a b c d z (4) Now branch the file branch1/myfile.txt to branch2/myfile.txt (TortoiseSVN - Branch/Tag (From:branch1/myfile.txt To:branch2/myfile.txt), SVN update). Now the contents of branch2/myfile.txt is a b c d z (5) Now edit the file branch2/myfile.txt by changing the 'c' to 'x' and then commit the changes (SVN commit). Now the contents of branch2/myfile.txt is a b x d z (6) Now integrate the branch1/myfile.txt back to myfile.txt (TortoiseSVN - Merge (Reintegrate a branch From:branch1/myfile.txt To working copy:myfile.txt), SVN commit). Now the contents of myfile.txt is a b c d z (7) Now integrate the branch2/myfile.txt back to myfile.txt (TortoiseSVN - Merge (Reintegrate a branch From:branch2/myfile.txt To working copy:myfile.txt), SVN commit). Now the contents of myfile.txt is a b x d d z You can see that the line 'd' appears twice in the integrated file. 'd' is inserted only once in the revision history. The expected output (verified in perforce and git) is a b x d z The second test shown in the attached tests.txt is similar, but shows another clear problem of the line 'd' appearing twice in the integrated file. Final integrated file is shown below. a d b c d z The expected output for the second test as verified in perforce and git is a d b c z Hope now it clarifies the problem. From: Stefan Sperling s...@elego.de To: Arunmozhi arunmozh...@yahoo.com Cc: users@subversion.apache.org users@subversion.apache.org Sent: Friday, 27 July 2012 7:06 PM Subject: Re: Issue with merge/integration algorithm? On Fri, Jul 27, 2012 at 06:11:34AM -0700, Arunmozhi wrote: I feel that the SVN branching and merging/integration algorithm is flawed. However I am not sure if this is a known limitation of SVN. I did 2 tests to compare SVN against Perforce/git. The intention of the test is to see if a change done by a user at some point in time and taken to multiple branches comes back to the main branch duplicated multiple times without indicating a conflict. I'm afraid it's hard to help you based on the information you've given. You're not showing any svn commands you're running. You're not showing the results you got from svn. Without that information it's impossible to tell what you were really doing.
Re: Issue with merge/integration algorithm?
I am resending the initial mail as the mail format other than text is not supported. I feel that the SVN branching and merging/integration algorithm is flawed. However I am not sure if this is a known limitation of SVN. I did 2 tests to compare SVN against Perforce/git. The intention of the test is to see if a change done by a user at some point in time and taken to multiple branches comes back to the main branch duplicated multiple times without indicating a conflict. Please look into the attached tests.txt. Each column shows the contents of a file as we do successive changes to the file. Also please refer below the explanatory steps. I use tortoisesvn 1.7.5 as the user interface and hence I can just list the menu commands corresponding to each step and not the exact SVN commands (I am not used to the command line). The following are the steps I executed for Test 1. (1) Create a file myfile.txt with following contents and add it to the repository (TortoiseSVN - Add, SVN Commit). a b c z (2) Branch the file myfile.txt to a new location (TortoiseSVN - Branch/Tag (From:myfile.txt To:branch1/myfile.txt), SVN update). Now the contents of branch1/myfile.txt is a b c z (3) Edit the branch1/myfile.txt by inserting a line 'd' as follows and then commit the changes (SVN Commit). Now the contents of branch1/myfile.txt is a b c d z (4) Now branch the file branch1/myfile.txt to branch2/myfile.txt (TortoiseSVN - Branch/Tag (From:branch1/myfile.txt To:branch2/myfile.txt), SVN update). Now the contents of branch2/myfile.txt is a b c d z (5) Now edit the file branch2/myfile.txt by changing the 'c' to 'x' and then commit the changes (SVN commit). Now the contents of branch2/myfile.txt is a b x d z (6) Now integrate the branch1/myfile.txt back to myfile.txt (TortoiseSVN - Merge (Reintegrate a branch From:branch1/myfile.txt To working copy:myfile.txt), SVN commit). Now the contents of myfile.txt is a b c d z (7) Now integrate the branch2/myfile.txt back to myfile.txt (TortoiseSVN - Merge (Reintegrate a branch From:branch2/myfile.txt To working copy:myfile.txt), SVN commit). Now the contents of myfile.txt is a b x d d z You can see that the line 'd' appears twice in the integrated file. 'd' is inserted only once in the revision history. The expected output (verified in perforce and git) is a b x d z The second test shown in the attached tests.txt is similar, but shows another clear problem of the line 'd' appearing twice in the integrated file. Upto step 4, it is same as for test 1 (5) Edit branch2/myfile.txt and delete 'b' and 'c' and then commit changes a dz (6) Edit branch2/myfile.txt and add 'b' and 'c' below 'd' and then commit changes a d b c z (7) Reintegrate branch1/myfile.txt to myfile.txt a b c d z (8) Reintegrate branch2/myfile.txt to myfile.txt. The final integrated file is shown below. a d b c d z The expected output for the second test as verified in perforce and git is a d b c z Hope now it clarifies the problem. - Original Message - From: Stefan Sperling s...@elego.de To: Arunmozhi arunmozh...@yahoo.com Cc: users@subversion.apache.org users@subversion.apache.org Sent: Friday, 27 July 2012 7:06 PM Subject: Re: Issue with merge/integration algorithm? On Fri, Jul 27, 2012 at 06:11:34AM -0700, Arunmozhi wrote: I feel that the SVN branching and merging/integration algorithm is flawed. However I am not sure if this is a known limitation of SVN. I did 2 tests to compare SVN against Perforce/git. The intention of the test is to see if a change done by a user at some point in time and taken to multiple branches comes back to the main branch duplicated multiple times without indicating a conflict. I'm afraid it's hard to help you based on the information you've given. You're not showing any svn commands you're running. You're not showing the results you got from svn. Without that information it's impossible to tell what you were really doing. Test 1: --- Integrate B1 back to main +---+ | V Main - Branch1 - Branch2 Main Main a aa aaaa b bb bbbb c cc cxcx z zd dddd z zzzd | z | ^ +-+ Integrate B2 back to main In Perforce the result is (without conflict) a b x d z Test 2: --- Integrate B1 back to main ++ |V Main - Branch1 - Branch2 Main Main a aa a a aaa b bb b d dbd c cc c z bcb z zd d cdc z z zzd | z
Re: Issue with merge
On Thu, Jun 16, 2011 at 10:21:49PM -0500, Henry Piñeros wrote: 7. Again, I do a checkout from trunk (C:/Trunk). 8. svn merge *https**://example-test-project.googlecode.com/svn/trunk/src/* *https**:// example-test-project.googlecode.com/svn/branches/branchPrueba/src/* I think you should try to use this syntax instead: cd c:\trunk svn merge --reintegrate https://example-test-project.googlecode.com/svn/branches/branchPrueba/ C Hola1.java … Shows a message to resolve conflict between fonts Tomorrow, I going to post here!! (with images) No, please do not post images to this list. You may link to them if you have them somewhere on the web, but please do not attach them. Mail you send to this list goes to a huge number of mail boxes so please try to use only text to keep the messages small. Thanks!
Re: Issue with merge
Hi all. http://twitpic.com/5ctrar/full There are a picture of my issue!!! On Fri, Jun 17, 2011 at 2:32 AM, Stefan Sperling s...@elego.de wrote: On Thu, Jun 16, 2011 at 10:21:49PM -0500, Henry Piñeros wrote: 7. Again, I do a checkout from trunk (C:/Trunk). 8. svn merge *https**:// example-test-project.googlecode.com/svn/trunk/src/* *https**:// example-test-project.googlecode.com/svn/branches/branchPrueba/src/* I think you should try to use this syntax instead: cd c:\trunk svn merge --reintegrate https://example-test-project.googlecode.com/svn/branches/branchPrueba/ C Hola1.java … Shows a message to resolve conflict between fonts Tomorrow, I going to post here!! (with images) No, please do not post images to this list. You may link to them if you have them somewhere on the web, but please do not attach them. Mail you send to this list goes to a huge number of mail boxes so please try to use only text to keep the messages small. Thanks! -- Estudiante de Ingenieria de Sistemas e Informatica Univesidad Nacional de Colombia Sede Medellin 2011
Issue with merge
Hi all. I do a merge between two folders (source) (Ep. svn merge http:xxx/src http:xxx/src) and it works very well (It shows a File1.java with a conflcit -C) Whe and I try do it but directly in this file, the merges doesn't work (Ep. svn merge http:xxx/src/File1.java http:xxx/src/File1.java ).. It doesn't show the conflict, it show -U File1.java!! Help me!! Sorry for my englsih -- Estudiante de Ingenieria de Sistemas e Informatica Univesidad Nacional de Colombia Sede Medellin 2011
Re: Issue with merge
On Thu, Jun 16, 2011 at 02:27:52PM -0500, Henry Piñeros wrote: Hi all. I do a merge between two folders (source) (Ep. svn merge http:xxx/src http:xxx/src) and it works very well (It shows a File1.java with a conflcit -C) Whe and I try do it but directly in this file, the merges doesn't work (Ep. svn merge http:xxx/src/File1.java http:xxx/src/File1.java ).. It doesn't show the conflict, it show -U File1.java!! Hmmm, your problem description is lacking a lot of detail :( I will try to help you anyway: Did you run svn revert -R . on your working copy before repeating the merge? If you did not, then merge tracking might prevent changes from being merged into the file because the file already has them. All you will end up with in this case is probably a mergeinfo change. If your working copy has no local changes (svn diff output is empty) and you don't get any changes merged into your working copy, try this command: svn diff http:xxx/src/File1.java http:xxx/src/File1.java and you will probably see that your merge has an *empty* diff. So there is nothing to merge, and no conflict. The only thing it changes is probably mergeinfo. You probably want something like this instead: cd src/ svn merge -c 42 http:xxx/src/File1.java File1.java or this: cd src/ svn merge http:xxx/src/File1.java@42 http:xxx/src/File1.java@43 File1.java or this (to merge all outstanding changes): cd src/ svn merge http:xxx/src/File1.java File1.java See also: http://svnbook.red-bean.com/nightly/en/svn.branchmerge.advanced.html#svn.branchmerge.advanced.advancedsyntax And this: http://mail-archives.apache.org/mod_mbox/subversion-users/201103.mbox/%3c20110308203505.gb19...@jack.stsp.name%3E
Re: Issue with merge
Thanks Stefan!!. Yes, I do svn revert -R or do a new checkout!!! The problem is whenI try do a mergen on file level, but if I do it on folder lever(parent folder of that file), It works :( On Thu, Jun 16, 2011 at 3:10 PM, Stefan Sperling s...@elego.de wrote: On Thu, Jun 16, 2011 at 02:27:52PM -0500, Henry Piñeros wrote: Hi all. I do a merge between two folders (source) (Ep. svn merge http:xxx/src http:xxx/src) and it works very well (It shows a File1.java with a conflcit -C) Whe and I try do it but directly in this file, the merges doesn't work (Ep. svn merge http:xxx/src/File1.java http:xxx/src/File1.java ).. It doesn't show the conflict, it show -U File1.java!! Hmmm, your problem description is lacking a lot of detail :( I will try to help you anyway: Did you run svn revert -R . on your working copy before repeating the merge? If you did not, then merge tracking might prevent changes from being merged into the file because the file already has them. All you will end up with in this case is probably a mergeinfo change. If your working copy has no local changes (svn diff output is empty) and you don't get any changes merged into your working copy, try this command: svn diff http:xxx/src/File1.java http:xxx/src/File1.java and you will probably see that your merge has an *empty* diff. So there is nothing to merge, and no conflict. The only thing it changes is probably mergeinfo. You probably want something like this instead: cd src/ svn merge -c 42 http:xxx/src/File1.java File1.java or this: cd src/ svn merge http:xxx/src/File1.java@42 http:xxx/src/file1.j...@43file1.java or this (to merge all outstanding changes): cd src/ svn merge http:xxx/src/File1.java File1.java See also: http://svnbook.red-bean.com/nightly/en/svn.branchmerge.advanced.html#svn.branchmerge.advanced.advancedsyntax And this: http://mail-archives.apache.org/mod_mbox/subversion-users/201103.mbox/%3c20110308203505.gb19...@jack.stsp.name%3E -- Estudiante de Ingenieria de Sistemas e Informatica Univesidad Nacional de Colombia Sede Medellin 2011
Re: Issue with merge
Can you try it in your computer ? A simple example!!! ( a flder with two files) On Thu, Jun 16, 2011 at 3:36 PM, Henry Piñeros hapiner...@gmail.com wrote: Thanks Stefan!!. Yes, I do svn revert -R or do a new checkout!!! The problem is whenI try do a mergen on file level, but if I do it on folder lever(parent folder of that file), It works :( On Thu, Jun 16, 2011 at 3:10 PM, Stefan Sperling s...@elego.de wrote: On Thu, Jun 16, 2011 at 02:27:52PM -0500, Henry Piñeros wrote: Hi all. I do a merge between two folders (source) (Ep. svn merge http:xxx/src http:xxx/src) and it works very well (It shows a File1.java with a conflcit -C) Whe and I try do it but directly in this file, the merges doesn't work (Ep. svn merge http:xxx/src/File1.java http:xxx/src/File1.java ).. It doesn't show the conflict, it show -U File1.java!! Hmmm, your problem description is lacking a lot of detail :( I will try to help you anyway: Did you run svn revert -R . on your working copy before repeating the merge? If you did not, then merge tracking might prevent changes from being merged into the file because the file already has them. All you will end up with in this case is probably a mergeinfo change. If your working copy has no local changes (svn diff output is empty) and you don't get any changes merged into your working copy, try this command: svn diff http:xxx/src/File1.java http:xxx/src/File1.java and you will probably see that your merge has an *empty* diff. So there is nothing to merge, and no conflict. The only thing it changes is probably mergeinfo. You probably want something like this instead: cd src/ svn merge -c 42 http:xxx/src/File1.java File1.java or this: cd src/ svn merge http:xxx/src/File1.java@42 http:xxx/src/file1.j...@43file1.java or this (to merge all outstanding changes): cd src/ svn merge http:xxx/src/File1.java File1.java See also: http://svnbook.red-bean.com/nightly/en/svn.branchmerge.advanced.html#svn.branchmerge.advanced.advancedsyntax And this: http://mail-archives.apache.org/mod_mbox/subversion-users/201103.mbox/%3c20110308203505.gb19...@jack.stsp.name%3E -- Estudiante de Ingenieria de Sistemas e Informatica Univesidad Nacional de Colombia Sede Medellin 2011 -- Estudiante de Ingenieria de Sistemas e Informatica Univesidad Nacional de Colombia Sede Medellin 2011
Re: Issue with merge
On 2011-06-16 22:37, Henry Piñeros wrote: Can you try it in your computer ? A simple example!!! ( a flder with two files) [...] Henry, please tell us _exactly_ what you did; that is, the sequence of Subversion commands, and their output, if any. Cut and paste from the command line window. Then indicate where and when Subversion didn't work as you expected, and why you think it is not working right. By doing that, you very much increase the chances of getting the answer you are looking for. Also, if people agree that there is a problem, you actually contributed a test case for the Subversion test suite! Thanks. -- Michael Diers, elego Software Solutions GmbH, http://www.elego.de signature.asc Description: OpenPGP digital signature
Re: Issue with merge
This is my case!!! 1. I do a copyTo() from my trunk to a branch (branchPrueba). 2. I do a checkout from branchPrueba (C:/Prueba), I modify a file (Hola1.java) and after I do commite it. 3. I do a checkout from trunk (C:/Trunk), I modify a file (Hola1.java) and after I do commite it. 4. Run cmd, then… cd C:/Trunk/src 5. svn merge *https**:// example-test-project.googlecode.com/svn/trunk/src/Hola1.java* *https**:// example-test-project.googlecode.com/svn/branches/branchPrueba/src/Hola1.java * --Merge difference… U Hola1.java 6. I drop C:/Trunk (I didn’t commit it). 7. Again, I do a checkout from trunk (C:/Trunk). 8. svn merge *https**://example-test-project.googlecode.com/svn/trunk/src/* *https**:// example-test-project.googlecode.com/svn/branches/branchPrueba/src/* C Hola1.java … Shows a message to resolve conflict between fonts Tomorrow, I going to post here!! (with images) Thank before hands ... I forget this!! I do merge between the files .java with tortoise which work very well.. It show the copnflict 2011/6/16 Michael Diers mdi...@elegosoft.com On 2011-06-16 22:37, Henry Piñeros wrote: Can you try it in your computer ? A simple example!!! ( a flder with two files) [...] Henry, please tell us _exactly_ what you did; that is, the sequence of Subversion commands, and their output, if any. Cut and paste from the command line window. Then indicate where and when Subversion didn't work as you expected, and why you think it is not working right. By doing that, you very much increase the chances of getting the answer you are looking for. Also, if people agree that there is a problem, you actually contributed a test case for the Subversion test suite! Thanks. -- Michael Diers, elego Software Solutions GmbH, http://www.elego.de -- Estudiante de Ingenieria de Sistemas e Informatica Univesidad Nacional de Colombia Sede Medellin 2011