~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-01-17 17:21:14 UTC
  • mfrom: (2229.2.5 reserved-ids)
  • Revision ID: pqm@pqm.ubuntu.com-20070117172114-dc75493dad46088c
Ensure reserved ids are never stored

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
        try:
74
74
            tree.add(['a-rev-tree', 'c-rev', 'd-rev'])
75
75
            tree.commit('add test files')
76
 
            # remove currently uses self._write_inventory - 
77
 
            # work around that for now.
78
 
            tree.flush()
79
76
            tree.remove(['d-rev'])
80
77
            tree.rename_one('a-rev-tree', 'b-tree')
81
78
            tree.rename_one('c-rev', 'a-rev-tree')
 
79
 
 
80
            # 'b-tree' is not present in the old tree.
 
81
            self.run_bzr_error([], 'cat', 'b-tree', '--name-from-revision')
 
82
 
 
83
            # get to the old file automatically
 
84
            out, err = self.run_bzr('cat', 'd-rev')
 
85
            self.assertEqual('bar\n', out)
 
86
            self.assertEqual('', err)
 
87
 
 
88
            out, err = self.run_bzr('cat', 'a-rev-tree',
 
89
                                    '--name-from-revision')
 
90
            self.assertEqual('foo\n', out)
 
91
            self.assertEqual('', err)
 
92
 
 
93
            out, err = self.run_bzr('cat', 'a-rev-tree')
 
94
            self.assertEqual('baz\n', out)
 
95
            self.assertEqual('', err)
82
96
        finally:
83
 
            # calling bzr as another process require free lock on win32
84
97
            tree.unlock()
85
98
 
86
 
        # 'b-tree' is not present in the old tree.
87
 
        self.run_bzr_error(["^bzr: ERROR: u?'b-tree' "
88
 
                            "is not present in revision .+$"],
89
 
                           'cat b-tree --name-from-revision')
90
 
 
91
 
        # get to the old file automatically
92
 
        out, err = self.run_bzr('cat d-rev')
93
 
        self.assertEqual('bar\n', out)
94
 
        self.assertEqual('', err)
95
 
 
96
 
        out, err = self.run_bzr('cat a-rev-tree --name-from-revision')
97
 
        self.assertEqual('foo\n', out)
98
 
        self.assertEqual('', err)
99
 
 
100
 
        out, err = self.run_bzr('cat a-rev-tree')
101
 
        self.assertEqual('baz\n', out)
102
 
        self.assertEqual('', err)
103
 
 
104
99
    def test_remote_cat(self):
105
100
        wt = self.make_branch_and_tree('.')
106
101
        self.build_tree(['README'])
108
103
        wt.commit('Making sure there is a basis_tree available')
109
104
 
110
105
        url = self.get_readonly_url() + '/README'
111
 
        out, err = self.run_bzr(['cat', url])
112
 
        self.assertEqual('contents of README\n', out)
113
 
 
114
 
    def test_cat_no_working_tree(self):
115
 
        wt = self.make_branch_and_tree('.')
116
 
        self.build_tree(['README'])
117
 
        wt.add('README')
118
 
        wt.commit('Making sure there is a basis_tree available')
119
 
        wt.branch.bzrdir.destroy_workingtree()
120
 
 
121
 
        url = self.get_readonly_url() + '/README'
122
 
        out, err = self.run_bzr(['cat', url])
123
 
        self.assertEqual('contents of README\n', out)
124
 
        
 
106
        out, err = self.run_bzr('cat', url)
 
107
        self.assertEqual('contents of README\n', out)