~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-04-16 15:11:49 UTC
  • mfrom: (5777.7.6 bound-commit-lossy)
  • Revision ID: pqm@pqm.ubuntu.com-20110416151149-qlsm8s7wy37mw3kx
(Jelmer) Add support for bound branches for 'bzr commit --lossy'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
            timestamp=1302659388, timezone=0)
129
129
        self.assertEquals('dummy-v1:1302659388.0-0-UNKNOWN', revid)
130
130
 
 
131
    def test_commit_bound_lossy_foreign(self):
 
132
        """Attempt a lossy commit to a bzr branch bound to a foreign branch."""
 
133
        test_foreign.register_dummy_foreign_for_test(self)
 
134
        foreign_branch = self.make_branch('foreign',
 
135
            format=test_foreign.DummyForeignVcsDirFormat())
 
136
        wt = foreign_branch.create_checkout("local")
 
137
        b = wt.branch
 
138
        file('local/hello', 'w').write('hello world')
 
139
        wt.add('hello')
 
140
        revid = wt.commit(message='add hello', lossy=True,
 
141
            timestamp=1302659388, timezone=0)
 
142
        self.assertEquals('dummy-v1:1302659388.0-0-0', revid)
 
143
        self.assertEquals('dummy-v1:1302659388.0-0-0',
 
144
            foreign_branch.last_revision())
 
145
        self.assertEquals('dummy-v1:1302659388.0-0-0',
 
146
            wt.branch.last_revision())
 
147
 
131
148
    def test_missing_commit(self):
132
149
        """Test a commit with a missing file"""
133
150
        wt = self.make_branch_and_tree('.')