~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_merge.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-08-09 17:05:22 UTC
  • mfrom: (1910.1.1 merge-uncommitted)
  • Revision ID: pqm@pqm.ubuntu.com-20060809170522-28c918e7d93365fe
Merge takes --uncommitted parameter

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
        # but it does nothing
209
209
        self.assertFalse(tree_a.changes_from(tree_a.basis_tree()).has_changed())
210
210
        self.assertEqual('Nothing to do.\n', output)
 
211
 
 
212
    def test_merge_uncommitted(self):
 
213
        """Check that merge --uncommitted behaves properly"""
 
214
        tree_a = self.make_branch_and_tree('a')
 
215
        self.build_tree(['a/file_1', 'a/file_2'])
 
216
        tree_a.add(['file_1', 'file_2'])
 
217
        tree_a.commit('commit 1')
 
218
        tree_b = tree_a.bzrdir.sprout('b').open_workingtree()
 
219
        self.failUnlessExists('b/file_1')
 
220
        tree_a.rename_one('file_1', 'file_i')
 
221
        tree_a.commit('commit 2')
 
222
        tree_a.rename_one('file_2', 'file_ii')
 
223
        os.chdir('b')
 
224
        self.run_bzr('merge', '../a', '--uncommitted')
 
225
        self.failUnlessExists('file_1')
 
226
        self.failUnlessExists('file_ii')
 
227
        tree_b.revert([])
 
228
        self.run_bzr_error(('Cannot use --uncommitted and --revision',), 
 
229
                           'merge', '../a', '--uncommitted', '-r1')