~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing 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
 
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',