1542 return 1 |
1542 return 1 |
1543 if self.issaveline(self.applied[-1]): |
1543 if self.issaveline(self.applied[-1]): |
1544 self.ui.warn(_("status is already saved\n")) |
1544 self.ui.warn(_("status is already saved\n")) |
1545 return 1 |
1545 return 1 |
1546 |
1546 |
1547 ar = [':' + x for x in self.full_series] |
|
1548 if not msg: |
1547 if not msg: |
1549 msg = _("hg patches saved state") |
1548 msg = _("hg patches saved state") |
1550 else: |
1549 else: |
1551 msg = "hg patches: " + msg.rstrip('\r\n') |
1550 msg = "hg patches: " + msg.rstrip('\r\n') |
1552 r = self.qrepo() |
1551 r = self.qrepo() |
1553 if r: |
1552 if r: |
1554 pp = r.dirstate.parents() |
1553 pp = r.dirstate.parents() |
1555 msg += "\nDirstate: %s %s" % (hex(pp[0]), hex(pp[1])) |
1554 msg += "\nDirstate: %s %s" % (hex(pp[0]), hex(pp[1])) |
1556 msg += "\n\nPatch Data:\n" |
1555 msg += "\n\nPatch Data:\n" |
1557 text = msg + "\n".join([str(x) for x in self.applied]) + '\n' + (ar and |
1556 msg += ''.join('%s\n' % x for x in self.applied) |
1558 "\n".join(ar) + '\n' or "") |
1557 msg += ''.join(':%s\n' % x for x in self.full_series) |
1559 n = repo.commit(text, force=True) |
1558 n = repo.commit(msg, force=True) |
1560 if not n: |
1559 if not n: |
1561 self.ui.warn(_("repo commit failed\n")) |
1560 self.ui.warn(_("repo commit failed\n")) |
1562 return 1 |
1561 return 1 |
1563 self.applied.append(statusentry(n,'.hg.patches.save.line')) |
1562 self.applied.append(statusentry(n,'.hg.patches.save.line')) |
1564 self.applied_dirty = 1 |
1563 self.applied_dirty = 1 |