Rename qpush --move to --grab

Gilles Moris gilles.moris at free.fr
Tue Jun 22 16:19:32 CDT 2010


I am not very well placed to bikeshed about wording, but 1.6 will be coming
very soon and this is the time for me to speak before it's to late.

At one point of time, Martin proposed 'hg qpush --grab' for this option that
takes an unapplied patch and push it, instead of pushing the next patch.
I hope Mads will not mind that I am promoting 'grab' instead of the original
'hg qpush --move', but I find 'grab' more explicit than 'move' which is kind
of generic. I am not opposed to other suggestions if someone has a better idea.

Regards.
Gilles.

# HG changeset patch
# User Gilles Moris <gilles.moris at free.fr>
# Date 1277103948 -7200
# Node ID ab98e78a434202e29b34313c100352b6c445c792
# Parent  7b6c56f0b00b11e2a688a3b675be4d815b03fef3
mq: rename qpush --move to qpush --grab

diff -r 7b6c56f0b00b -r ab98e78a4342 hgext/mq.py
--- a/hgext/mq.py       Tue Jun 22 21:36:09 2010 +0200
+++ b/hgext/mq.py       Mon Jun 21 09:05:48 2010 +0200
@@ -988,7 +988,7 @@
         raise util.Abort(_("patch %s not in series") % patch)

     def push(self, repo, patch=None, force=False, list=False,
-             mergeq=None, all=False, move=False):
+             mergeq=None, all=False, grab=False):
         diffopts = self.diffopts()
         wlock = repo.wlock()
         try:
@@ -1044,7 +1044,7 @@
             if not force:
                 self.check_localchanges(repo)

-            if move:
+            if grab:
                 try:
                     index = self.series.index(patch, start)
                     fullpatch = self.full_series[index]
@@ -2243,7 +2243,7 @@
         mergeq = queue(ui, repo.join(""), newpath)
         ui.warn(_("merging with queue at: %s\n") % mergeq.path)
     ret = q.push(repo, patch, force=opts['force'], list=opts['list'],
-                 mergeq=mergeq, all=opts.get('all'), move=opts.get('move'))
+                 mergeq=mergeq, all=opts.get('all'), grab=opts.get('grab'))
     return ret

 def pop(ui, repo, patch=None, **opts):
@@ -2916,8 +2916,8 @@
           ('m', 'merge', None, _('merge from another queue (DEPRECATED)')),
           ('n', 'name', '',
            _('merge queue name (DEPRECATED)'), _('NAME')),
-          ('', 'move', None, _('reorder patch series and apply only the patch'))],
-         _('hg qpush [-f] [-l] [-a] [-m] [-n NAME] [--move] [PATCH | INDEX]')),
+          ('', 'grab', None, _('reorder patch series and apply only the patch'))],
+         _('hg qpush [-f] [-l] [-a] [-m] [-n NAME] [--grab] [PATCH | INDEX]')),
     "^qrefresh":
         (refresh,
          [('e', 'edit', None, _('edit commit message')),
diff -r 7b6c56f0b00b -r ab98e78a4342 tests/test-mq
--- a/tests/test-mq     Tue Jun 22 21:36:09 2010 +0200
+++ b/tests/test-mq     Mon Jun 21 09:05:48 2010 +0200
@@ -223,17 +223,17 @@
 hg qpop test2.patch-2
 hg qpush test1b.patch+1

-echo % qpush --move
+echo % qpush --grab
 hg qpop -a
-hg qpush --move test2.patch # move to front
-hg qpush --move test1b.patch
-hg qpush --move test.patch # noop move
+hg qpush --grab test2.patch # move to front
+hg qpush --grab test1b.patch
+hg qpush --grab test.patch # noop move
 hg qseries -v
 hg qpop -a
-hg qpush --move test.patch # cleaning up
-hg qpush --move test1b.patch
-hg qpush --move bogus # nonexistent patch
-hg qpush --move test.patch # already applied
+hg qpush --grab test.patch # cleaning up
+hg qpush --grab test1b.patch
+hg qpush --grab bogus # nonexistent patch
+hg qpush --grab test.patch # already applied
 hg qpush

 echo % pop, qapplied, qunapplied
diff -r 7b6c56f0b00b -r ab98e78a4342 tests/test-mq.out
--- a/tests/test-mq.out Tue Jun 22 21:36:09 2010 +0200
+++ b/tests/test-mq.out Mon Jun 21 09:05:48 2010 +0200
@@ -199,7 +199,7 @@
 applying test1b.patch
 applying test2.patch
 now at: test2.patch
-% qpush --move
+% qpush --grab
 popping test2.patch
 popping test1b.patch
 popping test.patch


More information about the Mercurial-devel mailing list