~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-08-21 04:15:04 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-20050821041504-866f53c120065af3
Added revision-based common-ancestor checking

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
            os.mkdir(name)
89
89
            return Branch(name, init=True)
90
90
            
91
 
        #highest indices a: 3, b: 4
 
91
        #highest indices a: 5, b: 7
92
92
        br_a, br_b = make_branches()
93
93
        assert not has_revision(br_b, br_a.revision_history()[3])
94
94
        assert has_revision(br_b, br_a.revision_history()[2])
95
 
        assert len(br_b.revision_history()) == 5
 
95
        assert len(br_b.revision_history()) == 7
96
96
        assert greedy_fetch(br_b, br_a, br_a.revision_history()[2])[0] == 0
97
97
 
98
98
        # greedy_fetch is not supposed to alter the revision history
99
 
        assert len(br_b.revision_history()) == 5
 
99
        assert len(br_b.revision_history()) == 7
100
100
        assert not has_revision(br_b, br_a.revision_history()[3])
101
101
 
102
 
        assert len(br_b.revision_history()) == 5
 
102
        assert len(br_b.revision_history()) == 7
103
103
        assert greedy_fetch(br_b, br_a, br_a.revision_history()[3])[0] == 1
104
104
        assert has_revision(br_b, br_a.revision_history()[3])
105
105
        assert not has_revision(br_a, br_b.revision_history()[3])
109
109
        # exception
110
110
        br_a4 = new_branch('br_a4')
111
111
        count, failures = greedy_fetch(br_a4, br_a)
112
 
        assert count == 4
113
 
        assert failures == set((br_b.revision_history()[4],)) 
 
112
        assert count == 6
 
113
        assert failures == set((br_b.revision_history()[4],
 
114
                                br_b.revision_history()[5])) 
114
115
 
115
 
        assert greedy_fetch(br_a, br_b)[0] == 2
 
116
        assert greedy_fetch(br_a, br_b)[0] == 4
116
117
        assert has_revision(br_a, br_b.revision_history()[3])
117
118
        assert has_revision(br_a, br_b.revision_history()[4])
118
119
 
119
120
        br_b2 = new_branch('br_b2')
120
 
        assert greedy_fetch(br_b2, br_b)[0] == 5
 
121
        assert greedy_fetch(br_b2, br_b)[0] == 7
121
122
        assert has_revision(br_b2, br_b.revision_history()[4])
122
123
        assert has_revision(br_b2, br_a.revision_history()[2])
123
124
        assert not has_revision(br_b2, br_a.revision_history()[3])
124
125
 
125
126
        br_a2 = new_branch('br_a2')
126
 
        assert greedy_fetch(br_a2, br_a)[0] == 6
 
127
        assert greedy_fetch(br_a2, br_a)[0] == 9
127
128
        assert has_revision(br_a2, br_b.revision_history()[4])
128
129
        assert has_revision(br_a2, br_a.revision_history()[3])
129
130