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

  • Committer: Andrew Bennetts
  • Date: 2009-07-17 01:48:56 UTC
  • mfrom: (4543 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4545.
  • Revision ID: andrew.bennetts@canonical.com-20090717014856-c8igd2f9abbi3v30
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
                           UnsupportedOperation)
35
35
from bzrlib.osutils import pathjoin, getcwd
36
36
from bzrlib.tests import TestCase
37
 
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
 
37
from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
38
38
from bzrlib.trace import mutter
39
39
from bzrlib.workingtree import (TreeEntry, TreeDirectory, TreeFile, TreeLink,
40
40
                                WorkingTree)
280
280
        wt2.merge_from_branch(wt.branch)
281
281
        wt2.commit('merged kind change')
282
282
 
 
283
    def test_commit_aborted_does_not_apply_automatic_changes_bug_282402(self):
 
284
        wt = self.make_branch_and_tree('.')
 
285
        wt.add(['a'], ['a-id'], ['file'])
 
286
        def fail_message(obj):
 
287
            raise errors.BzrCommandError("empty commit message")
 
288
        self.assertRaises(errors.BzrCommandError, wt.commit,
 
289
            message_callback=fail_message)
 
290
        self.assertEqual('a', wt.id2path('a-id'))
 
291
 
283
292
    def test_local_commit_ignores_master(self):
284
293
        # a --local commit does not require access to the master branch
285
294
        # at all, or even for it to exist.
602
611
        revid = tree.commit('first post')
603
612
        committed_tree = tree.basis_tree()
604
613
        self.assertTrue(committed_tree.has_filename("newfile"))
 
614
 
 
615
    def test_commit_and_mv_dance_a(self):
 
616
        # should fail because of
 
617
        # <https://bugs.launchpad.net/bzr/+bug/395556> but apparently does
 
618
        # not, while the blackbox.test_commit equivalent does - maybe because
 
619
        # of different format combinations
 
620
        tree = self.make_branch_and_tree(".")
 
621
        self.build_tree(["a"])
 
622
        tree.add("a")
 
623
        tree.rename_one("a", "b")
 
624
        tree.commit("Actually no, b")
 
625
        tree.rename_one("b", "a")
 
626
        tree.commit("No, really, a")
 
627
 
 
628
    def test_commit_and_mv_dance_b(self):
 
629
        # should fail because of
 
630
        # <https://bugs.launchpad.net/bzr/+bug/395556> but apparently does
 
631
        # not, while the blackbox.test_commit equivalent does - maybe because
 
632
        # of different format combinations
 
633
        tree = self.make_branch_and_tree(".")
 
634
        self.build_tree(["b"])
 
635
        tree.add("b")
 
636
        tree.rename_one("b", "a")
 
637
        tree.commit("Actually no, a")
 
638
        tree.rename_one("a", "b")
 
639
        tree.commit("No, really, b")