~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-08-11 03:39:25 UTC
  • mfrom: (3613.2.2 export)
  • Revision ID: pqm@pqm.ubuntu.com-20080811033925-rwcu69eiq0zg0buv
(robertc) Teach export to export subdirectories as well as entire
        branches. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
        self.assertEqual(['a'], files)
175
175
 
176
176
    def example_branch(self):
 
177
        """Create a branch a 'branch' containing hello and goodbye."""
177
178
        tree = self.make_branch_and_tree('branch')
178
179
        self.build_tree_contents([('branch/hello', 'foo')])
179
180
        tree.add('hello')
277
278
        self.run_bzr('export first -r 1 branch')
278
279
        self.assertEqual(['hello'], sorted(os.listdir('first')))
279
280
        self.check_file_contents('first/hello', 'foo')
 
281
 
 
282
    def test_export_partial_tree(self):
 
283
        tree = self.example_branch()
 
284
        self.build_tree(['branch/subdir/', 'branch/subdir/foo.txt'])
 
285
        tree.smart_add(['branch'])
 
286
        tree.commit('more setup')
 
287
        out, err = self.run_bzr('export exported branch/subdir')
 
288
        self.assertEqual(['foo.txt'], os.listdir('exported'))