~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_commit.py

  • Committer: Alexander Belchenko
  • Date: 2008-03-02 15:50:55 UTC
  • mfrom: (3246 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3267.
  • Revision ID: bialix@ukr.net-20080302155055-je174871vc1qde2j
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
    def test_pre_commit_passes(self):
124
124
        empty_delta = TreeDelta()
125
125
        root_delta = TreeDelta()
126
 
        root_delta.added = [('', '', 'directory')]
127
126
        tree = self.make_branch_and_memory_tree('branch')
128
127
        tree.lock_write()
129
 
        tree.add('', '')
 
128
        tree.add('')
 
129
        root_delta.added = [('', tree.path2id(''), 'directory')]
130
130
        Branch.hooks.install_hook("pre_commit", self.capture_pre_commit_hook)
131
131
        revid1 = tree.commit('first revision')
132
132
        revid2 = tree.commit('second revision')
140
140
    def test_pre_commit_fails(self):
141
141
        empty_delta = TreeDelta()
142
142
        root_delta = TreeDelta()
143
 
        root_delta.added = [('', '', 'directory')]
144
143
        tree = self.make_branch_and_memory_tree('branch')
145
144
        tree.lock_write()
146
 
        tree.add('', '')
 
145
        tree.add('')
 
146
        root_delta.added = [('', tree.path2id(''), 'directory')]
147
147
        class PreCommitException(Exception): pass
148
148
        def hook_func(local, master,
149
149
                      old_revno, old_revid, new_revno, new_revid,