Show More
@@ -306,6 +306,15 b' class queue:' | |||||
306 | message.insert(0, subject) |
|
306 | message.insert(0, subject) | |
307 | return (message, comments, user, date, diffstart > 1) |
|
307 | return (message, comments, user, date, diffstart > 1) | |
308 |
|
308 | |||
|
309 | def removeundo(self, repo): | |||
|
310 | undo = repo.sjoin('undo') | |||
|
311 | if not os.path.exists(undo): | |||
|
312 | return | |||
|
313 | try: | |||
|
314 | os.unlink(undo) | |||
|
315 | except OSError, inst: | |||
|
316 | self.ui.warn('error removing undo: %s\n' % str(inst)) | |||
|
317 | ||||
309 | def printdiff(self, repo, node1, node2=None, files=None, |
|
318 | def printdiff(self, repo, node1, node2=None, files=None, | |
310 | fp=None, changes=None, opts={}): |
|
319 | fp=None, changes=None, opts={}): | |
311 | fns, matchfn, anypats = cmdutil.matchpats(repo, files, opts) |
|
320 | fns, matchfn, anypats = cmdutil.matchpats(repo, files, opts) | |
@@ -349,6 +358,7 b' class queue:' | |||||
349 | patchf.write(comments) |
|
358 | patchf.write(comments) | |
350 | self.printdiff(repo, head, n, fp=patchf) |
|
359 | self.printdiff(repo, head, n, fp=patchf) | |
351 | patchf.close() |
|
360 | patchf.close() | |
|
361 | self.removeundo(repo) | |||
352 | return (0, n) |
|
362 | return (0, n) | |
353 |
|
363 | |||
354 | def qparents(self, repo, rev=None): |
|
364 | def qparents(self, repo, rev=None): | |
@@ -381,6 +391,7 b' class queue:' | |||||
381 | pname = ".hg.patches.merge.marker" |
|
391 | pname = ".hg.patches.merge.marker" | |
382 | n = repo.commit(None, '[mq]: merge marker', user=None, force=1, |
|
392 | n = repo.commit(None, '[mq]: merge marker', user=None, force=1, | |
383 | wlock=wlock) |
|
393 | wlock=wlock) | |
|
394 | self.removeundo(repo) | |||
384 | self.applied.append(statusentry(revlog.hex(n), pname)) |
|
395 | self.applied.append(statusentry(revlog.hex(n), pname)) | |
385 | self.applied_dirty = 1 |
|
396 | self.applied_dirty = 1 | |
386 |
|
397 | |||
@@ -488,6 +499,7 b' class queue:' | |||||
488 | err = 1 |
|
499 | err = 1 | |
489 | break |
|
500 | break | |
490 | tr.close() |
|
501 | tr.close() | |
|
502 | self.removeundo(repo) | |||
491 | return (err, n) |
|
503 | return (err, n) | |
492 |
|
504 | |||
493 | def delete(self, repo, patches, opts): |
|
505 | def delete(self, repo, patches, opts): | |
@@ -586,6 +598,7 b' class queue:' | |||||
586 | if r: r.add([patch]) |
|
598 | if r: r.add([patch]) | |
587 | if commitfiles: |
|
599 | if commitfiles: | |
588 | self.refresh(repo, short=True) |
|
600 | self.refresh(repo, short=True) | |
|
601 | self.removeundo(repo) | |||
589 |
|
602 | |||
590 | def strip(self, repo, rev, update=True, backup="all", wlock=None): |
|
603 | def strip(self, repo, rev, update=True, backup="all", wlock=None): | |
591 | def limitheads(chlog, stop): |
|
604 | def limitheads(chlog, stop): | |
@@ -709,6 +722,7 b' class queue:' | |||||
709 | change = chlog.read(rev) |
|
722 | change = chlog.read(rev) | |
710 | chlog.strip(revnum, revnum) |
|
723 | chlog.strip(revnum, revnum) | |
711 | repo.manifest.strip(repo.manifest.rev(change[0]), revnum) |
|
724 | repo.manifest.strip(repo.manifest.rev(change[0]), revnum) | |
|
725 | self.removeundo(repo) | |||
712 | if saveheads: |
|
726 | if saveheads: | |
713 | self.ui.status("adding branch\n") |
|
727 | self.ui.status("adding branch\n") | |
714 | commands.unbundle(self.ui, repo, "file:%s" % chgrpfile, |
|
728 | commands.unbundle(self.ui, repo, "file:%s" % chgrpfile, | |
@@ -1086,6 +1100,7 b' class queue:' | |||||
1086 | force=1, wlock=wlock) |
|
1100 | force=1, wlock=wlock) | |
1087 | self.applied[-1] = statusentry(revlog.hex(n), patchfn) |
|
1101 | self.applied[-1] = statusentry(revlog.hex(n), patchfn) | |
1088 | self.applied_dirty = 1 |
|
1102 | self.applied_dirty = 1 | |
|
1103 | self.removeundo(repo) | |||
1089 | else: |
|
1104 | else: | |
1090 | self.printdiff(repo, patchparent, fp=patchf) |
|
1105 | self.printdiff(repo, patchparent, fp=patchf) | |
1091 | patchf.close() |
|
1106 | patchf.close() | |
@@ -1268,6 +1283,7 b' class queue:' | |||||
1268 | return 1 |
|
1283 | return 1 | |
1269 | self.applied.append(statusentry(revlog.hex(n),'.hg.patches.save.line')) |
|
1284 | self.applied.append(statusentry(revlog.hex(n),'.hg.patches.save.line')) | |
1270 | self.applied_dirty = 1 |
|
1285 | self.applied_dirty = 1 | |
|
1286 | self.removeundo(undo) | |||
1271 |
|
1287 | |||
1272 | def full_series_end(self): |
|
1288 | def full_series_end(self): | |
1273 | if len(self.applied) > 0: |
|
1289 | if len(self.applied) > 0: |
General Comments 0
You need to be logged in to leave comments.
Login now