/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2010-08-10 20:03:44 UTC
  • mto: This revision was merged to the branch mainline in revision 5376.
  • Revision ID: john@arbash-meinel.com-20100810200344-6muerwvkafqu7w47
Rework things a bit so the logic can be shared.

It turns out that some of the peak memory is actually during the inventory
to string to bundle translations. So re-use the refcount logic there.
This actually does show a decrease in peak memory.
Specifically 'cd bzr.dev; bzr send ../2.2' drops from 221MB peak to 156MB.

We don't speed anything up (16.5s both ways), but peak memory is quite
a bit better.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
        self.assertIs(None, tree.get_shelf_manager().last_shelf())
69
69
 
70
70
    def test_unshelve_keep(self):
71
 
        # https://bugs.edge.launchpad.net/bzr/+bug/492091
 
71
        # https://bugs.launchpad.net/bzr/+bug/492091
72
72
        tree = self.make_branch_and_tree('.')
73
73
        # shelve apparently unhappy working with a tree with no root yet
74
74
        tree.commit('make root')
97
97
        tree.add('file')
98
98
        os.chdir('tree/dir')
99
99
        self.run_bzr('shelve --all ../file')
 
100
 
 
101
 
 
102
class TestShelveUnshelve(TestCaseWithTransport):
 
103
 
 
104
    def test_directory(self):
 
105
        """Test --directory option"""
 
106
        tree = self.make_branch_and_tree('tree')
 
107
        self.build_tree_contents([('tree/a', 'initial\n')])
 
108
        tree.add('a')
 
109
        tree.commit(message='committed')
 
110
        self.build_tree_contents([('tree/a', 'initial\nmore\n')])
 
111
        self.run_bzr('shelve -d tree --all')
 
112
        self.assertFileEqual('initial\n', 'tree/a')
 
113
        self.run_bzr('unshelve --directory tree')
 
114
        self.assertFileEqual('initial\nmore\n', 'tree/a')