hgext/mq.py
branchstable
changeset 11073 ee5b112aa529
parent 10947 ede19417c3c4
child 11078 37d1b20168d1
equal deleted inserted replaced
11072:6bbe4886740e 11073:ee5b112aa529
  2368         except:
  2368         except:
  2369             pass
  2369             pass
  2370     return 0
  2370     return 0
  2371 
  2371 
  2372 def strip(ui, repo, rev, **opts):
  2372 def strip(ui, repo, rev, **opts):
  2373     """strip a revision and all its descendants from the repository
  2373     """strip a changeset and all its descendants from the repository
  2374 
  2374 
  2375     If one of the working directory's parent revisions is stripped, the
  2375     The strip command removes all changesets whose local revision
  2376     working directory will be updated to the parent of the stripped
  2376     number is greater than or equal to REV, and then restores any
  2377     revision.
  2377     changesets that are not descendants of REV. If the working
       
  2378     directory has uncommitted changes, the operation is aborted unless
       
  2379     the --force flag is supplied.
       
  2380 
       
  2381     If a parent of the working directory is stripped, then the working
       
  2382     directory will automatically be updated to the most recent
       
  2383     available ancestor of the stripped parent after the operation
       
  2384     completes.
       
  2385 
       
  2386     Any stripped changesets are stored in ``.hg/strip-backup`` as a
       
  2387     bundle (see ``hg help bundle`` and ``hg help unbundle``). They can
       
  2388     be restored by running ``hg unbundle .hg/strip-backup/BUNDLE``,
       
  2389     where BUNDLE is the bundle file created by the strip. Note that
       
  2390     the local revision numbers will in general be different after the
       
  2391     restore.
       
  2392 
       
  2393     Use the --nobackup option to discard the backup bundle once the
       
  2394     operation completes.
  2378     """
  2395     """
  2379     backup = 'all'
  2396     backup = 'all'
  2380     if opts['backup']:
  2397     if opts['backup']:
  2381         backup = 'strip'
  2398         backup = 'strip'
  2382     elif opts['nobackup']:
  2399     elif opts['nobackup']:
  2798          _('hg qselect [OPTION]... [GUARD]...')),
  2815          _('hg qselect [OPTION]... [GUARD]...')),
  2799     "qseries":
  2816     "qseries":
  2800         (series,
  2817         (series,
  2801          [('m', 'missing', None, _('print patches not in series')),
  2818          [('m', 'missing', None, _('print patches not in series')),
  2802          ] + seriesopts,
  2819          ] + seriesopts,
  2803          _('hg qseries [-ms]')),
  2820           _('hg qseries [-ms]')),
  2804     "^strip":
  2821      "^strip":
  2805         (strip,
  2822          (strip,
  2806          [('f', 'force', None, _('force removal with local changes')),
  2823          [('f', 'force', None, _('force removal of changesets even if the '
  2807           ('b', 'backup', None, _('bundle unrelated changesets')),
  2824                                  'working directory has uncommitted changes')),
  2808           ('n', 'nobackup', None, _('no backups'))],
  2825           ('b', 'backup', None, _('bundle only changesets with local revision'
  2809          _('hg strip [-f] [-b] [-n] REV')),
  2826                                   ' number greater than REV which are not'
  2810     "qtop": (top, [] + seriesopts, _('hg qtop [-s]')),
  2827                                   ' descendants of REV (DEPRECATED)')),
       
  2828            ('n', 'nobackup', None, _('no backups'))],
       
  2829           _('hg strip [-f] [-b] [-n] REV')),
       
  2830      "qtop": (top, [] + seriesopts, _('hg qtop [-s]')),
  2811     "qunapplied":
  2831     "qunapplied":
  2812         (unapplied,
  2832         (unapplied,
  2813          [('1', 'first', None, _('show only the first patch'))] + seriesopts,
  2833          [('1', 'first', None, _('show only the first patch'))] + seriesopts,
  2814          _('hg qunapplied [-1] [-s] [PATCH]')),
  2834          _('hg qunapplied [-1] [-s] [PATCH]')),
  2815     "qfinish":
  2835     "qfinish":