/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

Merge bzr.dev r3466

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
121
121
        tree = b.repository.revision_tree('rev2')
122
122
        self.assertFalse(tree.has_id('hello-id'))
123
123
 
 
124
    def test_partial_commit_move(self):
 
125
        """Test a partial commit where a file was renamed but not committed.
 
126
 
 
127
        https://bugs.launchpad.net/bzr/+bug/83039
 
128
        
 
129
        If not handled properly, commit will try to snapshot
 
130
        dialog.py with olive/ as a parent, while 
 
131
        olive/ has not been snapshotted yet.
 
132
        """
 
133
        wt = self.make_branch_and_tree('.')
 
134
        b = wt.branch
 
135
        self.build_tree(['annotate/', 'annotate/foo.py',
 
136
                         'olive/', 'olive/dialog.py'
 
137
                        ])
 
138
        wt.add(['annotate', 'olive', 'annotate/foo.py', 'olive/dialog.py'])
 
139
        wt.commit(message='add files')
 
140
        wt.rename_one("olive/dialog.py", "aaa")
 
141
        self.build_tree_contents([('annotate/foo.py', 'modified\n')])
 
142
        wt.commit('renamed hello', specific_files=["annotate"])
 
143
 
124
144
    def test_pointless_commit(self):
125
145
        """Commit refuses unless there are changes or it's forced."""
126
146
        wt = self.make_branch_and_tree('.')
444
464
        bound = master.sprout('bound')
445
465
        wt = bound.open_workingtree()
446
466
        wt.branch.set_bound_location(os.path.realpath('master'))
447
 
 
448
 
        orig_default = lockdir._DEFAULT_TIMEOUT_SECONDS
449
467
        master_branch.lock_write()
450
468
        try:
451
 
            lockdir._DEFAULT_TIMEOUT_SECONDS = 1
452
469
            self.assertRaises(LockContention, wt.commit, 'silly')
453
470
        finally:
454
 
            lockdir._DEFAULT_TIMEOUT_SECONDS = orig_default
455
471
            master_branch.unlock()
456
472
 
457
473
    def test_commit_bound_merge(self):