changeset 11073:ee5b112aa529 stable

mq: rewrite strip docstrings This patch is joint work with ilowe.
author Faheem Mitha <faheem@email.unc.edu>
date Sat, 01 May 2010 23:04:49 +0530
parents 6bbe4886740e
children 2e9f735a6179
files hgext/mq.py tests/test-mq.out
diffstat 2 files changed, 33 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Sat May 01 19:24:51 2010 +0200
+++ b/hgext/mq.py	Sat May 01 23:04:49 2010 +0530
@@ -2370,11 +2370,28 @@
     return 0
 
 def strip(ui, repo, rev, **opts):
-    """strip a revision and all its descendants from the repository
+    """strip a changeset and all its descendants from the repository
+
+    The strip command removes all changesets whose local revision
+    number is greater than or equal to REV, and then restores any
+    changesets that are not descendants of REV. If the working
+    directory has uncommitted changes, the operation is aborted unless
+    the --force flag is supplied.
 
-    If one of the working directory's parent revisions is stripped, the
-    working directory will be updated to the parent of the stripped
-    revision.
+    If a parent of the working directory is stripped, then the working
+    directory will automatically be updated to the most recent
+    available ancestor of the stripped parent after the operation
+    completes.
+
+    Any stripped changesets are stored in ``.hg/strip-backup`` as a
+    bundle (see ``hg help bundle`` and ``hg help unbundle``). They can
+    be restored by running ``hg unbundle .hg/strip-backup/BUNDLE``,
+    where BUNDLE is the bundle file created by the strip. Note that
+    the local revision numbers will in general be different after the
+    restore.
+
+    Use the --nobackup option to discard the backup bundle once the
+    operation completes.
     """
     backup = 'all'
     if opts['backup']:
@@ -2800,14 +2817,17 @@
         (series,
          [('m', 'missing', None, _('print patches not in series')),
          ] + seriesopts,
-         _('hg qseries [-ms]')),
-    "^strip":
-        (strip,
-         [('f', 'force', None, _('force removal with local changes')),
-          ('b', 'backup', None, _('bundle unrelated changesets')),
-          ('n', 'nobackup', None, _('no backups'))],
-         _('hg strip [-f] [-b] [-n] REV')),
-    "qtop": (top, [] + seriesopts, _('hg qtop [-s]')),
+          _('hg qseries [-ms]')),
+     "^strip":
+         (strip,
+         [('f', 'force', None, _('force removal of changesets even if the '
+                                 'working directory has uncommitted changes')),
+          ('b', 'backup', None, _('bundle only changesets with local revision'
+                                  ' number greater than REV which are not'
+                                  ' descendants of REV (DEPRECATED)')),
+           ('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.out	Sat May 01 19:24:51 2010 +0200
+++ b/tests/test-mq.out	Sat May 01 23:04:49 2010 +0530
@@ -55,7 +55,7 @@
  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
+ strip        strip a changeset and all its descendants from the repository
 
 use "hg -v help mq" to show aliases and global options
 adding a