~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-03-20 18:06:14 UTC
  • mfrom: (3280.4.5 uncommit_local)
  • Revision ID: pqm@pqm.ubuntu.com-20080320180614-grrzhydka050ap3a
(jam) Add --local to bzr uncommit, bug #93412

Show diffs side-by-side

added added

removed removed

Lines of Context:
3657
3657
    _see_also = ['commit']
3658
3658
    takes_options = ['verbose', 'revision',
3659
3659
                    Option('dry-run', help='Don\'t actually make changes.'),
3660
 
                    Option('force', help='Say yes to all questions.')]
 
3660
                    Option('force', help='Say yes to all questions.'),
 
3661
                    Option('local',
 
3662
                           help="Only remove the commits from the local branch"
 
3663
                                " when in a checkout."
 
3664
                           ),
 
3665
                    ]
3661
3666
    takes_args = ['location?']
3662
3667
    aliases = []
3663
3668
    encoding_type = 'replace'
3664
3669
 
3665
3670
    def run(self, location=None,
3666
3671
            dry_run=False, verbose=False,
3667
 
            revision=None, force=False):
 
3672
            revision=None, force=False, local=False):
3668
3673
        if location is None:
3669
3674
            location = u'.'
3670
3675
        control, relpath = bzrdir.BzrDir.open_containing(location)
3680
3685
        else:
3681
3686
            b.lock_write()
3682
3687
        try:
3683
 
            return self._run(b, tree, dry_run, verbose, revision, force)
 
3688
            return self._run(b, tree, dry_run, verbose, revision, force,
 
3689
                             local=local)
3684
3690
        finally:
3685
3691
            if tree is not None:
3686
3692
                tree.unlock()
3687
3693
            else:
3688
3694
                b.unlock()
3689
3695
 
3690
 
    def _run(self, b, tree, dry_run, verbose, revision, force):
 
3696
    def _run(self, b, tree, dry_run, verbose, revision, force, local=False):
3691
3697
        from bzrlib.log import log_formatter, show_log
3692
3698
        from bzrlib.uncommit import uncommit
3693
3699
 
3735
3741
                    return 0
3736
3742
 
3737
3743
        uncommit(b, tree=tree, dry_run=dry_run, verbose=verbose,
3738
 
                 revno=revno)
 
3744
                 revno=revno, local=local)
3739
3745
 
3740
3746
 
3741
3747
class cmd_break_lock(Command):