1759 message = ui.edit(message, user or ui.username()) |
1759 message = ui.edit(message, user or ui.username()) |
1760 |
1760 |
1761 q.refresh(repo, msg=message) |
1761 q.refresh(repo, msg=message) |
1762 q.delete(repo, patches, opts) |
1762 q.delete(repo, patches, opts) |
1763 q.save_dirty() |
1763 q.save_dirty() |
|
1764 |
|
1765 def goto(ui, repo, patch, **opts): |
|
1766 '''push or pop patches until named patch is at top of stack''' |
|
1767 q = repo.mq |
|
1768 patch = q.lookup(patch) |
|
1769 if q.isapplied(patch): |
|
1770 ret = q.pop(repo, patch, force=opts['force']) |
|
1771 else: |
|
1772 ret = q.push(repo, patch, force=opts['force']) |
|
1773 q.save_dirty() |
|
1774 return ret |
1764 |
1775 |
1765 def guard(ui, repo, *args, **opts): |
1776 def guard(ui, repo, *args, **opts): |
1766 '''set or print guards for a patch |
1777 '''set or print guards for a patch |
1767 |
1778 |
1768 Guards control whether a patch can be pushed. A patch with no |
1779 Guards control whether a patch can be pushed. A patch with no |
2200 (fold, |
2211 (fold, |
2201 [('e', 'edit', None, _('edit patch header')), |
2212 [('e', 'edit', None, _('edit patch header')), |
2202 ('k', 'keep', None, _('keep folded patch files')) |
2213 ('k', 'keep', None, _('keep folded patch files')) |
2203 ] + commands.commitopts, |
2214 ] + commands.commitopts, |
2204 'hg qfold [-e] [-m <text>] [-l <file] PATCH...'), |
2215 'hg qfold [-e] [-m <text>] [-l <file] PATCH...'), |
|
2216 'qgoto': (goto, [('f', 'force', None, _('overwrite any local changes'))], |
|
2217 'hg qgoto [OPT]... PATCH'), |
2205 'qguard': (guard, [('l', 'list', None, _('list all patches and guards')), |
2218 'qguard': (guard, [('l', 'list', None, _('list all patches and guards')), |
2206 ('n', 'none', None, _('drop all guards'))], |
2219 ('n', 'none', None, _('drop all guards'))], |
2207 'hg qguard [PATCH] [+GUARD]... [-GUARD]...'), |
2220 'hg qguard [PATCH] [+GUARD]... [-GUARD]...'), |
2208 'qheader': (header, [], |
2221 'qheader': (header, [], |
2209 _('hg qheader [PATCH]')), |
2222 _('hg qheader [PATCH]')), |