[svk-commit] r2298 - in trunk: lib/SVK/Editor t
nobody at bestpractical.com
nobody at bestpractical.com
Mon Feb 12 07:26:59 EST 2007
Author: clkao
Date: Mon Feb 12 07:26:57 2007
New Revision: 2298
Added:
trunk/t/07smerge-rename-dest.t
Modified:
trunk/MANIFEST
trunk/lib/SVK/Editor/Merge.pm
Log:
Fix a pool usage in Editor::Merge::apply_textdelta, which has a side-effect
causing rename-tracking smerge on a new file inside a renamed directory to
fail with SWIG-runtime error.
Reported by: Viktor Štujber <theultramage at gmail.com>
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST (original)
+++ trunk/MANIFEST Mon Feb 12 07:26:57 2007
@@ -211,6 +211,7 @@
t/07smerge-prop.t
t/07smerge-relayed.t
t/07smerge-rename.t
+t/07smerge-rename-dest.t
t/07smerge-to-from.t
t/07smerge-tree.t
t/07smerge-upload.t
Modified: trunk/lib/SVK/Editor/Merge.pm
==============================================================================
--- trunk/lib/SVK/Editor/Merge.pm (original)
+++ trunk/lib/SVK/Editor/Merge.pm Mon Feb 12 07:26:57 2007
@@ -404,14 +404,14 @@
}
sub apply_textdelta {
- my ($self, $path, $checksum, $pool) = @_;
+ my ($self, $path, $checksum, $ppool) = @_;
return unless $path;
my $info = $self->{info}{$path};
my ($basepath, $fromrev) = $info->{baseinfo} ? @{$info->{baseinfo}} : ($path);
my $fh = $info->{fh} = {};
- if (($pool = $info->{fpool}) &&
- ($fh->{local} = $self->inspector->localmod($basepath, $checksum || '', $pool))) {
+ my $pool = $info->{fpool};
+ if ($pool && ($fh->{local} = $self->inspector->localmod($basepath, $checksum || '', $pool))) {
# retrieve base
unless ($info->{addmerge}) {
$fh->{base} = [$self->_retrieve_base($path, $pool)];
@@ -426,7 +426,7 @@
$self->ensure_open ($path);
my $handle = $self->{storage}->apply_textdelta ($self->{storage_baton}{$path},
- $checksum, $pool);
+ $checksum, $ppool);
if ($self->{storage_has_unwritable} && !$handle) {
delete $self->{notify}{status}{$path};
Added: trunk/t/07smerge-rename-dest.t
==============================================================================
--- (empty file)
+++ trunk/t/07smerge-rename-dest.t Mon Feb 12 07:26:57 2007
@@ -0,0 +1,44 @@
+#!/usr/bin/perl -w
+use Test::More tests => 2;
+use strict;
+use File::Path;
+use Cwd;
+use SVK::Test;
+
+my ($xd, $svk) = build_test();
+our $output;
+my ($copath, $corpath) = get_copath ('smerge-moved-dest');
+$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/A";
+mkdir "$copath/A/deep";
+overwrite_file("$copath/A/foo", "foobar\n");
+overwrite_file("$copath/A/deep/foo", "foobar\n");
+
+$svk->add("$copath/A");
+$svk->commit ('-m', 'init', "$copath");
+$svk->cp('-m', 'branch', '//trunk', '//local');
+
+overwrite_file("$copath/A/foo", "foobar changed\n");
+overwrite_file("$copath/A/deep/bar", "foobar\n");
+
+$svk->add("$copath/A/deep/bar");
+$svk->ci(-m => 'change on trunk', $copath);
+$svk->mv('-m', 'move foo', '//local/A', '//local/A-away');
+is_output($svk, 'sm', [-m => 'merge', '//trunk', '//local'],
+ ['Auto-merging (2, 4) /trunk to /local (base /trunk:2).',
+ ' A - skipped',
+ ' A/foo - skipped',
+ 'Empty merge.']);
+
+is_output($svk, 'sm', ['--track-rename', -m => 'merge', '//trunk', '//local'],
+ ['Auto-merging (2, 4) /trunk to /local (base /trunk:2).',
+ 'Collecting renames, this might take a while.',
+ 'U A/foo - A-away/foo',
+ 'A A/deep/bar - A-away/deep/bar',
+ qr'New merge ticket: .*:/trunk:4',
+ 'Committed revision 6.']);
+
More information about the svk-commit
mailing list