~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2010-02-10 15:46:03 UTC
  • mfrom: (4985.3.21 update)
  • mto: This revision was merged to the branch mainline in revision 5021.
  • Revision ID: v.ladeuil+lp@free.fr-20100210154603-k4no1gvfuqpzrw7p
Update performs two merges in a more logical order but stop on conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
343
343
        trunk = self.make_branch_and_tree('trunk')
344
344
 
345
345
        u1 = trunk.branch.create_checkout('u1')
346
 
        self.build_tree_contents([('u1/hosts', 'initial contents')])
 
346
        self.build_tree_contents([('u1/hosts', 'initial contents\n')])
347
347
        u1.add('hosts')
348
348
        self.run_bzr('commit -m add-hosts u1')
349
349
 
350
350
        u2 = trunk.branch.create_checkout('u2')
351
 
        self.build_tree_contents([('u2/hosts', 'altered in u2')])
 
351
        self.build_tree_contents([('u2/hosts', 'altered in u2\n')])
352
352
        self.run_bzr('commit -m checkin-from-u2 u2')
353
353
 
354
354
        # make an offline commits
355
 
        self.build_tree_contents([('u1/hosts', 'first offline change in u1')])
 
355
        self.build_tree_contents([('u1/hosts', 'first offline change in u1\n')])
356
356
        self.run_bzr('commit -m checkin-offline --local u1')
357
357
 
358
358
        # now try to pull in online work from u2, and then commit our offline
359
359
        # work as a merge
360
360
        # retcode 1 as we expect a text conflict
361
361
        self.run_bzr('update u1', retcode=1)
 
362
        self.assertFileEqual('''\
 
363
<<<<<<< TREE
 
364
first offline change in u1
 
365
=======
 
366
altered in u2
 
367
>>>>>>> MERGE-SOURCE
 
368
''',
 
369
                             'u1/hosts')
 
370
 
362
371
        self.run_bzr('resolved u1/hosts')
363
372
        # add a text change here to represent resolving the merge conflicts in
364
373
        # favour of a new version of the file not identical to either the u1