Debian Codegraph @

tests/test-mq-safety.t

raw
1 $ echo '[extensions]' >> $HGRCPATH
2 $ echo 'hgext.mq =' >> $HGRCPATH
3
4 $ hg init repo
5 $ cd repo
6
7 $ echo foo > foo
8 $ hg ci -qAm 'add a file'
9
10 $ hg qinit
11
12 $ hg qnew foo
13 $ echo foo >> foo
14 $ hg qrefresh -m 'append foo'
15
16 $ hg qnew bar
17 $ echo bar >> foo
18 $ hg qrefresh -m 'append bar'
19
20 Try to operate on public mq changeset
21
22 $ hg qpop
23 popping bar
24 now at: foo
25 $ hg phase --public qbase
26 $ echo babar >> foo
27 $ hg qref
28 abort: cannot qrefresh public revision
29 (see 'hg help phases' for details)
30 [255]
31 $ hg revert -a
32 reverting foo
33 $ hg qpop
34 abort: popping would remove a public revision
35 (see 'hg help phases' for details)
36 [255]
37 $ hg qfold bar
38 abort: cannot qrefresh public revision
39 (see 'hg help phases' for details)
40 [255]
41 $ hg revert -a
42 reverting foo
43
44 restore state for remaining test
45
46 $ hg qpush
47 applying bar
48 now at: bar
49
50 try to commit on top of a patch
51
52 $ echo quux >> foo
53 $ hg ci -m 'append quux'
54 abort: cannot commit over an applied mq patch
55 [255]
56
57
58 cheat a bit...
59
60 $ mv .hg/patches .hg/patches2
61 $ hg ci -m 'append quux'
62 $ mv .hg/patches2 .hg/patches
63
64
65 qpop/qrefresh on the wrong revision
66
67 $ hg qpop
68 abort: popping would remove a revision not managed by this patch queue
69 [255]
70 $ hg qpop -n patches
71 using patch queue: $TESTTMP/repo/.hg/patches
72 abort: popping would remove a revision not managed by this patch queue
73 [255]
74 $ hg qrefresh
75 abort: working directory revision is not qtip
76 [255]
77
78 $ hg up -C qtip
79 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 $ hg qpop
81 abort: popping would remove a revision not managed by this patch queue
82 [255]
83 $ hg qrefresh
84 abort: cannot qrefresh a revision with children
85 [255]
86 $ hg tip --template '{rev} {desc}\n'
87 3 append quux
88
89
90 qpush warning branchheads
91
92 $ cd ..
93 $ hg init branchy
94 $ cd branchy
95 $ echo q > q
96 $ hg add q
97 $ hg qnew -f qp
98 $ hg qpop
99 popping qp
100 patch queue now empty
101 $ echo a > a
102 $ hg ci -Ama
103 adding a
104 $ hg up null
105 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
106 $ hg branch b
107 marked working directory as branch b
108 (branches are permanent and global, did you want a bookmark?)
109 $ echo c > c
110 $ hg ci -Amc
111 adding c
112 $ hg merge default
113 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
114 (branch merge, don't forget to commit)
115 $ hg ci -mmerge
116 $ hg up default
117 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
118 $ hg log
119 changeset: 2:65309210bf4e
120 branch: b
121 tag: tip
122 parent: 1:707adb4c8ae1
123 parent: 0:cb9a9f314b8b
124 user: test
125 date: Thu Jan 01 00:00:00 1970 +0000
126 summary: merge
127
128 changeset: 1:707adb4c8ae1
129 branch: b
130 parent: -1:000000000000
131 user: test
132 date: Thu Jan 01 00:00:00 1970 +0000
133 summary: c
134
135 changeset: 0:cb9a9f314b8b
136 user: test
137 date: Thu Jan 01 00:00:00 1970 +0000
138 summary: a
139
140 $ hg qpush
141 applying qp
142 now at: qp
143
144 Testing applied patches, push and --force
145
146 $ cd ..
147 $ hg init forcepush
148 $ cd forcepush
149 $ echo a > a
150 $ hg ci -Am adda
151 adding a
152 $ echo a >> a
153 $ hg ci -m changea
154 $ hg up 0
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 $ hg branch branch
157 marked working directory as branch branch
158 (branches are permanent and global, did you want a bookmark?)
159 $ echo b > b
160 $ hg ci -Am addb
161 adding b
162 $ hg up 0
163 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
164 $ hg --cwd .. clone -r 0 forcepush forcepush2
165 adding changesets
166 adding manifests
167 adding file changes
168 added 1 changesets with 1 changes to 1 files
169 new changesets 07f494440405
170 updating to branch default
171 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
172 $ echo a >> a
173 $ hg qnew patch
174
175 Pushing applied patch with --rev without --force
176
177 $ hg push -r . ../forcepush2
178 pushing to ../forcepush2
179 abort: source has mq patches applied
180 [255]
181
182 Pushing applied patch with branchhash, without --force
183
184 $ hg push ../forcepush2#default
185 pushing to ../forcepush2
186 abort: source has mq patches applied
187 [255]
188
189 Pushing revs excluding applied patch
190
191 $ hg push --new-branch -r 'branch(branch)' -r 2 ../forcepush2
192 pushing to ../forcepush2
193 searching for changes
194 adding changesets
195 adding manifests
196 adding file changes
197 added 1 changesets with 1 changes to 1 files
198
199 Pushing applied patch with --force
200
201 $ hg phase --force --secret 'mq()'
202 $ hg push --force -r default ../forcepush2
203 pushing to ../forcepush2
204 searching for changes
205 no changes found (ignored 1 secret changesets)
206 [1]
207 $ hg phase --draft 'mq()'
208 $ hg push --force -r default ../forcepush2
209 pushing to ../forcepush2
210 searching for changes
211 adding changesets
212 adding manifests
213 adding file changes
214 added 1 changesets with 1 changes to 1 files (+1 heads)
215
216 $ cd ..