/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 breezy/tests/per_workingtree/test_commit.py

  • Committer: Jelmer Vernooij
  • Date: 2017-08-09 23:51:29 UTC
  • mfrom: (6747.1.1 excludes-unsupported)
  • Revision ID: jelmer@jelmer.uk-20170809235129-qw7t6d11p4zrep6c
Merge lp:~jelmer/brz/excludes-unsupported.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    )
32
32
from breezy.commit import (
33
33
    CannotCommitSelectedFileMerge,
34
 
    ExcludesUnsupported,
35
34
    PointlessCommit,
36
35
    )
37
36
from breezy.tests.per_workingtree import TestCaseWithWorkingTree
153
152
        wt2 = wt.controldir.sprout('to').open_workingtree()
154
153
        wt2.commit('change_right')
155
154
        wt.merge_from_branch(wt2.branch)
156
 
        try:
157
 
            self.assertRaises(CannotCommitSelectedFileMerge,
158
 
                wt.commit, 'test', exclude=['foo'])
159
 
        except ExcludesUnsupported:
160
 
            raise tests.TestNotApplicable("excludes not supported by this "
161
 
                "repository format")
 
155
        self.assertRaises(CannotCommitSelectedFileMerge,
 
156
            wt.commit, 'test', exclude=['foo'])
162
157
 
163
158
    def test_commit_exclude_exclude_changed_is_pointless(self):
164
159
        tree = self.make_branch_and_tree('.')
166
161
        tree.smart_add(['.'])
167
162
        tree.commit('setup test')
168
163
        self.build_tree_contents([('a', 'new contents for "a"\n')])
169
 
        try:
170
 
            self.assertRaises(PointlessCommit, tree.commit, 'test',
171
 
                exclude=['a'], allow_pointless=False)
172
 
        except ExcludesUnsupported:
173
 
            raise tests.TestNotApplicable("excludes not supported by this "
174
 
                "repository format")
 
164
        self.assertRaises(PointlessCommit, tree.commit, 'test',
 
165
            exclude=['a'], allow_pointless=False)
175
166
 
176
167
    def test_commit_exclude_excludes_modified_files(self):
177
168
        tree = self.make_branch_and_tree('.')
178
169
        self.build_tree(['a', 'b', 'c'])
179
170
        tree.smart_add(['.'])
180
 
        try:
181
 
            tree.commit('test', exclude=['b', 'c'])
182
 
        except ExcludesUnsupported:
183
 
            raise tests.TestNotApplicable("excludes not supported by this "
184
 
                "repository format")
 
171
        tree.commit('test', exclude=['b', 'c'])
185
172
        # If b was excluded it will still be 'added' in status.
186
173
        tree.lock_read()
187
174
        self.addCleanup(tree.unlock)
194
181
        tree = self.make_branch_and_tree('.')
195
182
        self.build_tree(['a/', 'a/b'])
196
183
        tree.smart_add(['.'])
197
 
        try:
198
 
            tree.commit('test', specific_files=['a'], exclude=['a/b'])
199
 
        except errors.ExcludesUnsupported:
200
 
            raise tests.TestNotApplicable("excludes not supported by this "
201
 
                "repository format")
 
184
        tree.commit('test', specific_files=['a'], exclude=['a/b'])
202
185
        # If a/b was excluded it will still be 'added' in status.
203
186
        tree.lock_read()
204
187
        self.addCleanup(tree.unlock)