/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2008-08-20 02:07:36 UTC
  • mfrom: (3640 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3682.
  • Revision ID: robertc@robertcollins.net-20080820020736-g2xe4921zzxtymle
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
5
5
# it under the terms of the GNU General Public License as published by
6
6
# the Free Software Foundation; either version 2 of the License, or
7
7
# (at your option) any later version.
8
 
 
 
8
#
9
9
# This program is distributed in the hope that it will be useful,
10
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
12
# GNU General Public License for more details.
13
 
 
 
13
#
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
import os
 
18
 
17
19
from bzrlib.tests.blackbox import ExternalBase
18
 
import os
19
20
 
20
21
 
21
22
class TestFindMergeBase(ExternalBase):
 
23
 
22
24
    def test_find_merge_base(self):
23
 
        os.mkdir('a')
24
 
        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')
30
 
        os.chdir('../b')
31
 
        self.runbzr('commit -m baz --unchanged')
32
 
        r = self.run_bzr('find-merge-base', '.', '../a', backtick=True)
 
25
        a_tree = self.make_branch_and_tree('a')
 
26
        a_tree.commit(message='foo', allow_pointless=True)
 
27
        b_tree = a_tree.bzrdir.sprout('b').open_workingtree()
 
28
        q = self.run_bzr('find-merge-base a b')[0]
 
29
        a_tree.commit(message='bar', allow_pointless=True)
 
30
        b_tree.commit(message='baz', allow_pointless=True)
 
31
        r = self.run_bzr('find-merge-base b a')[0]
33
32
        self.assertEqual(q, r)
34
33
        
 
34
    def test_find_null_merge_base(self):
 
35
        tree = self.make_branch_and_tree('foo')
 
36
        tree.commit('message')
 
37
        tree2 = self.make_branch_and_tree('bar')
 
38
        r = self.run_bzr('find-merge-base foo bar')[0]
 
39
        self.assertEqual('merge base is revision null:\n', r)