strip: drop -b/--backup option (BC)
authorMatt Mackall <mpm@selenic.com>
Fri, 11 Jul 2014 18:04:51 -0500
changeset 21854 ba3bc6474bbf
parent 21853 8127b9e798b1
child 21856 d24969ee272f
strip: drop -b/--backup option (BC) This option had very limited utility and counterintuitive behavior and collided unfortunately with the much later -B option. Normally we would no-op such a feature so as to avoid annoying existing scripts. However, we have to weigh that against the silent misbehavior that results when users mistakenly intended to use -B: because -b takes no arg, the bookmark gets interpreted as a normal revision, and gets stripped without removing the associated bookmark, while also not backing up the revision in question. A no-op behavior or warning would only remove the latter half of the misadventure. The only users I can find of this feature were using it in error and have since stopped. The few (if any) remaining users of this feature would be better served by --no-backup.
hgext/strip.py
tests/test-strip.t
--- a/hgext/strip.py	Thu Nov 07 17:24:14 2013 -0800
+++ b/hgext/strip.py	Fri Jul 11 18:04:51 2014 -0500
@@ -78,9 +78,6 @@
                                'option)'), _('REV')),
           ('f', 'force', None, _('force removal of changesets, discard '
                                  'uncommitted changes (no backup)')),
-          ('b', 'backup', None, _('bundle only changesets with local revision'
-                                  ' number greater than REV which are not'
-                                  ' descendants of REV (DEPRECATED)')),
           ('', 'no-backup', None, _('no backups')),
           ('', 'nobackup', None, _('no backups (DEPRECATED)')),
           ('n', '', None, _('ignored  (DEPRECATED)')),
--- a/tests/test-strip.t	Thu Nov 07 17:24:14 2013 -0800
+++ b/tests/test-strip.t	Fri Jul 11 18:04:51 2014 -0500
@@ -524,4 +524,28 @@
   $ hg bookmarks
    * B                         6:ff43616e5d0f
 
-  $ cd ..
+Make sure no one adds back a -b option:
+
+  $ hg strip -b tip
+  hg strip: option -b not recognized
+  hg strip [-k] [-f] [-n] [-B bookmark] [-r] REV...
+  
+  strip changesets and all their descendants from the repository
+  
+  use "hg help -e strip" to show help for the strip extension
+  
+  options:
+  
+   -r --rev REV [+]    strip specified revision (optional, can specify revisions
+                       without this option)
+   -f --force          force removal of changesets, discard uncommitted changes
+                       (no backup)
+      --no-backup      no backups
+   -k --keep           do not modify working copy during strip
+   -B --bookmark VALUE remove revs only reachable from given bookmark
+      --mq             operate on patch repository
+  
+  [+] marked option can be specified multiple times
+  
+  use "hg help strip" to show the full help text
+  [255]