~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ancestry.py

  • Committer: Vincent Ladeuil
  • Date: 2010-03-02 10:21:39 UTC
  • mfrom: (4797.2.24 2.1)
  • mto: This revision was merged to the branch mainline in revision 5069.
  • Revision ID: v.ladeuil+lp@free.fr-20100302102139-b5cba7h6xu13mekg
Merge 2.1 into trunk including fixes for #331095, #507557, #185103, #524184 and #369501

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
18
from cStringIO import StringIO
22
22
from bzrlib.tests import TestCaseWithMemoryTransport
23
23
from bzrlib.branch import Branch
24
24
from bzrlib.branchbuilder import BranchBuilder
25
 
from bzrlib.revision import is_ancestor
26
25
 
27
26
 
28
27
class TestAncestry(TestCaseWithMemoryTransport):
42
41
            rev_id_two, branch)
43
42
        self.assertAncestryEqual([None, rev_id_one], rev_id_one, branch)
44
43
 
45
 
    def test_none_is_ancestor_empty_branch(self):
46
 
        branch = self.make_branch('.')
47
 
        self.assertTrue(is_ancestor('null:', 'null:', branch))
48
 
 
49
 
    def test_none_is_ancestor_non_empty_branch(self):
50
 
        builder = BranchBuilder(self.get_transport())
51
 
        rev_id = builder.build_commit()
52
 
        branch = builder.get_branch()
53
 
        self.assertTrue(is_ancestor('null:', 'null:', branch))
54
 
        self.assertTrue(is_ancestor(rev_id, 'null:',  branch))
55
 
        self.assertFalse(is_ancestor('null:', rev_id, branch))
56
 
 
57
 
 
58
44
# TODO: check that ancestry is updated to include indirectly merged revisions