update readmes
[git-darcs-import.git] / tests / unpull.pl
blob39dbf72c7671d1e8dfdc6a8abf5fac424957ad89
1 #!/usr/bin/env perl
3 # Some tests for 'darcs unpull'
5 use lib 'lib/perl';
6 use Test::More 'no_plan';
7 use Test::Darcs;
8 use Shell::Command;
9 use strict;
10 use Carp 'verbose';
12 init_tmp_repo();
14 touch 'a.txt';
15 darcs "add a.txt";
16 darcs "record -a -m 'adding a' a.txt";
18 touch 'b.txt';
19 darcs "add b.txt";
20 darcs "record -a -m 'adding b' b.txt";
22 like(
23 echo_to_darcs("unpull -p add","an"),
24 qr/really unpull/i,
25 "additional confirmation is given when 'all' option is selected");
27 like(
28 echo_to_darcs("unpull --last 1","n"),
29 qr/adding b/,
30 "unpull --last 1 gives expected result");
33 # Add a patch that depends on 'adding a' and try to unpull 'adding a'
35 `date >> a.txt`;
36 darcs "record -a -m 'modifying a' a.txt";
38 like(
39 echo_to_darcs("unpull -p 'adding a'","n"),
40 qr/modifying a/ && qr/No patches selected/,
41 "unpull asks about depending patches");