~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_iter_merge_sorted_revisions.py

  • Committer: John Arbash Meinel
  • Date: 2010-02-17 17:11:16 UTC
  • mfrom: (4797.2.17 2.1)
  • mto: (4797.2.18 2.1)
  • mto: This revision was merged to the branch mainline in revision 5055.
  • Revision ID: john@arbash-meinel.com-20100217171116-h7t9223ystbnx5h8
merge bzr.2.1 in preparation for NEWS entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
84
84
            ], list(the_branch.iter_merge_sorted_revisions(
85
85
                stop_revision_id='rev-3', stop_rule='with-merges')))
86
86
 
 
87
    def test_merge_sorted_range_stop_with_merges_can_show_non_parents(self):
 
88
        tree = self.create_tree_with_merge()
 
89
        the_branch = tree.bzrdir.open_branch()
 
90
        # rev-1.1.1 gets logged before the end revision is reached.
 
91
        # so it is returned even though rev-1.1.1 is not a parent of rev-2.
 
92
        self.assertEqual([
 
93
            ('rev-3', 0, (3,), False),
 
94
            ('rev-1.1.1', 1, (1,1,1), True),
 
95
            ('rev-2', 0, (2,), False),
 
96
            ], list(the_branch.iter_merge_sorted_revisions(
 
97
                stop_revision_id='rev-2', stop_rule='with-merges')))
 
98
 
 
99
    def test_merge_sorted_range_stop_with_merges_ignore_non_parents(self):
 
100
        tree = self.create_tree_with_merge()
 
101
        the_branch = tree.bzrdir.open_branch()
 
102
        # rev-2 is not a parent of rev-1.1.1 so it must not be returned
 
103
        self.assertEqual([
 
104
            ('rev-3', 0, (3,), False),
 
105
            ('rev-1.1.1', 1, (1,1,1), True),
 
106
            ], list(the_branch.iter_merge_sorted_revisions(
 
107
                stop_revision_id='rev-1.1.1', stop_rule='with-merges')))
 
108
 
87
109
    def test_merge_sorted_single_stop_exclude(self):
88
110
        # from X..X exclusive is an empty result
89
111
        tree = self.create_tree_with_merge()