Follow upstream changes -- rest
[git-darcs-import.git] / tests / changes_with_move.sh
blob1e64f5003e8b90f1e45bfad8254ffc685c41c769
1 #!/usr/bin/env bash
2 set -ev
4 # Some tests for the output of changes when combined with move.
6 not () { "$@" && exit 1 || :; }
8 rm -rf temp1
10 mkdir temp1
11 cd temp1
12 darcs init
13 date > foo
14 darcs add foo
15 darcs record -m 'add foo' -a
16 mkdir d
17 darcs add d
18 darcs record -m 'add d' -a
19 darcs mv foo d
20 darcs record -m 'mv foo to d' -a
21 darcs mv d directory
22 darcs record -m 'mv d to directory' -a
23 echo 'How beauteous mankind is' > directory/foo
24 darcs record -m 'modify directory/foo' -a
25 darcs changes directory/foo > log
26 grep 'add foo' log
27 grep 'mv foo to d' log
28 echo 'O brave new world' > directory/foo
29 # darcs should also take unrecorded moves into account
30 darcs mv directory/foo directory/bar
31 darcs changes directory/foo > log
32 grep 'mv foo to d' log
33 echo 'That has such people in it' > directory/foo
34 darcs add directory/foo
35 darcs record -m 'mv foo then add new foo' -a
36 darcs annotate directory/bar > log
37 grep 'How beauteous mankind is' log
38 grep 'O brave new world' log
39 cd ..
41 rm -rf temp1