~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2010-01-12 03:53:21 UTC
  • mfrom: (4948 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4964.
  • Revision ID: andrew.bennetts@canonical.com-20100112035321-hofpz5p10224ryj3
Merge lp:bzr, resolving conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Tests for the contract of commit on branches."""
18
18
 
19
19
from bzrlib.branch import Branch
20
20
from bzrlib import errors
21
 
from bzrlib.tests.branch_implementations.test_branch import TestCaseWithBranch
 
21
from bzrlib.tests.per_branch.test_branch import TestCaseWithBranch
22
22
from bzrlib.revision import NULL_REVISION
23
23
from bzrlib.transport import get_transport
24
24
from bzrlib.delta import TreeDelta
34
34
        branch.nick = "My happy branch"
35
35
        wt.commit('My commit respect da nick.')
36
36
        committed = branch.repository.get_revision(branch.last_revision())
37
 
        self.assertEqual(committed.properties["branch-nick"], 
 
37
        self.assertEqual(committed.properties["branch-nick"],
38
38
                         "My happy branch")
39
39
 
40
40
 
47
47
    def capture_post_commit_hook(self, local, master, old_revno,
48
48
        old_revid, new_revno, new_revid):
49
49
        """Capture post commit hook calls to self.hook_calls.
50
 
        
 
50
 
51
51
        The call is logged, as is some state of the two branches.
52
52
        """
53
53
        if local:
119
119
            ],
120
120
            self.hook_calls)
121
121
        tree.unlock()
122
 
    
 
122
 
123
123
    def test_pre_commit_passes(self):
124
124
        empty_delta = TreeDelta()
125
125
        root_delta = TreeDelta()
193
193
            revid1 = tree.commit('first revision')
194
194
        finally:
195
195
            tree.unlock()
196
 
        
 
196
 
197
197
        tree.lock_write()
198
198
        try:
199
199
            # making changes
207
207
            revid2 = tree.commit('second revision')
208
208
        finally:
209
209
            tree.unlock()
210
 
        
 
210
 
211
211
        expected_delta = TreeDelta()
212
212
        expected_delta.added = [('added_dir', 'added_dir_id', 'directory')]
213
213
        expected_delta.removed = [('to_be_unversioned',