comparison tests/test-copy2 @ 4744:44e17f5029d0

Make hg add foo; hg mv foo bar work. - foo will be removed (the user has a copy of its contents in bar) - bar will not be marked as a copy (there was no committed version of foo). We print a warning telling that to the user. Fixes issue269.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Tue, 03 Jul 2007 03:06:40 -0300
parents 719c402258ee
children 6c82beaaa11a
comparison
equal deleted inserted replaced
4743:719c402258ee 4744:44e17f5029d0
1 #!/bin/sh 1 #!/bin/sh
2 2
3 hg init 3 hg init
4 echo foo > foo 4 echo foo > foo
5 echo "# should fail - foo is not managed"
6 hg mv foo bar
7 hg st -A
5 hg add foo 8 hg add foo
9 echo "# dry-run; print a warning that this is not a real copy; foo is added"
10 hg mv --dry-run foo bar
11 hg st -A
12 echo "# should print a warning that this is not a real copy; bar is added"
13 hg mv foo bar
14 hg st -A
15 echo "# should print a warning that this is not a real copy; foo is added"
16 hg cp bar foo
17 hg rm -f bar
18 rm bar
19 hg st -A
6 hg commit -m1 -d"0 0" 20 hg commit -m1 -d"0 0"
7 21
22 echo "# dry-run; should show that foo is clean"
23 hg copy --dry-run foo bar
24 hg st -A
8 echo "# should show copy" 25 echo "# should show copy"
9 hg copy foo bar 26 hg copy foo bar
10 hg st -C 27 hg st -C
11 28
12 echo "# shouldn't show copy" 29 echo "# shouldn't show copy"