-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path38stall-schedule.t
66 lines (54 loc) · 1.71 KB
/
38stall-schedule.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
#!/usr/bin/perl -w
use Test::More tests => 9;
use strict;
use File::Path;
use SVK::Test;
our $output;
my ($xd, $svk) = build_test();
my ($copath, $corpath) = get_copath ('stall-schedule');
my ($repospath, undef, $repos) = $xd->find_repos ('//', 1);
$svk->mkdir(-m => 'trunk', '//trunk');
$svk->checkout ('//trunk', $copath);
chdir ($copath);
mkdir ('A');
mkdir ('A/deep');
overwrite_file ("A/foo", "foobar");
overwrite_file ("A/deep/bar", "foobar");
overwrite_file ("A/deep/baz", "foobar");
$svk->add('A');
rmtree ['A/deep'];
$svk->commit(-m => 'commit', 'A');
mkdir ('A/deep');
is_output($svk, 'st', ['A'], [__('? A/deep')],
'commit clears stalled schedule');
$svk->add('A/deep');
$svk->mkdir(-m => 'mkdir', '//trunk/A/deep');
$svk->up('-C');
is($xd->{checkout}->get( SVK::Path::Checkout->copath($corpath, 'A/deep'))->{'.schedule'},
'add', "update -C doesn't unschedule addmerge");
$svk->up;
ok(!$xd->{checkout}->get
(SVK::Path::Checkout->copath($corpath, 'A/deep'))->{'.schedule'},
'up add-merge clears stalled schedule');
$svk->mkdir('A/stall');
unlink('A/stall');
$svk->cp(-m => 'branch', '//trunk@2' => '//branch-A');
is_output($svk, 'switch', ['//branch-A'],
['Syncing //trunk(/trunk) in '.__($corpath).' to 4.',
__('D A/deep')]);
is_output($svk, 'mkdir', ['A/stall'],
[__('A/stall already added.')]);
is_output($svk, 'st', [],
[__('A A/stall')]);
$svk->revert('A/stall');
rmtree['A/stall'];
is_output($svk, 'sm', ['//trunk'],
['Auto-merging (2, 3) /trunk to /branch-A (base /trunk:2).',
__('A A/deep'),
qr'New merge ticket: .*:/trunk:3']);
is_output($svk, 'st', [],
[__('A A/deep'),
' M .']);
is_output($svk, 'revert', ['-R'],
[__('Reverted A/deep'),
'Reverted .']);