Follow upstream changes -- rest
[git-darcs-import.git] / tests / replace.sh
blob1a8380befa534f1395c4328196b3a5429c2bc62c
1 #!/usr/bin/env bash
2 set -ev
4 rm -rf temp
5 mkdir temp
6 cd temp
8 darcs init
10 echo "X X X" > foo
11 darcs rec -alm "Added"
13 # This should fail until replace handles spaces
14 darcs replace ' X ' ' XX ' --token-chars '[ X]' foo && exit 1 || true
16 # Check that replace is not fooled by duplicate file names
17 # (i.e. not trying to performe the replace twice in the same file)
18 darcs replace X Y foo foo
19 darcs replace Y Z foo ../temp/foo
20 darcs replace Z Q foo foo --repodir=../temp/
21 darcs rec -am "xyzq"
24 # Try to "overwrite" a hunk with a replace.
26 # v1.0.8 accepts this without error or warning,
27 # but should perhaps require the --force option?
29 # current unstable sometimes(!) fails with bug: invalid pending
30 # which is surely a bug.
32 # this succeeds
33 echo "x" > foo
34 darcs rec -am xx
35 echo "y" > foo
36 darcs replace --ignore-times x y foo
38 # this fails
39 echo "hej" > foo
40 darcs rec -am hej
41 echo "hopp" > foo
42 darcs replace hej hopp foo
44 darcs whatsnew
46 echo "src" > foo
47 echo "dst" >> foo
48 darcs rec -am hop
49 darcs replace src dst foo || true
50 darcs replace --force src dst foo
52 darcs whatsnew
53 darcs whatsnew -ls
55 cd ..
56 rm -rf temp