Mercurial > hg
comparison hgext/mq.py @ 15148:510184e5a09e
mq.strip: allow -r option, optionally
Other commands let -r to be used for revisions, so just for syntactic
consistency, it's nice to have it for strip as well
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Tue, 20 Sep 2011 15:02:00 -0500 |
parents | adad8d68fb1f |
children | 8caf7a757afa |
comparison
equal
deleted
inserted
replaced
15147:395ca8cd2669 | 15148:510184e5a09e |
---|---|
2675 except: | 2675 except: |
2676 pass | 2676 pass |
2677 return 0 | 2677 return 0 |
2678 | 2678 |
2679 @command("strip", | 2679 @command("strip", |
2680 [('f', 'force', None, _('force removal of changesets, discard ' | 2680 [ |
2681 ('r', 'rev', [], _('strip specified revision (optional, ' | |
2682 'can specify revisions without this ' | |
2683 'option)'), _('REV')), | |
2684 ('f', 'force', None, _('force removal of changesets, discard ' | |
2681 'uncommitted changes (no backup)')), | 2685 'uncommitted changes (no backup)')), |
2682 ('b', 'backup', None, _('bundle only changesets with local revision' | 2686 ('b', 'backup', None, _('bundle only changesets with local revision' |
2683 ' number greater than REV which are not' | 2687 ' number greater than REV which are not' |
2684 ' descendants of REV (DEPRECATED)')), | 2688 ' descendants of REV (DEPRECATED)')), |
2685 ('n', 'no-backup', None, _('no backups')), | 2689 ('n', 'no-backup', None, _('no backups')), |
2716 backup = 'strip' | 2720 backup = 'strip' |
2717 elif opts.get('no_backup') or opts.get('nobackup'): | 2721 elif opts.get('no_backup') or opts.get('nobackup'): |
2718 backup = 'none' | 2722 backup = 'none' |
2719 | 2723 |
2720 cl = repo.changelog | 2724 cl = repo.changelog |
2725 revs = list(revs) + opts.get('rev') | |
2721 revs = set(scmutil.revrange(repo, revs)) | 2726 revs = set(scmutil.revrange(repo, revs)) |
2722 if not revs: | 2727 if not revs: |
2723 raise util.Abort(_('empty revision set')) | 2728 raise util.Abort(_('empty revision set')) |
2724 | 2729 |
2725 descendants = set(cl.descendants(*revs)) | 2730 descendants = set(cl.descendants(*revs)) |