~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

Abbreviate pack_stat struct format to '>6L'

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from bzrlib.bzrdir import BzrDirMetaFormat1
27
27
from bzrlib.commit import Commit, NullCommitReporter
28
28
from bzrlib.config import BranchConfig
29
 
from bzrlib.errors import (PointlessCommit, BzrError, SigningFailed,
30
 
                           LockContention)
 
29
from bzrlib.errors import (
 
30
    PointlessCommit,
 
31
    BzrError,
 
32
    SigningFailed,
 
33
    LockContention,
 
34
    )
31
35
from bzrlib.tests import (
32
 
    SymlinkFeature,
33
36
    TestCaseWithTransport,
34
37
    test_foreign,
35
38
    )
 
39
from bzrlib.tests.features import (
 
40
    SymlinkFeature,
 
41
    )
 
42
from bzrlib.tests.matchers import MatchesAncestry
36
43
 
37
44
 
38
45
# TODO: Test commit with some added, and added-but-missing files
154
161
        wt.commit(message='add hello')
155
162
 
156
163
        os.remove('hello')
157
 
        wt.commit('removed hello', rev_id='rev2')
 
164
        reporter = CapturingReporter()
 
165
        wt.commit('removed hello', rev_id='rev2', reporter=reporter)
 
166
        self.assertEquals(
 
167
            [('missing', u'hello'), ('deleted', u'hello')],
 
168
            reporter.calls)
158
169
 
159
170
        tree = b.repository.revision_tree('rev2')
160
171
        self.assertFalse(tree.has_id('hello-id'))
357
368
        eq = self.assertEquals
358
369
        eq(b.revision_history(), rev_ids)
359
370
        for i in range(4):
360
 
            anc = b.repository.get_ancestry(rev_ids[i])
361
 
            eq(anc, [None] + rev_ids[:i+1])
 
371
            self.assertThat(rev_ids[:i+1],
 
372
                MatchesAncestry(b.repository, rev_ids[i]))
362
373
 
363
374
    def test_commit_new_subdir_child_selective(self):
364
375
        wt = self.make_branch_and_tree('.')