Show More
@@ -0,0 +1,27 | |||||
|
1 | #!/bin/sh | |||
|
2 | ||||
|
3 | echo "[extensions]" >> $HGRCPATH | |||
|
4 | echo "mq=" >> $HGRCPATH | |||
|
5 | ||||
|
6 | hg init a | |||
|
7 | cd a | |||
|
8 | echo a > a | |||
|
9 | hg ci -Ama | |||
|
10 | ||||
|
11 | hg qnew a.patch | |||
|
12 | echo a >> a | |||
|
13 | hg qrefresh | |||
|
14 | ||||
|
15 | hg qnew b.patch | |||
|
16 | echo b > b | |||
|
17 | hg add b | |||
|
18 | hg qrefresh | |||
|
19 | ||||
|
20 | hg qnew c.patch | |||
|
21 | echo c > c | |||
|
22 | hg add c | |||
|
23 | hg qrefresh | |||
|
24 | ||||
|
25 | hg qgoto a.patch | |||
|
26 | hg qgoto c.patch | |||
|
27 | hg qgoto b.patch |
@@ -0,0 +1,6 | |||||
|
1 | adding a | |||
|
2 | Now at: a.patch | |||
|
3 | applying b.patch | |||
|
4 | applying c.patch | |||
|
5 | Now at: c.patch | |||
|
6 | Now at: b.patch |
@@ -1762,6 +1762,17 def fold(ui, repo, *files, **opts): | |||||
1762 | q.delete(repo, patches, opts) |
|
1762 | q.delete(repo, patches, opts) | |
1763 | q.save_dirty() |
|
1763 | q.save_dirty() | |
1764 |
|
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 | |||
|
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 | |||
@@ -2202,6 +2213,8 cmdtable = { | |||||
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]...'), |
@@ -30,6 +30,7 list of commands: | |||||
30 | qdelete remove patches from queue |
|
30 | qdelete remove patches from queue | |
31 | qdiff diff of the current patch |
|
31 | qdiff diff of the current patch | |
32 | qfold fold the named patches into the current patch |
|
32 | qfold fold the named patches into the current patch | |
|
33 | qgoto push or pop patches until named patch is at top of stack | |||
33 | qguard set or print guards for a patch |
|
34 | qguard set or print guards for a patch | |
34 | qheader Print the header of the topmost or specified patch |
|
35 | qheader Print the header of the topmost or specified patch | |
35 | qimport import a patch |
|
36 | qimport import a patch |
General Comments 0
You need to be logged in to leave comments.
Login now