Show More
@@ -1470,20 +1470,21 b' def fold(ui, repo, *files, **opts):' | |||||
1470 | patches = [] |
|
1470 | patches = [] | |
1471 | messages = [] |
|
1471 | messages = [] | |
1472 | for f in files: |
|
1472 | for f in files: | |
1473 |
p |
|
1473 | p = q.lookup(f) | |
1474 |
if p |
|
1474 | if p in patches or p == parent: | |
1475 |
ui.warn(_('Skipping already folded patch %s') % p |
|
1475 | ui.warn(_('Skipping already folded patch %s') % p) | |
1476 |
if q.isapplied(p |
|
1476 | if q.isapplied(p): | |
1477 |
raise util.Abort(_('qfold cannot fold already applied patch %s') % p |
|
1477 | raise util.Abort(_('qfold cannot fold already applied patch %s') % p) | |
1478 |
patches.append(p |
|
1478 | patches.append(p) | |
1479 |
|
1479 | |||
1480 |
for p |
|
1480 | for p in patches: | |
1481 | if not message: |
|
1481 | if not message: | |
1482 |
messages.append(q.readheaders(p |
|
1482 | messages.append(q.readheaders(p)[0]) | |
1483 |
pf = q.join(p |
|
1483 | pf = q.join(p) | |
1484 | (patchsuccess, files, fuzz) = q.patch(repo, pf) |
|
1484 | (patchsuccess, files, fuzz) = q.patch(repo, pf) | |
1485 | if not patchsuccess: |
|
1485 | if not patchsuccess: | |
1486 |
raise util.Abort(_('Error folding patch %s') % p |
|
1486 | raise util.Abort(_('Error folding patch %s') % p) | |
|
1487 | patch.updatedir(ui, repo, files) | |||
1487 |
|
1488 | |||
1488 | if not message: |
|
1489 | if not message: | |
1489 | message, comments, user = q.readheaders(parent)[0:3] |
|
1490 | message, comments, user = q.readheaders(parent)[0:3] | |
@@ -1496,10 +1497,7 b' def fold(ui, repo, *files, **opts):' | |||||
1496 | message = ui.edit(message, user or ui.username()) |
|
1497 | message = ui.edit(message, user or ui.username()) | |
1497 |
|
1498 | |||
1498 | q.refresh(repo, msg=message) |
|
1499 | q.refresh(repo, msg=message) | |
1499 |
|
1500 | q.delete(repo, patches, keep=opts['keep']) | ||
1500 | for patch in patches: |
|
|||
1501 | q.delete(repo, patch, keep=opts['keep']) |
|
|||
1502 |
|
||||
1503 | q.save_dirty() |
|
1501 | q.save_dirty() | |
1504 |
|
1502 | |||
1505 | def guard(ui, repo, *args, **opts): |
|
1503 | def guard(ui, repo, *args, **opts): |
General Comments 0
You need to be logged in to leave comments.
Login now