1 #!/bin/sh |
|
2 |
|
3 # Test the plumbing of mq.git option |
|
4 # Automatic upgrade itself is tested elsewhere. |
|
5 |
|
6 echo "[extensions]" >> $HGRCPATH |
|
7 echo "mq=" >> $HGRCPATH |
|
8 echo "[diff]" >> $HGRCPATH |
|
9 echo "nodates=1" >> $HGRCPATH |
|
10 |
|
11 hg init repo-auto |
|
12 cd repo-auto |
|
13 echo '% git=auto: regular patch creation' |
|
14 echo a > a |
|
15 hg add a |
|
16 hg qnew -d '0 0' -f adda |
|
17 cat .hg/patches/adda |
|
18 echo '% git=auto: git patch creation with copy' |
|
19 hg cp a b |
|
20 hg qnew -d '0 0' -f copy |
|
21 cat .hg/patches/copy |
|
22 echo '% git=auto: git patch when using --git' |
|
23 echo regular > regular |
|
24 hg add regular |
|
25 hg qnew -d '0 0' --git -f git |
|
26 cat .hg/patches/git |
|
27 echo '% git=auto: regular patch after qrefresh without --git' |
|
28 hg qrefresh -d '0 0' |
|
29 cat .hg/patches/git |
|
30 cd .. |
|
31 |
|
32 hg init repo-keep |
|
33 cd repo-keep |
|
34 echo '[mq]' > .hg/hgrc |
|
35 echo 'git = KEEP' >> .hg/hgrc |
|
36 echo '% git=keep: git patch with --git' |
|
37 echo a > a |
|
38 hg add a |
|
39 hg qnew -d '0 0' -f --git git |
|
40 cat .hg/patches/git |
|
41 echo '% git=keep: git patch after qrefresh without --git' |
|
42 echo a >> a |
|
43 hg qrefresh -d '0 0' |
|
44 cat .hg/patches/git |
|
45 cd .. |
|
46 |
|
47 hg init repo-yes |
|
48 cd repo-yes |
|
49 echo '[mq]' > .hg/hgrc |
|
50 echo 'git = yes' >> .hg/hgrc |
|
51 echo '% git=yes: git patch' |
|
52 echo a > a |
|
53 hg add a |
|
54 hg qnew -d '0 0' -f git |
|
55 cat .hg/patches/git |
|
56 echo '% git=yes: git patch after qrefresh' |
|
57 echo a >> a |
|
58 hg qrefresh -d '0 0' |
|
59 cat .hg/patches/git |
|
60 cd .. |
|
61 |
|
62 hg init repo-no |
|
63 cd repo-no |
|
64 echo '[diff]' > .hg/hgrc |
|
65 echo 'git = True' >> .hg/hgrc |
|
66 echo '[mq]' > .hg/hgrc |
|
67 echo 'git = False' >> .hg/hgrc |
|
68 echo '% git=no: regular patch with copy' |
|
69 echo a > a |
|
70 hg add a |
|
71 hg qnew -d '0 0' -f adda |
|
72 hg cp a b |
|
73 hg qnew -d '0 0' -f regular |
|
74 cat .hg/patches/regular |
|
75 echo '% git=no: regular patch after qrefresh with copy' |
|
76 hg cp a c |
|
77 hg qrefresh -d '0 0' |
|
78 cat .hg/patches/regular |
|
79 cd .. |
|