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