##// END OF EJS Templates
test-mq-merge: quote ^...
Mads Kiilerich -
r11071:2376b4cc stable
parent child Browse files
Show More
@@ -1,79 +1,79 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 # Test issue 529 - mq aborts when merging patch deleting files
3 # Test issue 529 - mq aborts when merging patch deleting files
4
4
5 checkundo()
5 checkundo()
6 {
6 {
7 if [ -f .hg/store/undo ]; then
7 if [ -f .hg/store/undo ]; then
8 echo ".hg/store/undo still exists after $1"
8 echo ".hg/store/undo still exists after $1"
9 fi
9 fi
10 }
10 }
11
11
12 echo "[extensions]" >> $HGRCPATH
12 echo "[extensions]" >> $HGRCPATH
13 echo "mq =" >> $HGRCPATH
13 echo "mq =" >> $HGRCPATH
14 echo "[mq]" >> $HGRCPATH
14 echo "[mq]" >> $HGRCPATH
15 echo "git = keep" >> $HGRCPATH
15 echo "git = keep" >> $HGRCPATH
16
16
17 # Commit two dummy files in "init" changeset
17 # Commit two dummy files in "init" changeset
18 hg init t
18 hg init t
19 cd t
19 cd t
20 echo a > a
20 echo a > a
21 echo b > b
21 echo b > b
22 hg ci -Am init
22 hg ci -Am init
23 hg tag -l init
23 hg tag -l init
24
24
25 # Create a patch removing a
25 # Create a patch removing a
26 hg qnew rm_a
26 hg qnew rm_a
27 hg rm a
27 hg rm a
28 hg qrefresh -m "rm a"
28 hg qrefresh -m "rm a"
29
29
30 # Save the patch queue so we can merge it later
30 # Save the patch queue so we can merge it later
31 hg qsave -c -e 2>&1 | grep -v ^copy
31 hg qsave -c -e 2>&1 | grep -v '^copy'
32 checkundo qsave
32 checkundo qsave
33
33
34 # Update b and commit in an "update" changeset
34 # Update b and commit in an "update" changeset
35 hg up -C init
35 hg up -C init
36 echo b >> b
36 echo b >> b
37 hg st
37 hg st
38 hg ci -m update
38 hg ci -m update
39
39
40 # Here, qpush used to abort with :
40 # Here, qpush used to abort with :
41 # The system cannot find the file specified => a
41 # The system cannot find the file specified => a
42 hg manifest
42 hg manifest
43 hg qpush -a -m 2>&1 | grep -v ^merging
43 hg qpush -a -m 2>&1 | grep -v '^merging'
44 checkundo 'qpush -m'
44 checkundo 'qpush -m'
45 hg manifest
45 hg manifest
46
46
47 # ensure status is correct after merge
47 # ensure status is correct after merge
48 hg qpop -a
48 hg qpop -a
49 cd ..
49 cd ..
50
50
51 # Classic MQ merge sequence *with an explicit named queue*
51 # Classic MQ merge sequence *with an explicit named queue*
52 echo
52 echo
53 echo % init t2
53 echo % init t2
54 hg init t2
54 hg init t2
55 cd t2
55 cd t2
56 echo '[diff]' > .hg/hgrc
56 echo '[diff]' > .hg/hgrc
57 echo 'nodates = 1' >> .hg/hgrc
57 echo 'nodates = 1' >> .hg/hgrc
58 echo a > a
58 echo a > a
59 hg ci -Am init
59 hg ci -Am init
60 echo b > a
60 echo b > a
61 hg ci -m changea
61 hg ci -m changea
62 hg up -C 0
62 hg up -C 0
63 hg cp a aa
63 hg cp a aa
64 echo c >> a
64 echo c >> a
65 hg qnew --git -f -e patcha
65 hg qnew --git -f -e patcha
66 echo d >> a
66 echo d >> a
67 hg qnew -d '0 0' -f -e patcha2
67 hg qnew -d '0 0' -f -e patcha2
68 echo % create the reference queue
68 echo % create the reference queue
69 hg qsave -c -e -n refqueue 2> /dev/null
69 hg qsave -c -e -n refqueue 2> /dev/null
70 hg up -C 1
70 hg up -C 1
71 echo % merge
71 echo % merge
72 HGMERGE=internal:other hg qpush -a -m -n refqueue 2>&1 | \
72 HGMERGE=internal:other hg qpush -a -m -n refqueue 2>&1 | \
73 sed 's/merging with queue at.*refqueue/merging with queue at refqueue/'
73 sed 's/merging with queue at.*refqueue/merging with queue at refqueue/'
74 echo % check patcha is still a git patch
74 echo % check patcha is still a git patch
75 cat .hg/patches/patcha
75 cat .hg/patches/patcha
76 echo % check patcha2 is still a regular patch
76 echo % check patcha2 is still a regular patch
77 grep git .hg/patches/patcha2 && echo 'git patch found!'
77 grep git .hg/patches/patcha2 && echo 'git patch found!'
78 cd ..
78 cd ..
79
79
General Comments 0
You need to be logged in to leave comments. Login now