Show More
@@ -1134,6 +1134,8 b' class queue(object):' | |||||
1134 | if start == len(self.series): |
|
1134 | if start == len(self.series): | |
1135 | self.ui.warn(_('patch series already fully applied\n')) |
|
1135 | self.ui.warn(_('patch series already fully applied\n')) | |
1136 | return 1 |
|
1136 | return 1 | |
|
1137 | if not force: | |||
|
1138 | self.checklocalchanges(repo, refresh=self.applied) | |||
1137 |
|
1139 | |||
1138 | if exact: |
|
1140 | if exact: | |
1139 | if move: |
|
1141 | if move: | |
@@ -1172,19 +1174,6 b' class queue(object):' | |||||
1172 | end = self.series.index(patch, start) + 1 |
|
1174 | end = self.series.index(patch, start) + 1 | |
1173 |
|
1175 | |||
1174 | s = self.series[start:end] |
|
1176 | s = self.series[start:end] | |
1175 |
|
||||
1176 | if not force: |
|
|||
1177 | mm, aa, rr, dd = repo.status()[:4] |
|
|||
1178 | wcfiles = set(mm + aa + rr + dd) |
|
|||
1179 | if wcfiles: |
|
|||
1180 | for patchname in s: |
|
|||
1181 | pf = os.path.join(self.path, patchname) |
|
|||
1182 | patchfiles = patchmod.changedfiles(self.ui, repo, pf) |
|
|||
1183 | if wcfiles.intersection(patchfiles): |
|
|||
1184 | self.localchangesfound(self.applied) |
|
|||
1185 | elif mergeq: |
|
|||
1186 | self.checklocalchanges(refresh=self.applied) |
|
|||
1187 |
|
||||
1188 | all_files = set() |
|
1177 | all_files = set() | |
1189 | try: |
|
1178 | try: | |
1190 | if mergeq: |
|
1179 | if mergeq: | |
@@ -1265,6 +1254,9 b' class queue(object):' | |||||
1265 | break |
|
1254 | break | |
1266 | update = needupdate |
|
1255 | update = needupdate | |
1267 |
|
1256 | |||
|
1257 | if not force and update: | |||
|
1258 | self.checklocalchanges(repo) | |||
|
1259 | ||||
1268 | self.applieddirty = 1 |
|
1260 | self.applieddirty = 1 | |
1269 | end = len(self.applied) |
|
1261 | end = len(self.applied) | |
1270 | rev = self.applied[start].node |
|
1262 | rev = self.applied[start].node | |
@@ -1287,12 +1279,6 b' class queue(object):' | |||||
1287 | qp = self.qparents(repo, rev) |
|
1279 | qp = self.qparents(repo, rev) | |
1288 | ctx = repo[qp] |
|
1280 | ctx = repo[qp] | |
1289 | m, a, r, d = repo.status(qp, top)[:4] |
|
1281 | m, a, r, d = repo.status(qp, top)[:4] | |
1290 | parentfiles = set(m + a + r + d) |
|
|||
1291 | if not force and parentfiles: |
|
|||
1292 | mm, aa, rr, dd = repo.status()[:4] |
|
|||
1293 | wcfiles = set(mm + aa + rr + dd) |
|
|||
1294 | if wcfiles.intersection(parentfiles): |
|
|||
1295 | self.localchangesfound() |
|
|||
1296 | if d: |
|
1282 | if d: | |
1297 | raise util.Abort(_("deletions found between repo revs")) |
|
1283 | raise util.Abort(_("deletions found between repo revs")) | |
1298 | for f in a: |
|
1284 | for f in a: |
@@ -163,12 +163,8 b' qpush --exact --force with changes to an' | |||||
163 | $ hg update 1 -q |
|
163 | $ hg update 1 -q | |
164 | $ echo c0 >> f0 |
|
164 | $ echo c0 >> f0 | |
165 | $ hg qpush -e |
|
165 | $ hg qpush -e | |
166 | applying p0 |
|
166 | abort: local changes found | |
167 | now at: p0 |
|
167 | [255] | |
168 | $ cat f0 |
|
|||
169 | c0 |
|
|||
170 | $ hg qpop -aq |
|
|||
171 | patch queue now empty |
|
|||
172 | $ hg qpush -ef |
|
168 | $ hg qpush -ef | |
173 | applying p0 |
|
169 | applying p0 | |
174 | now at: p0 |
|
170 | now at: p0 | |
@@ -182,13 +178,8 b' qpush --exact --force with changes to an' | |||||
182 | $ hg update 1 -q |
|
178 | $ hg update 1 -q | |
183 | $ echo c0 >> f0 |
|
179 | $ echo c0 >> f0 | |
184 | $ hg qpush -e p1 |
|
180 | $ hg qpush -e p1 | |
185 | applying p0 |
|
181 | abort: local changes found | |
186 | applying p1 |
|
182 | [255] | |
187 | now at: p1 |
|
|||
188 | $ cat f0 |
|
|||
189 | c0 |
|
|||
190 | $ hg qpop -aq |
|
|||
191 | patch queue now empty |
|
|||
192 | $ hg qpush -e p1 -f |
|
183 | $ hg qpush -e p1 -f | |
193 | applying p0 |
|
184 | applying p0 | |
194 | applying p1 |
|
185 | applying p1 |
@@ -1259,65 +1259,6 b' Issue1033: test applying on an empty fil' | |||||
1259 | now at: changea |
|
1259 | now at: changea | |
1260 | $ cd .. |
|
1260 | $ cd .. | |
1261 |
|
1261 | |||
1262 | test qpop with local changes, issue2780 |
|
|||
1263 |
|
||||
1264 | $ hg init forcepop |
|
|||
1265 | $ cd forcepop |
|
|||
1266 | $ echo 1 > 1 |
|
|||
1267 | $ hg ci -Am 1 |
|
|||
1268 | adding 1 |
|
|||
1269 | $ hg qnew foo |
|
|||
1270 | $ echo 2 > 2 |
|
|||
1271 | $ hg add |
|
|||
1272 | adding 2 |
|
|||
1273 |
|
||||
1274 | unrelated changes |
|
|||
1275 |
|
||||
1276 | $ hg qpop |
|
|||
1277 | popping foo |
|
|||
1278 | patch queue now empty |
|
|||
1279 |
|
||||
1280 | related changes |
|
|||
1281 |
|
||||
1282 | $ hg forget 2 |
|
|||
1283 | $ rm 2 |
|
|||
1284 | $ hg qpush |
|
|||
1285 | applying foo |
|
|||
1286 | patch foo is empty |
|
|||
1287 | now at: foo |
|
|||
1288 | $ echo 2 >> 1 |
|
|||
1289 | $ hg qrefresh |
|
|||
1290 | $ echo 2 >> 1 |
|
|||
1291 | $ hg qpop |
|
|||
1292 | abort: local changes found, refresh first |
|
|||
1293 | [255] |
|
|||
1294 | $ hg st |
|
|||
1295 | M 1 |
|
|||
1296 |
|
||||
1297 | related changes with force |
|
|||
1298 | $ hg qpop --force |
|
|||
1299 | popping foo |
|
|||
1300 | patch queue now empty |
|
|||
1301 | $ hg st |
|
|||
1302 |
|
||||
1303 | related renamed source without change |
|
|||
1304 | $ hg qpush |
|
|||
1305 | applying foo |
|
|||
1306 | now at: foo |
|
|||
1307 | $ echo 1 > 1 |
|
|||
1308 | $ hg mv 1 2 |
|
|||
1309 | $ hg qref --git |
|
|||
1310 | $ hg qpop |
|
|||
1311 | popping foo |
|
|||
1312 | patch queue now empty |
|
|||
1313 | $ echo 3 > 1 |
|
|||
1314 | $ hg st |
|
|||
1315 | M 1 |
|
|||
1316 | $ hg qpush |
|
|||
1317 | abort: local changes found |
|
|||
1318 | [255] |
|
|||
1319 | $ cd .. |
|
|||
1320 |
|
||||
1321 | test qpush with --force, issue1087 |
|
1262 | test qpush with --force, issue1087 | |
1322 |
|
1263 | |||
1323 | $ hg init forcepush |
|
1264 | $ hg init forcepush | |
@@ -1334,9 +1275,16 b' test qpush with --force, issue1087' | |||||
1334 | $ echo world >> hello.txt |
|
1275 | $ echo world >> hello.txt | |
1335 |
|
1276 | |||
1336 |
|
1277 | |||
1337 | apply, should not discard changes with empty patch |
|
1278 | qpush should fail, local changes | |
1338 |
|
1279 | |||
1339 | $ hg qpush |
|
1280 | $ hg qpush | |
|
1281 | abort: local changes found | |||
|
1282 | [255] | |||
|
1283 | ||||
|
1284 | ||||
|
1285 | apply force, should not discard changes with empty patch | |||
|
1286 | ||||
|
1287 | $ hg qpush -f | |||
1340 | applying empty |
|
1288 | applying empty | |
1341 | patch empty is empty |
|
1289 | patch empty is empty | |
1342 | now at: empty |
|
1290 | now at: empty |
General Comments 0
You need to be logged in to leave comments.
Login now