[svk-commit] r2307 - in trunk: lib/SVK/Editor t
nobody at bestpractical.com
nobody at bestpractical.com
Sun Mar 4 16:26:04 EST 2007
Author: clkao
Date: Sun Mar 4 16:26:03 2007
New Revision: 2307
Added:
trunk/t/07smerge-moved.t
Modified:
trunk/MANIFEST
trunk/lib/SVK/Editor/XD.pm
Log:
Fix a bug in merging moved files.
Submitted by: Daniel Jacobowitz <drow at false.org>
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST (original)
+++ trunk/MANIFEST Sun Mar 4 16:26:03 2007
@@ -207,6 +207,7 @@
t/07smerge-incremental.t
t/07smerge-log.t
t/07smerge-mixanchor.t
+t/07smerge-moved.t
t/07smerge-multi.t
t/07smerge-prop.t
t/07smerge-relayed.t
Modified: trunk/lib/SVK/Editor/XD.pm
==============================================================================
--- trunk/lib/SVK/Editor/XD.pm (original)
+++ trunk/lib/SVK/Editor/XD.pm Sun Mar 4 16:26:03 2007
@@ -334,7 +334,7 @@
$editor->{master_editor} = SVK::Editor::Checkout->new(%$self);
if (defined $editor->{target}) {
# XXX: depot_delta can't generate single file fulltext.
- my $handle = $editor->apply_textdelta($editor->{target},
+ my $handle = $editor->apply_textdelta($editor->{target_baton},
$from_root->file_md5_checksum($copyfrom));
if ($handle && $#{$handle} >= 0) {
if ($self->{send_fulltext}) {
Added: trunk/t/07smerge-moved.t
==============================================================================
--- (empty file)
+++ trunk/t/07smerge-moved.t Sun Mar 4 16:26:03 2007
@@ -0,0 +1,33 @@
+#!/usr/bin/perl -w
+use Test::More tests => 1;
+use strict;
+use File::Path;
+use Cwd;
+use SVK::Test;
+
+my ($xd, $svk) = build_test();
+our $output;
+my ($copath, $corpath) = get_copath ('smerge-moved');
+$svk->mkdir ('-m', 'trunk', '//trunk');
+$svk->checkout ('//trunk', $copath);
+my ($repospath, undef, $repos) = $xd->find_repos ('//', 1);
+my $uuid = $repos->fs->get_uuid;
+
+mkdir "$copath/";
+mkdir "$copath/deep";
+overwrite_file ("$copath/foo", "foobar\n");
+$svk->add ("$copath/foo", "$copath/deep");
+$svk->commit ('-m', 'init', "$copath");
+
+$svk->cp ('-m', 'branch', '//trunk', '//local');
+
+$svk->mv ('-m', 'move foo', '//trunk/foo', '//trunk/deep/foo');
+
+($copath, $corpath) = get_copath ('smerge-moved');
+$svk->checkout ('//local', $copath);
+
+is_output ($svk, 'smerge', ['//trunk', $copath],
+ ['Auto-merging (2, 4) /trunk to /local (base /trunk:2).',
+ __("A + $copath/deep/foo"),
+ __("D $copath/foo"),
+ "New merge ticket: $uuid:/trunk:4"]);
More information about the svk-commit
mailing list