-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path02basic.t
106 lines (89 loc) · 3.41 KB
/
02basic.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/perl -w
use strict;
use SVK::Test;
plan tests => 19;
my ($xd, $svk) = build_test();
our $output;
my ($copath, $corpath) = get_copath();
my ($repospath, undef, $repos) = $xd->find_repos ('//', 1);
$svk->checkout ('//', $copath);
mkdir "$copath/A";
overwrite_file ("$copath/A/foo", "foobar");
overwrite_file ("$copath/A/bar", "foobarbazz");
$svk->add ("$copath/A");
overwrite_file ("$copath/A/notused", "foobarbazz");
ok(exists $xd->{checkout}->get
(__"$corpath/A/foo")->{'.schedule'}, 'add recursively');
ok(!exists $xd->{checkout}->get
(__"$corpath/A/notused")->{'.schedule'}, 'add works on specified target only');
$svk->commit ('-m', 'commit message here', "$copath");
unlink ("$copath/A/notused");
$svk->revert ('-R', $copath);
ok(!-e "$copath/A/notused", 'non-targets not committed');
is ($xd->{checkout}->get ("$corpath")->{revision}, 1,
'checkout optimization after commit');
mkdir "$copath/A/new";
mkdir "$copath/A/new/newer";
$svk->add ("$copath/A/new");
$svk->revert ('-R', "$copath/A/new");
ok(!$xd->{checkout}->get (__"$corpath/A/new")->{'.schedule'});
ok($xd->{checkout}->get (__"$corpath/A/foo")->{revision} == 1);
$svk->update ("$copath");
ok($xd->{checkout}->get ("$corpath")->{revision} == 1);
$svk->ps ('someprop', 'propvalue', "$copath/A");
$svk->ps ('moreprop', 'propvalue', "$copath/A");
overwrite_file ("$copath/A/baz", "zzzz");
append_file ("$copath/A/foo", "foobar");
$svk->add ("$copath/A/baz");
$svk->ps ('someprop', 'propvalue', "$copath/A/baz");
$svk->status ("$copath/A");
$svk->pl ('-v', "$copath/A/baz");
$svk->commit ('-m', 'commit message here', "$copath/A");
$svk->rm ("$copath/A/bar");
ok(!-e "$copath/A/bar");
$svk->commit ('-m', 'remove files', "$copath/A");
$svk->revert ("$copath/A/bar");
ok(!-e "$copath/A/bar");
$svk->revert ('-R', "$copath/A");
ok(!-e "$copath/A/bar");
$svk->pl ('-v', "$copath/A/baz");
$svk->status ("$copath/A");
$svk->ps ('neoprop', 'propvalue', "$copath/A/baz");
$svk->pl ("$copath/A/baz");
$svk->pl ("$copath/A");
$svk->commit ('-m', 'commit message here', "$copath/A");
$svk->ps ('-m', 'set propdirectly', 'directprop' ,'propvalue', '//A');
$svk->update ($copath);
ok (eq_hash ($xd->create_path_object
( xd => $xd,
copath_anchor => $corpath,
repos => $repos,
path => '/A',
revision => $repos->fs->youngest_rev)->root->node_proplist('/A') ,
{ directprop => 'propvalue',
someprop => 'propvalue',
moreprop => 'propvalue'}), 'prop matched');
mkdir "$copath/B";
overwrite_file ("$copath/B/foo", "foobar");
$svk->update ('-r', 3, "$copath/A");
$svk->add ("$copath/B");
$svk->commit ('-m', 'blah', "$copath/B");
ok ($xd->{checkout}->get (__"$corpath/A")->{revision} == 3,
'checkout optimzation respects existing state');
$svk->update ($copath);
$svk->mkdir ('-m', 'commit message here', '//A/update-check-only');
is_output($svk, 'update', ['-C', $copath], [
"Syncing //(/) in $corpath to 7.",
__("A $copath/A/update-check-only"), ]);
is_output($svk, 'update', ['-C', '-s', $copath], [
"Syncing //(/) in $corpath to 7.",
__("A $copath/A/update-check-only"), ]);
for (['-m'], ['-s', '-m']) {
is_output($svk, 'update', ['-C', @$_, $copath], [
'--check-only cannot be used in conjunction with --merge.', ]);
}
for (['-s'], ['-m'], ['-s', '-m']) {
is_output($svk, 'update', ['-r', 3, @$_, $copath], [
'--revision cannot be used in conjunction with --sync or --merge.', ]);
}
1;