Show More
@@ -1208,12 +1208,14 b' class queue(object):' | |||
|
1208 | 1208 | if newdate: |
|
1209 | 1209 | newdate = '%d %d' % util.parsedate(newdate) |
|
1210 | 1210 | wlock = repo.wlock() |
|
1211 | ||
|
1211 | 1212 | try: |
|
1212 | 1213 | self.check_toppatch(repo) |
|
1213 | 1214 | (top, patchfn) = (self.applied[-1].rev, self.applied[-1].name) |
|
1214 | 1215 | top = bin(top) |
|
1215 | 1216 | if repo.changelog.heads(top) != [top]: |
|
1216 | 1217 | raise util.Abort(_("cannot refresh a revision with children")) |
|
1218 | ||
|
1217 | 1219 | cparents = repo.changelog.parents(top) |
|
1218 | 1220 | patchparent = self.qparents(repo, top) |
|
1219 | 1221 | ph = patchheader(self.join(patchfn)) |
@@ -1232,27 +1234,20 b' class queue(object):' | |||
|
1232 | 1234 | if comments: |
|
1233 | 1235 | patchf.write(comments) |
|
1234 | 1236 | |
|
1235 | tip = repo.changelog.tip() | |
|
1236 | if top == tip: | |
|
1237 | # if the top of our patch queue is also the tip, there is an | |
|
1238 | # optimization here. We update the dirstate in place and strip | |
|
1239 | # off the tip commit. Then just commit the current directory | |
|
1240 | # tree. We can also send repo.commit the list of files | |
|
1241 | # changed to speed up the diff | |
|
1242 | # | |
|
1243 | # in short mode, we only diff the files included in the | |
|
1244 | # patch already plus specified files | |
|
1237 | # update the dirstate in place, strip off the qtip commit | |
|
1238 | # and then commit. | |
|
1245 | 1239 |
|
|
1246 | 1240 |
|
|
1247 | 1241 |
|
|
1248 | 1242 |
|
|
1249 | 1243 |
|
|
1250 | # | |
|
1251 | mm, aa, dd, aa2 = repo.status(patchparent, tip)[:4] | |
|
1252 | changes = repo.changelog.read(tip) | |
|
1244 | mm, aa, dd, aa2 = repo.status(patchparent, top)[:4] | |
|
1245 | changes = repo.changelog.read(top) | |
|
1253 | 1246 |
|
|
1254 | 1247 |
|
|
1255 | 1248 |
|
|
1249 | # in short mode, we only diff the files included in the | |
|
1250 | # patch already plus specified files | |
|
1256 | 1251 |
|
|
1257 | 1252 |
|
|
1258 | 1253 |
|
@@ -1264,7 +1259,7 b' class queue(object):' | |||
|
1264 | 1259 |
|
|
1265 | 1260 | |
|
1266 | 1261 |
|
|
1267 |
|
|
|
1262 | # qtip and the dirstate parent, but then changed in the | |
|
1268 | 1263 |
|
|
1269 | 1264 |
|
|
1270 | 1265 |
|
@@ -1311,7 +1306,7 b' class queue(object):' | |||
|
1311 | 1306 |
|
|
1312 | 1307 |
|
|
1313 | 1308 |
|
|
1314 |
|
|
|
1309 | # remember the copies between patchparent and qtip | |
|
1315 | 1310 |
|
|
1316 | 1311 |
|
|
1317 | 1312 |
|
@@ -1381,24 +1376,6 b' class queue(object):' | |||
|
1381 | 1376 |
|
|
1382 | 1377 |
|
|
1383 | 1378 |
|
|
1384 | else: | |
|
1385 | self.printdiff(repo, diffopts, patchparent, fp=patchf) | |
|
1386 | patchf.rename() | |
|
1387 | added = repo.status()[1] | |
|
1388 | for a in added: | |
|
1389 | f = repo.wjoin(a) | |
|
1390 | try: | |
|
1391 | os.unlink(f) | |
|
1392 | except OSError, e: | |
|
1393 | if e.errno != errno.ENOENT: | |
|
1394 | raise | |
|
1395 | try: os.removedirs(os.path.dirname(f)) | |
|
1396 | except: pass | |
|
1397 | # forget the file copies in the dirstate | |
|
1398 | # push should readd the files later on | |
|
1399 | repo.dirstate.forget(a) | |
|
1400 | self.pop(repo, force=True) | |
|
1401 | self.push(repo, force=True) | |
|
1402 | 1379 | finally: |
|
1403 | 1380 | wlock.release() |
|
1404 | 1381 | self.removeundo(repo) |
@@ -155,6 +155,31 b' hg qrefresh' | |||
|
155 | 155 | hg qdiff --nodates |
|
156 | 156 | cd .. |
|
157 | 157 | |
|
158 | echo '% issue2025: qrefresh does not honor filtering options when tip != qtip' | |
|
159 | hg init repo-2025 | |
|
160 | cd repo-2025 | |
|
161 | echo a > a | |
|
162 | echo b > b | |
|
163 | hg ci -qAm addab | |
|
164 | echo a >> a | |
|
165 | echo b >> b | |
|
166 | hg qnew -f patch | |
|
167 | hg up -qC 0 | |
|
168 | echo c > c | |
|
169 | hg ci -qAm addc | |
|
170 | hg up -qC 1 | |
|
171 | echo '% refresh with tip != qtip' | |
|
172 | hg --config diff.nodates=1 qrefresh -I b 2>&1 \ | |
|
173 | | sed 's/saving bundle.*/saving bundle.../g' | |
|
174 | echo '% status after refresh' | |
|
175 | hg st | |
|
176 | echo '% b after refresh' | |
|
177 | cat b | |
|
178 | echo '% patch file after refresh' | |
|
179 | cat .hg/patches/patch | |
|
180 | cd .. | |
|
181 | ||
|
182 | ||
|
158 | 183 | echo % issue1441 with git patches |
|
159 | 184 | hg init repo-1441-git |
|
160 | 185 | cd repo-1441-git |
@@ -259,6 +259,26 b' diff -r 000000000000 b' | |||
|
259 | 259 | +++ b/b |
|
260 | 260 | @@ -0,0 +1,1 @@ |
|
261 | 261 | +a |
|
262 | % issue2025: qrefresh does not honor filtering options when tip != qtip | |
|
263 | % refresh with tip != qtip | |
|
264 | saving bundle... | |
|
265 | adding branch | |
|
266 | adding changesets | |
|
267 | adding manifests | |
|
268 | adding file changes | |
|
269 | added 1 changesets with 1 changes to 1 files | |
|
270 | % status after refresh | |
|
271 | M a | |
|
272 | % b after refresh | |
|
273 | b | |
|
274 | b | |
|
275 | % patch file after refresh | |
|
276 | diff -r 1a60229be7ac b | |
|
277 | --- a/b | |
|
278 | +++ b/b | |
|
279 | @@ -1,1 +1,2 @@ | |
|
280 | b | |
|
281 | +b | |
|
262 | 282 | % issue1441 with git patches |
|
263 | 283 | diff --git a/b b/b |
|
264 | 284 | new file mode 100644 |
@@ -392,16 +392,11 b' copy to copy' | |||
|
392 | 392 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
393 | 393 | created new head |
|
394 | 394 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
395 | popping bar | |
|
396 | 395 | adding branch |
|
397 | 396 | adding changesets |
|
398 | 397 | adding manifests |
|
399 | 398 | adding file changes |
|
400 | 399 | added 1 changesets with 1 changes to 1 files |
|
401 | patch queue now empty | |
|
402 | (working directory not at a head) | |
|
403 | applying bar | |
|
404 | now at: bar | |
|
405 | 400 | diff --git a/bar b/bar |
|
406 | 401 | new file mode 100644 |
|
407 | 402 | --- /dev/null |
@@ -427,16 +422,11 b' diff --git a/foo b/baz' | |||
|
427 | 422 | % test file move chains in the slow path |
|
428 | 423 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
429 | 424 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
430 | popping bar | |
|
431 | 425 | adding branch |
|
432 | 426 | adding changesets |
|
433 | 427 | adding manifests |
|
434 | 428 | adding file changes |
|
435 | 429 | added 1 changesets with 1 changes to 1 files |
|
436 | patch queue now empty | |
|
437 | (working directory not at a head) | |
|
438 | applying bar | |
|
439 | now at: bar | |
|
440 | 430 | diff --git a/foo b/bleh |
|
441 | 431 | rename from foo |
|
442 | 432 | rename to bleh |
General Comments 0
You need to be logged in to leave comments.
Login now