/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-10 00:51:26 UTC
  • mfrom: (6747.3.1 avoid-set-revid-2)
  • Revision ID: jelmer@jelmer.uk-20170810005126-pmeq8y51dax20svq
Merge lp:~jelmer/brz/avoid-set-revid-2

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
 
192
192
    def test_commit_sets_last_revision(self):
193
193
        tree = self.make_branch_and_tree('tree')
194
 
        committed_id = tree.commit('foo', rev_id='foo')
195
 
        self.assertEqual(['foo'], tree.get_parent_ids())
196
 
        # the commit should have returned the same id we asked for.
197
 
        self.assertEqual('foo', committed_id)
 
194
        if tree.branch.repository._format.supports_setting_revision_ids:
 
195
            committed_id = tree.commit('foo', rev_id='foo')
 
196
            # the commit should have returned the same id we asked for.
 
197
            self.assertEqual('foo', committed_id)
 
198
        else:
 
199
            committed_id = tree.commit('foo')
 
200
        self.assertEqual([committed_id], tree.get_parent_ids())
198
201
 
199
202
    def test_commit_returns_revision_id(self):
200
203
        tree = self.make_branch_and_tree('.')
255
258
        self.assertRaises(errors.UnknownFormatError,
256
259
                          controldir.ControlDir.open,
257
260
                          'master')
258
 
        tree.commit('foo', rev_id='foo', local=True)
 
261
        tree.commit('foo', local=True)
259
262
 
260
263
    def test_local_commit_does_not_push_to_master(self):
261
264
        # a --local commit does not require access to the master branch
268
271
        except errors.UpgradeRequired:
269
272
            # older format.
270
273
            return
271
 
        tree.commit('foo', rev_id='foo', local=True)
272
 
        self.assertFalse(master.repository.has_revision('foo'))
 
274
        committed_id = tree.commit('foo', local=True)
 
275
        self.assertFalse(master.repository.has_revision(committed_id))
273
276
        self.assertEqual(_mod_revision.NULL_REVISION,
274
277
                         (_mod_revision.ensure_null(master.last_revision())))
275
278