changeset 9365:b8dc3eba4f9d

mq: get rid of qnext, qprev and qtop
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Wed, 19 Aug 2009 12:51:07 +0200
parents c7c2dd7524dd
children 9ff178e7b627 f2acc0c00bec
files hgext/mq.py tests/test-mq tests/test-mq-guards tests/test-mq-guards.out tests/test-mq.out
diffstat 5 files changed, 0 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Wed Aug 19 12:50:46 2009 +0200
+++ b/hgext/mq.py	Wed Aug 19 12:51:07 2009 +0200
@@ -1866,39 +1866,6 @@
     repo.mq.qseries(repo, missing=opts['missing'], summary=opts['summary'])
     return 0
 
-def top(ui, repo, **opts):
-    """print the name of the current patch"""
-    q = repo.mq
-    t = q.applied and q.series_end(True) or 0
-    if t:
-        return q.qseries(repo, start=t-1, length=1, status='A',
-                         summary=opts.get('summary'))
-    else:
-        ui.write(_("no patches applied\n"))
-        return 1
-
-def next(ui, repo, **opts):
-    """print the name of the next patch"""
-    q = repo.mq
-    end = q.series_end()
-    if end == len(q.series):
-        ui.write(_("all patches applied\n"))
-        return 1
-    return q.qseries(repo, start=end, length=1, summary=opts.get('summary'))
-
-def prev(ui, repo, **opts):
-    """print the name of the previous patch"""
-    q = repo.mq
-    l = len(q.applied)
-    if l == 1:
-        ui.write(_("only one patch applied\n"))
-        return 1
-    if not l:
-        ui.write(_("no patches applied\n"))
-        return 1
-    return q.qseries(repo, start=l-2, length=1, status='A',
-                     summary=opts.get('summary'))
-
 def setupheaderopts(ui, opts):
     def do(opt, val):
         if not opts[opt] and opts['current' + opt]:
@@ -2613,8 +2580,6 @@
           ('d', 'date', '', _('add "Date: <given date>" to patch'))
           ] + commands.walkopts + commands.commitopts,
          _('hg qnew [-e] [-m TEXT] [-l FILE] [-f] PATCH [FILE]...')),
-    "qnext": (next, [] + seriesopts, _('hg qnext [-s]')),
-    "qprev": (prev, [] + seriesopts, _('hg qprev [-s]')),
     "^qpop":
         (pop,
          [('a', 'all', None, _('pop all patches')),
@@ -2672,7 +2637,6 @@
           ('b', 'backup', None, _('bundle unrelated changesets')),
           ('n', 'nobackup', None, _('no backups'))],
          _('hg strip [-f] [-b] [-n] REV')),
-    "qtop": (top, [] + seriesopts, _('hg qtop [-s]')),
     "qunapplied":
         (unapplied,
          [('1', 'first', None, _('show only the first patch'))] + seriesopts,
--- a/tests/test-mq	Wed Aug 19 12:50:46 2009 +0200
+++ b/tests/test-mq	Wed Aug 19 12:51:07 2009 +0200
@@ -152,9 +152,6 @@
 echo % qapplied
 hg qapplied
 
-echo % qtop
-hg qtop
-
 echo % prev
 hg qapp -1
 
--- a/tests/test-mq-guards	Wed Aug 19 12:50:46 2009 +0200
+++ b/tests/test-mq-guards	Wed Aug 19 12:51:07 2009 +0200
@@ -59,8 +59,6 @@
 
 echo % should skip c.patch
 hg qpush -a
-echo % should display b.patch
-hg qtop
 
 hg qguard -n c.patch
 echo % should push c.patch
@@ -84,9 +82,6 @@
 echo % should push b.patch
 hg qpush
 hg qpush -a
-# Used to be an issue with holes in the patch sequence
-# So, put one hole on the base and ask for topmost patch.
-hg qtop
 hg qpop -a
 
 hg qselect 1 2
--- a/tests/test-mq-guards.out	Wed Aug 19 12:50:46 2009 +0200
+++ b/tests/test-mq-guards.out	Wed Aug 19 12:51:07 2009 +0200
@@ -34,8 +34,6 @@
 applying b.patch
 skipping c.patch - guarded by '-a'
 now at: b.patch
-% should display b.patch
-b.patch
 % should push c.patch
 applying c.patch
 now at: c.patch
@@ -66,7 +64,6 @@
 now at: b.patch
 applying c.patch
 now at: c.patch
-c.patch
 popping c.patch
 popping b.patch
 patch queue now empty
--- a/tests/test-mq.out	Wed Aug 19 12:50:46 2009 +0200
+++ b/tests/test-mq.out	Wed Aug 19 12:51:07 2009 +0200
@@ -37,9 +37,7 @@
  qimport      import a patch
  qinit        init a new queue repository
  qnew         create a new patch
- qnext        print the name of the next patch
  qpop         pop the current patch off the stack
- qprev        print the name of the previous patch
  qpush        push the next patch onto the stack
  qrefresh     update the current patch
  qrename      rename a patch
@@ -47,7 +45,6 @@
  qsave        save current queue state
  qselect      set or print guarded patches to push
  qseries      print the entire series file
- qtop         print the name of the current patch
  qunapplied   print the patches not yet applied
  strip        strip a revision and all its descendants from the repository
 
@@ -144,8 +141,6 @@
 % qapplied
 test.patch
 test2.patch
-% qtop
-test2.patch
 % prev
 test.patch
 % next