-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path07smerge-anchor.t
65 lines (53 loc) · 2.1 KB
/
07smerge-anchor.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/perl -w
use strict;
use SVK::Test;
plan tests => 5;
our $output;
# build another tree to be mirrored ourself
my ($xd, $svk) = build_test('test');
my $tree = create_basic_tree ($xd, '/test/');
my $pool = SVN::Pool->new_default;
my ($copath, $corpath) = get_copath ('smerge-anchor');
my ($scopath, $scorpath) = get_copath ('smerge-anchor-source');
my ($srepospath, $spath, $srepos) = $xd->find_repos ('/test/', 1);
my $depot = $xd->find_depot('');
my $repos = $depot->repos;
$svk->mirror ('//m', uri($srepospath).($spath eq '/' ? '' : $spath));
$svk->sync ('//m');
$svk->copy ('-m', 'branch', '//m/A', '//l');
$svk->checkout ('/test/', $scopath);
append_file ("$scopath/A/be", "modified on trunk\n");
$svk->commit ('-m', 'commit on trunk', $scopath);
$svk->checkout ('//l', $copath);
append_file ("$copath/Q/qu", "modified on local branch\n");
$svk->commit ('-m', 'commit on local branch', $copath);
$svk->sync ('//m');
$svk->smerge ('-m', 'simple smerge from source', '//m/A', '//l');
my ($suuid, $srev) = ($srepos->fs->get_uuid, $srepos->fs->youngest_rev);
$svk->update ($copath);
is_deeply (($xd->create_path_object
( copath_anchor => $corpath,
xd => $xd,
repos => $repos,
path => '/l',
revision => $repos->fs->youngest_rev,
)->root->node_proplist('/l')),
{'svk:merge' => "$suuid:/A:$srev"},
'simple smerge from source');
append_file ("$scopath/A/be", "more on trunk\n");
$svk->commit ('-m', 'commit on trunk', $scopath);
$svk->sync ('//m');
is_output_like ($svk, 'smerge', ['-m', 'simple smerge from source again', '//m/A', '//l'],
qr|base /m/A:6|);
my ($uuid, $rev) = ($repos->fs->get_uuid, $repos->fs->youngest_rev);
is_output_like ($svk, 'smerge', ['-m', 'simple smerge from local', '//l', '//m/A'],
qr|base /m/A:8|);
is_deeply ((SVK::Path->real_new
({ depot => $depot,
path => '/m/A',
revision => $repos->fs->youngest_rev,
})->root->node_proplist('/m/A')),
{ 'svk:merge' => $uuid.':/l:9'},
'simple smerge back to source');
is_output_like ($svk, 'smerge', ['-m', 'mergedown', '//m/A', '//l'],
qr|Empty merge\.|);