~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2007-07-04 08:08:13 UTC
  • mfrom: (2572 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2587.
  • Revision ID: robertc@robertcollins.net-20070704080813-wzebx0r88fvwj5rq
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 by Canonical Ltd
 
1
# Copyright (C) 2005 Canonical Ltd
2
2
# -*- coding: utf-8 -*-
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
19
19
 
20
20
 
21
21
class TestFindMergeBase(ExternalBase):
 
22
 
22
23
    def test_find_merge_base(self):
23
24
        os.mkdir('a')
24
25
        os.chdir('a')
25
 
        self.runbzr('init')
26
 
        self.runbzr('commit -m foo --unchanged')
27
 
        self.runbzr('branch . ../b')
28
 
        q = self.run_bzr('find-merge-base', '.', '../b', backtick=True)
29
 
        self.runbzr('commit -m bar --unchanged')
 
26
        self.run_bzr('init')
 
27
        self.run_bzr('commit -m foo --unchanged')
 
28
        self.run_bzr('branch . ../b')
 
29
        q = self.run_bzr(['find-merge-base', '.', '../b'])[0]
 
30
        self.run_bzr('commit -m bar --unchanged')
30
31
        os.chdir('../b')
31
 
        self.runbzr('commit -m baz --unchanged')
32
 
        r = self.run_bzr('find-merge-base', '.', '../a', backtick=True)
 
32
        self.run_bzr('commit -m baz --unchanged')
 
33
        r = self.run_bzr(['find-merge-base', '.', '../a'])[0]
33
34
        self.assertEqual(q, r)
34
35
        
 
36
    def test_find_null_merge_base(self):
 
37
        tree = self.make_branch_and_tree('foo')
 
38
        tree.commit('message')
 
39
        tree2 = self.make_branch_and_tree('bar')
 
40
        r = self.run_bzr('find-merge-base', 'foo', 'bar')[0]
 
41
        self.assertEqual('merge base is revision null:\n', r)