-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path23commit-local-file-to-add.t
53 lines (46 loc) · 1.07 KB
/
23commit-local-file-to-add.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
use Test::More tests => 4;
use strict;
use SVK::Test;
our($output, $answer);
my ($xd, $svk) = build_test();
$svk->mkdir ('-m', 'init', '//V');
my $tree = create_basic_tree ($xd, '//V');
my ($copath, $corpath) = get_copath ('commit-local-file-to-add');
mkdir($copath);
chdir($copath);
is_output ($svk, 'checkout', ['//V/A'],
["Syncing //V/A(/V/A) in ".__"$corpath/A to 3.",
__('A A/Q'),
__('A A/Q/qu'),
__('A A/Q/qz'),
__('A A/be')]);
ok (-e 'A/Q/qu');
overwrite_file("A/boo", "new file\n");
append_file("A/Q/qu", "to have commit work\n");
append_file("A/Q/qz", "to have commit work\n");
chdir('A');
is_output($svk, 'status', [],
[__('M Q/qu'),
__('M Q/qz'),
__('? boo')]);
sub set_editor_add
{
set_editor(<< 'TMP');
$_ = shift;
open _ or die $!;
@_ = <_>;
# simulate some editing, for --template test
s/^\?/A/g for @_;
close _;
unlink $_;
open _, '>', $_ or die $!;
print _ @_;
close _;
print @_;
TMP
}
set_editor_add();
is_output($svk, 'commit',[],
['Waiting for editor...',
'A boo',
'Committed revision 4.']);