~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-08-21 02:20:35 UTC
  • mto: (1092.1.41) (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1110.
  • Revision ID: aaron.bentley@utoronto.ca-20050821022035-f960c20a39d16e79
Made merge do greedy fetching.

Show diffs side-by-side

added added

removed removed

Lines of Context:
352
352
 
353
353
 
354
354
 
 
355
def example_branch(test):
 
356
    test.runbzr('init')
 
357
 
 
358
    file('hello', 'wt').write('foo')
 
359
    test.runbzr('add hello')
 
360
    test.runbzr('commit -m setup hello')
 
361
 
 
362
    file('goodbye', 'wt').write('baz')
 
363
    test.runbzr('add goodbye')
 
364
    test.runbzr('commit -m setup goodbye')
355
365
 
356
366
 
357
367
class RevertCommand(ExternalBase):
358
368
    def runTest(self):
359
 
        self.runbzr('init')
360
 
 
361
 
        file('hello', 'wt').write('foo')
362
 
        self.runbzr('add hello')
363
 
        self.runbzr('commit -m setup hello')
364
 
 
365
 
        file('goodbye', 'wt').write('baz')
366
 
        self.runbzr('add goodbye')
367
 
        self.runbzr('commit -m setup goodbye')
368
 
        
 
369
        example_branch(self)
369
370
        file('hello', 'wt').write('bar')
370
371
        file('goodbye', 'wt').write('qux')
371
372
        self.runbzr('revert hello')
374
375
        self.runbzr('revert')
375
376
        self.check_file_contents('goodbye', 'baz')
376
377
 
 
378
 
 
379
class MergeCommand(ExternalBase):
 
380
    def runTest(self):
 
381
        from bzrlib.branch import Branch
 
382
        import os
 
383
        os.mkdir('a')
 
384
        os.chdir('a')
 
385
        example_branch(self)
 
386
        os.chdir('..')
 
387
        self.runbzr('branch a b')
 
388
        os.chdir('b')
 
389
        file('goodbye', 'wt').write('quux')
 
390
        self.runbzr(['commit',  '-m',  "more u's are always good"])
 
391
 
 
392
        os.chdir('../a')
 
393
        file('hello', 'wt').write('quuux')
 
394
        # We can't merge when there are in-tree changes
 
395
        self.runbzr('merge ../b', retcode=1)
 
396
        self.runbzr(['commit', '-m', "Like an epidemic of u's"])
 
397
        self.runbzr('merge ../b')
 
398
        self.check_file_contents('goodbye', 'quux')
 
399
        # Merging a branch pulls its revision into the tree
 
400
        Branch('.').get_revision_xml(Branch('../b').last_patch())