~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

  • Committer: Andrew Bennetts
  • Date: 2009-07-27 05:35:00 UTC
  • mfrom: (4570 +trunk)
  • mto: (4634.6.29 2.0)
  • mto: This revision was merged to the branch mainline in revision 4680.
  • Revision ID: andrew.bennetts@canonical.com-20090727053500-q76zsn2dx33jhmj5
Merge bzr.dev.

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
 
18
18
import os
107
107
        tree2.unlock()
108
108
        self.assertEqual('version 2', text)
109
109
 
110
 
    def test_delete_commit(self):
111
 
        """Test a commit with a deleted file"""
 
110
    def test_missing_commit(self):
 
111
        """Test a commit with a missing file"""
112
112
        wt = self.make_branch_and_tree('.')
113
113
        b = wt.branch
114
114
        file('hello', 'w').write('hello world')
550
550
        this_tree.merge_from_branch(other_tree.branch)
551
551
        reporter = CapturingReporter()
552
552
        this_tree.commit('do the commit', reporter=reporter)
553
 
        self.assertEqual([
554
 
            ('change', 'unchanged', ''),
555
 
            ('change', 'unchanged', 'dirtoleave'),
556
 
            ('change', 'unchanged', 'filetoleave'),
 
553
        expected = set([
557
554
            ('change', 'modified', 'filetomodify'),
558
555
            ('change', 'added', 'newdir'),
559
556
            ('change', 'added', 'newfile'),
563
560
            ('renamed', 'renamed', 'filetoreparent', 'renameddir/reparentedfile'),
564
561
            ('deleted', 'dirtoremove'),
565
562
            ('deleted', 'filetoremove'),
566
 
            ],
567
 
            reporter.calls)
 
563
            ])
 
564
        result = set(reporter.calls)
 
565
        missing = expected - result
 
566
        new = result - expected
 
567
        self.assertEqual((set(), set()), (missing, new))
568
568
 
569
569
    def test_commit_removals_respects_filespec(self):
570
570
        """Commit respects the specified_files for removals."""