-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path05svm-lock.t
54 lines (45 loc) · 1.45 KB
/
05svm-lock.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
#!/usr/bin/perl -w
use strict;
use SVK::Test;
use Time::HiRes 'sleep';
plan skip_all => "Doesn't work on win32" if $^O eq 'MSWin32';
plan tests => 3;
our ($output, $answer);
my ($xd, $svk) = build_test('svm-lock');
my ($copath, $corpath) = get_copath ('svm-lock');
$svk->mkdir ('-m', 'remote trunk', '/svm-lock/trunk');
waste_rev ($svk, '/svm-lock/trunk/hate') for (1..10);
my (undef, undef, $repos) = $xd->find_repos ('//remote', 1);
my ($drepospath, $dpath, $drepos) = $xd->find_repos ('/svm-lock/trunk', 1);
my $uri = uri($drepospath);
$svk->mirror ('//remote', $uri.($dpath eq '/' ? '' : $dpath));
$svk->sync ('-a');
waste_rev ($svk, '/svm-lock/trunk/more') for (1..100);
my $pid;
if (($pid =fork) == 0) {
$svk->sync ('-a');
exit;
}
while ($repos->fs->youngest_rev < 23 ) {
sleep 0.2;
}
waste_rev ($svk, '/svm-lock/trunk/more-hate') for (1..20);
is_output_like ($svk, 'sync', ['-a'],
qr"Waiting for lock on /?/remote: .*:$pid.*Retrieving log information from 222 to 261"s);
wait;
waste_rev ($svk, '/svm-lock/trunk/more') for (1..100);
if (($pid =fork) == 0) {
$svk->sync ('-a');
exit;
}
waste_rev ($svk, '/svm-lock/trunk/more-hate') for (1..20);
kill (15, $pid);
wait;
SKIP: {
$svk->pl('-v', '--revprop', '-r', 0, '//');
skip 'no lock found', 2 unless $output =~ m/lock/;
is_output ($svk, 'mirror', ['--unlock', '//remote'],
['mirror locks on //remote removed.']);
is_output_unlike ($svk, 'pl', ['-v', '--revprop', '-r', 0, '//'],
qr'lock');
}