Mercurial > hg > mercurial-crew-with-dirclash
comparison hgext/mq.py @ 2771:519bf0cd28d2
Add -f option to qfold; improve qfold documentation.
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Wed, 02 Aug 2006 15:07:37 -0700 |
parents | 5f8259e4d292 |
children | 4720e79486d3 |
comparison
equal
deleted
inserted
replaced
2770:5f8259e4d292 | 2771:519bf0cd28d2 |
---|---|
1319 return 0 | 1319 return 0 |
1320 | 1320 |
1321 def fold(ui, repo, *files, **opts): | 1321 def fold(ui, repo, *files, **opts): |
1322 """fold the named patches into the current patch | 1322 """fold the named patches into the current patch |
1323 | 1323 |
1324 Patches must not yet be applied. | 1324 Patches must not yet be applied. Each patch will be successively |
1325 applied to the current patch in the order given. If all the | |
1326 patches apply successfully, the current patch will be refreshed | |
1327 with the new cumulative patch, and the folded patches will | |
1328 be deleted. With -f/--force, the folded patch files will | |
1329 be removed afterwards. | |
1330 | |
1325 The header for each folded patch will be concatenated with | 1331 The header for each folded patch will be concatenated with |
1326 the current patch header, separated by a line of '* * *'.""" | 1332 the current patch header, separated by a line of '* * *'.""" |
1327 | 1333 |
1328 q = repo.mq | 1334 q = repo.mq |
1329 | 1335 |
1367 message = ui.edit(message, user or ui.username()) | 1373 message = ui.edit(message, user or ui.username()) |
1368 | 1374 |
1369 q.refresh(repo, msg=message) | 1375 q.refresh(repo, msg=message) |
1370 | 1376 |
1371 for patch in patches: | 1377 for patch in patches: |
1372 q.delete(repo, patch) | 1378 q.delete(repo, patch, force=opts['force']) |
1373 | 1379 |
1374 q.save_dirty() | 1380 q.save_dirty() |
1375 | 1381 |
1376 def header(ui, repo, patch=None): | 1382 def header(ui, repo, patch=None): |
1377 """Print the header of the topmost or specified patch""" | 1383 """Print the header of the topmost or specified patch""" |
1600 [('f', 'force', None, _('delete patch file'))], | 1606 [('f', 'force', None, _('delete patch file'))], |
1601 'hg qdelete [-f] PATCH'), | 1607 'hg qdelete [-f] PATCH'), |
1602 'qfold': | 1608 'qfold': |
1603 (fold, | 1609 (fold, |
1604 [('e', 'edit', None, _('edit patch header')), | 1610 [('e', 'edit', None, _('edit patch header')), |
1611 ('f', 'force', None, _('delete folded patch files')), | |
1605 ('m', 'message', '', _('set patch header to <text>')), | 1612 ('m', 'message', '', _('set patch header to <text>')), |
1606 ('l', 'logfile', '', _('set patch header to contents of <file>'))], | 1613 ('l', 'logfile', '', _('set patch header to contents of <file>'))], |
1607 'hg qfold [-e] [-m <text>] [-l <file] PATCH...'), | 1614 'hg qfold [-e] [-m <text>] [-l <file] PATCH...'), |
1608 'qheader': (header, [], | 1615 'qheader': (header, [], |
1609 _('hg qheader [PATCH]')), | 1616 _('hg qheader [PATCH]')), |