Skip Menu |
 

This queue is for tickets about the svk CPAN distribution.

Report information
The Basics
Id: 40763
Status: new
Priority: 0/
Queue: svk

People
Owner: Nobody in particular
Requestors: theultramage [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: v2.0.99_991
Fixed in: (no value)



Subject: messed up merge
A while back I was doing a merge from a dev branch into trunk. This consisted of starting at some common point in history, then applying a sequence of alternating 'svk merge' / 'svk update' steps, hand-weaving them together. Right at the beginning I encountered the following issue. 1. Merge in revision A. This adds some new files. 2. Merge in revision next(A). This modfies the files previously added. 3. Now examine the files. What I found was a merge algorithm gone haywire. Lines were combined together, half of the file was cut off. Extensive damage. I made the following observations: * When merging in the second revision, svk's output says 'G' (merged) instead of 'U' (updated). This indicates that svk sees a difference that shouldn't be there. * A trivial test script I made didn't reproduce the issue. * This appears to be a newline/EOL processing issue (happens on Windows, doesn't happen on FreeBSD). I have constructed a batch file containing commands that will do an automated reproduction of this issue by pulling data from our repo. That's the best I can do so far.
Subject: svk-merge-problem.bat
Download svk-merge-problem.bat
application/x-msdownload 1.1k

Message body not shown because it is not plain text.

From: theultramage [...] gmail.com
Download (untitled) / with headers
text/plain 123b
I have managed to find the right inputs to the merge to reproduce the problem. Attached is a working perl/svk test script.
Download 04merge-newline.t
text/x-perl 2.7k
use Test::More tests => 11; use strict; use SVK::Test; use File::Spec::Functions 'catfile'; our($output, $answer); my ($xd, $svk) = build_test(); # scenario: # 1. make a new repo # 2. make a checkout # 3. make /trunk and /devel, commit (rev 2) # 4. add file to /devel, commit (rev 3) # 5. change the file, commit (rev 4) # 6. merge rev 3 into /trunk checkout # 7. merge rev 4 into /trunk checkout # 8. inspect file # ------------------------------------ # 1. make a new repo is_output($svk, 'mkdir', [-m => "make a repo", '//test'], ["Committed revision 1."]); # 2. make a checkout my ($copath, $corpath) = get_copath ('commit-file'); mkdir($copath); chdir($copath); is_output ($svk, 'checkout', ['//test'], ["Syncing //test(/test) in ".__"$corpath/test to 1."]); chdir('test'); # 3. make /trunk and /devel, commit (rev 2) mkdir("trunk"); mkdir("devel"); is_output($svk, 'add', ['trunk', 'devel'], ['A devel','A trunk']); is_output($svk, 'commit', [-m => "directory layout"], ["Committed revision 2."]); # 4. add file to /devel, commit (rev 3) append_file("devel/file", "AccountDB* account_db_txt(void);\nAccountDB* account_db_sql(void);\n"); is_output($svk, 'add', ["devel/file"], ["A ".catfile('devel','file')]); is_output($svk, 'propset', ['svn:eol-style' => 'native', 'devel/file'], [" M ".catfile('devel','file')]); is_output($svk, 'commit', [-m => "add file"], ["Committed revision 3."]); # 5. change the file, commit (rev 4) overwrite_file("devel/file", "AccountDB* account_db_txt(void);\nAccountDB* account_db_sql(bool case_sensitive);\n"); is_output($svk, 'commit', [-m => "change file"], ["Committed revision 4."]); # 6. merge rev 3 into /trunk checkout is_output($svk, 'merge', ['//test/devel', 'trunk', -c => 3], ["A ".catfile('trunk','file')]); # 7. merge rev 4 into /trunk checkout is_output($svk, 'merge', ['//test/devel', 'trunk', -c => 4], ["U ".catfile('trunk','file')]); # is_output($svk, 'merge', ['//test/devel', 'trunk', -c => 4], ["G ".catfile('trunk','file')]); # 8. inspect file is_file_content('trunk/file', "AccountDB* account_db_txt(void);\nAccountDB* account_db_sql(bool case_sensitive);\n"); # is_file_content('trunk/file', "AccountDB* account_db_txt(void);\nAccountDB* account_db_sql(bool case_sensitived);"); # Switch the statements in step (7) and (8) to test for the incorrect behavior this test case is trying to reproduce. # Notice how the last \n disappeared, and the 'd' in 'void' from before the second merge got left in there. # Also notice that by adding an extra \n into the middle of 'file's contents, one more letter, 'i' appears. # Also notice that commenting out the 'propset' call in step (4) makes the merge behave as intended.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.