~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_switch.py

  • Committer: Aaron Bentley
  • Date: 2012-07-18 18:37:20 UTC
  • mto: This revision was merged to the branch mainline in revision 6540.
  • Revision ID: aaron@aaronbentley.com-20120718183720-zwd97wi6hn9lolts
Switch command stores/restores uncommitted changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
492
492
        self.assertLength(24, self.hpss_calls)
493
493
        self.assertLength(4, self.hpss_connections)
494
494
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
 
495
 
 
496
 
 
497
class TestSwitchUncommitted(TestCaseWithTransport):
 
498
 
 
499
    def test_switch_stores_local(self):
 
500
        tree = self.make_branch_and_tree('orig')
 
501
        tree.commit('')
 
502
        tree.branch.bzrdir.sprout('new')
 
503
        checkout = tree.branch.create_checkout('checkout', lightweight=True)
 
504
        self.build_tree(['checkout/a'])
 
505
        self.assertPathExists('checkout/a')
 
506
        checkout.add('a')
 
507
        self.run_bzr(['switch', '-d', 'checkout', 'new'])
 
508
        self.assertPathDoesNotExist('checkout/a')
 
509
        self.run_bzr(['switch', '-d', 'checkout', 'orig'])
 
510
        self.assertPathExists('checkout/a')