~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to zap.py

  • Committer: Aaron Bentley
  • Date: 2011-04-12 04:51:37 UTC
  • Revision ID: aaron@aaronbentley.com-20110412045137-ni3eart33v4wnlst
Allow zap --branch --store if no uncommitted changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    revision as _mod_revision,
24
24
    )
25
25
from bzrlib.branch import Branch
26
 
from bzrlib.errors import NoWorkingTree, NotBranchError
 
26
from bzrlib.errors import BzrCommandError, NoWorkingTree, NotBranchError
27
27
from bzrlib import registry
28
28
from bzrlib.workingtree import WorkingTree
29
29
 
60
60
    def handle_changed(wt, remove_branch):
61
61
        from bzrlib.plugins.pipeline.pipeline import PipeManager
62
62
        if remove_branch:
63
 
            raise AssertionError('Cannot store changes in deleted branch.')
 
63
            raise BzrCommandError('Cannot store changes in deleted branch.')
64
64
        PipeManager.from_checkout(wt).store_uncommitted()
65
65
 
66
66
 
198
198
            checkout = self.make_modified_checkout()
199
199
            branch = self.make_branch('branch')
200
200
            checkout.branch.set_parent(branch.base)
201
 
            e = self.assertRaises(AssertionError, zap, 'checkout',
 
201
            e = self.assertRaises(BzrCommandError, zap, 'checkout',
202
202
                                  policy=StoreChanges, remove_branch=True)
203
203
            self.assertEqual('Cannot store changes in deleted branch.', str(e))
204
204