Show More
@@ -1865,6 +1865,39 b' def series(ui, repo, **opts):' | |||
|
1865 | 1865 | repo.mq.qseries(repo, missing=opts['missing'], summary=opts['summary']) |
|
1866 | 1866 | return 0 |
|
1867 | 1867 | |
|
1868 | def top(ui, repo, **opts): | |
|
1869 | """print the name of the current patch""" | |
|
1870 | q = repo.mq | |
|
1871 | t = q.applied and q.series_end(True) or 0 | |
|
1872 | if t: | |
|
1873 | return q.qseries(repo, start=t-1, length=1, status='A', | |
|
1874 | summary=opts.get('summary')) | |
|
1875 | else: | |
|
1876 | ui.write(_("no patches applied\n")) | |
|
1877 | return 1 | |
|
1878 | ||
|
1879 | def next(ui, repo, **opts): | |
|
1880 | """print the name of the next patch""" | |
|
1881 | q = repo.mq | |
|
1882 | end = q.series_end() | |
|
1883 | if end == len(q.series): | |
|
1884 | ui.write(_("all patches applied\n")) | |
|
1885 | return 1 | |
|
1886 | return q.qseries(repo, start=end, length=1, summary=opts.get('summary')) | |
|
1887 | ||
|
1888 | def prev(ui, repo, **opts): | |
|
1889 | """print the name of the previous patch""" | |
|
1890 | q = repo.mq | |
|
1891 | l = len(q.applied) | |
|
1892 | if l == 1: | |
|
1893 | ui.write(_("only one patch applied\n")) | |
|
1894 | return 1 | |
|
1895 | if not l: | |
|
1896 | ui.write(_("no patches applied\n")) | |
|
1897 | return 1 | |
|
1898 | return q.qseries(repo, start=l-2, length=1, status='A', | |
|
1899 | summary=opts.get('summary')) | |
|
1900 | ||
|
1868 | 1901 | def setupheaderopts(ui, opts): |
|
1869 | 1902 | def do(opt, val): |
|
1870 | 1903 | if not opts[opt] and opts['current' + opt]: |
@@ -2579,6 +2612,8 b' cmdtable = {' | |||
|
2579 | 2612 | ('d', 'date', '', _('add "Date: <given date>" to patch')) |
|
2580 | 2613 | ] + commands.walkopts + commands.commitopts, |
|
2581 | 2614 | _('hg qnew [-e] [-m TEXT] [-l FILE] [-f] PATCH [FILE]...')), |
|
2615 | "qnext": (next, [] + seriesopts, _('hg qnext [-s]')), | |
|
2616 | "qprev": (prev, [] + seriesopts, _('hg qprev [-s]')), | |
|
2582 | 2617 | "^qpop": |
|
2583 | 2618 | (pop, |
|
2584 | 2619 | [('a', 'all', None, _('pop all patches')), |
@@ -2636,6 +2671,7 b' cmdtable = {' | |||
|
2636 | 2671 | ('b', 'backup', None, _('bundle unrelated changesets')), |
|
2637 | 2672 | ('n', 'nobackup', None, _('no backups'))], |
|
2638 | 2673 | _('hg strip [-f] [-b] [-n] REV')), |
|
2674 | "qtop": (top, [] + seriesopts, _('hg qtop [-s]')), | |
|
2639 | 2675 | "qunapplied": |
|
2640 | 2676 | (unapplied, |
|
2641 | 2677 | [('1', 'first', None, _('show only the first patch'))] + seriesopts, |
@@ -152,6 +152,9 b' hg qpush' | |||
|
152 | 152 | echo % qapplied |
|
153 | 153 | hg qapplied |
|
154 | 154 | |
|
155 | echo % qtop | |
|
156 | hg qtop | |
|
157 | ||
|
155 | 158 | echo % prev |
|
156 | 159 | hg qapp -1 |
|
157 | 160 |
@@ -59,6 +59,8 b' hg qguard c.patch' | |||
|
59 | 59 | |
|
60 | 60 | echo % should skip c.patch |
|
61 | 61 | hg qpush -a |
|
62 | echo % should display b.patch | |
|
63 | hg qtop | |
|
62 | 64 | |
|
63 | 65 | hg qguard -n c.patch |
|
64 | 66 | echo % should push c.patch |
@@ -82,6 +84,9 b' hg qselect 2' | |||
|
82 | 84 | echo % should push b.patch |
|
83 | 85 | hg qpush |
|
84 | 86 | hg qpush -a |
|
87 | # Used to be an issue with holes in the patch sequence | |
|
88 | # So, put one hole on the base and ask for topmost patch. | |
|
89 | hg qtop | |
|
85 | 90 | hg qpop -a |
|
86 | 91 | |
|
87 | 92 | hg qselect 1 2 |
@@ -34,6 +34,8 b' c.patch: -a' | |||
|
34 | 34 | applying b.patch |
|
35 | 35 | skipping c.patch - guarded by '-a' |
|
36 | 36 | now at: b.patch |
|
37 | % should display b.patch | |
|
38 | b.patch | |
|
37 | 39 | % should push c.patch |
|
38 | 40 | applying c.patch |
|
39 | 41 | now at: c.patch |
@@ -64,6 +66,7 b' applying b.patch' | |||
|
64 | 66 | now at: b.patch |
|
65 | 67 | applying c.patch |
|
66 | 68 | now at: c.patch |
|
69 | c.patch | |
|
67 | 70 | popping c.patch |
|
68 | 71 | popping b.patch |
|
69 | 72 | patch queue now empty |
@@ -36,7 +36,9 b' list of commands:' | |||
|
36 | 36 | qimport import a patch |
|
37 | 37 | qinit init a new queue repository |
|
38 | 38 | qnew create a new patch |
|
39 | qnext print the name of the next patch | |
|
39 | 40 | qpop pop the current patch off the stack |
|
41 | qprev print the name of the previous patch | |
|
40 | 42 | qpush push the next patch onto the stack |
|
41 | 43 | qrefresh update the current patch |
|
42 | 44 | qrename rename a patch |
@@ -44,6 +46,7 b' list of commands:' | |||
|
44 | 46 | qsave save current queue state |
|
45 | 47 | qselect set or print guarded patches to push |
|
46 | 48 | qseries print the entire series file |
|
49 | qtop print the name of the current patch | |
|
47 | 50 | qunapplied print the patches not yet applied |
|
48 | 51 | strip strip a revision and all its descendants from the repository |
|
49 | 52 | |
@@ -140,6 +143,8 b' now at: test2.patch' | |||
|
140 | 143 | % qapplied |
|
141 | 144 | test.patch |
|
142 | 145 | test2.patch |
|
146 | % qtop | |
|
147 | test2.patch | |
|
143 | 148 | % prev |
|
144 | 149 | test.patch |
|
145 | 150 | % next |
General Comments 0
You need to be logged in to leave comments.
Login now