[prev in list] [next in list] [prev in thread] [next in thread] 

List:       svk-devel
Subject:    [svk-devel] push/pull at wrong level produces empty merge
From:       Marc Mims <marc () questright ! com>
Date:       2007-10-24 13:15:54
Message-ID: 20071024131554.GA13765 () questright ! com
[Download RAW message or body]

I've been attempting to duplicate a problem we experienced in the
DBIx-Class repository.  Pulling onto DBIx-Class/0.09/trunk seemingly
lost the fact that it was copied from DBIx-Class/0.08/trunk and reported
an empty merge.

The hypothesis is that a user pushing from a local copy made at the
"wrong" level causes the problem.

I.e., if Project/B was copied from Project/A, then a user making a local
copy of Project and pushing changes from a checkout of Project will break
branching.  To use local copies and avoid the problem, the user must
make local copies of Project/A and Project/B separately.

I've been trying to simulate the problem with SVK::Test in the attached
program.  It includes a commented block, which when uncommented, results
in a merge conflict and an empty merge.

Is this expected?

There was no conflict report when we experienced the problem in the
DBIx-Class repository, but perhaps that is the root cause.

Some guidance would be appreciated.  I would like to duplicate the
original problem so it can be addressed.

	-Marc

["dbic.t" (text/x-perl)]

#!/usr/bin/perl
use strict;
use warnings;
use SVK::Test;
plan('no_plan');

our $output;

# I'll turn it into a proper test, later; turn the lights on for now
$ENV{DEBUG_INTERACTIVE} = 1;

# create a repository (simulating upstream http://dev.catalyst.perl.org/repos)
my ( $xd_remote, $svk_remote ) = build_test('remote');
my ( $copath_remote, $coapath_remote ) = get_copath('remote');
my ( $repospath_remote, undef, $repos_remote ) = $xd_remote->find_repos('/remote/', 1);
$svk_remote->checkout('/remote/', $copath_remote);

# create tree structure
mkdir "$copath_remote/Project";     # equiv to bast/DBIx-Class
mkdir "$copath_remote/Project/A";   # equiv to bast/DBIx-Class/0.08
overwrite_file("$copath_remote/Project/A/foo", "foobar\n");
$svk_remote->add("$copath_remote/Project");
$svk_remote->commit('-m', 'project branch A', $copath_remote);

# create new branch, equiv to bast/DBIx-Class/0.09
$svk_remote->copy('-m', 'new branch', '/remote/Project/A', '/remote/Project/B');

# add a file in branch A, pull it into B
overwrite_file("$copath_remote/Project/A/bar", "created in A\n");
$svk_remote->add("$copath_remote/Project/A/bar");
$svk_remote->commit('-m', 'bar created in remote, A', $copath_remote);
$svk_remote->update($copath_remote);
$svk_remote->smerge('-It', "$copath_remote/Project/B");
$svk_remote->commit('-m', 'commit after merge', "$copath_remote/Project/B");



# now create a local repository equiv to *my* //mirror
my ( $xd_local, $svk_local ) = build_test();
my ( $copath_mirror, $coapath_mirror ) = get_copath('mirror');
my ( $repospath_local, undef, $repos_local ) = $xd_local->find_repos('//', 1);

$svk_local->mkdir('-m', 'mirrored repos', '//mirror');
$svk_local->mkdir('-m', 'local branches repos', '//local');

# mirror the remote
$svk_local->mirror("file://$repospath_remote/Project", '//mirror/Project');
$svk_local->sync('//mirror/Project');


# make local copy equiv to *my* //local
# as I understand it, this is the key to the trouble; I should be copying
# //mirror/Project/A -> //local/project-a (or some such)
# but copying the entire tree to //local, including both branches is the source of trouble.
my ( $copath_local, $coapath_local ) = get_copath('local');
$svk_local->copy('-m', 'local copy of entire Project', '//mirror/Project', '//local/Project');
$svk_local->checkout('//local', $copath_local);

### pull
$svk_local->pull("$copath_local/Project/A");

# make a change to branch A and push it (one or both of these pushes breaks the repos??)
append_file("$copath_local/Project/A/foo", "modified in local branch A\n");
$svk_local->commit('-m', 'change in local copy, branch A', $copath_local);
$svk_local->push("$copath_local/Project/A");

=for comment

# uncomment this block to generate a merge conflict and empty merge

# make a change to branch B and push it
append_file("$copath_local/Project/B/foo", "modified in local branch B\n");
$svk_local->commit('-m', 'change in local copy, branch B', $copath_local);
###$svk_local->push("$copath_local/Project/B");
$svk_local->push("$copath_local/Project"); # no different than pushing Project/B

=cut

$svk_local->checkout('//mirror/Project/B', "$copath_mirror/Project/B");
$svk_local->pull("$copath_mirror/Project/B");

exit;  # bail out here... I used to have:

$svk_remote->pull("$copath_remote/Project/B");
    # pull won't work here, not copied from a mirror

$svk_remote->smerge('-It', "$copath_remote/Project/B");
    # this works (merge conflict); I expected an error, or an empty merge??


_______________________________________________
svk-devel mailing list
svk-devel@bestpractical.com
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/svk-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic