/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/interversionedfile_implementations/test_join.py

  • Committer: Robert Collins
  • Date: 2008-03-27 01:25:24 UTC
  • mto: This revision was merged to the branch mainline in revision 3313.
  • Revision ID: robertc@robertcollins.net-20080327012524-yfgr0lek5ckiowhn
Deprecate VersionedFile.has_ghost.

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
        # does not must discard it, and when filling a ghost for a listed
206
206
        # ghost must reconcile it
207
207
        source = self.get_source()
208
 
        try:
209
 
            source.has_ghost('a')
210
 
            source_ghosts = True
211
 
        except NotImplementedError:
212
 
            source_ghosts = False
213
208
        target = self.get_target()
214
 
        try:
215
 
            target.has_ghost('a')
216
 
            target_ghosts = True
217
 
        except NotImplementedError:
218
 
            target_ghosts = False
219
 
 
220
 
        if not source_ghosts and not target_ghosts:
221
 
            # nothing to do
222
 
            return
223
 
        if source_ghosts and not target_ghosts:
224
 
            # switch source and target so source is ghostless
225
 
            t = source
226
 
            source = target
227
 
            target = t
228
 
            source_ghosts = False
229
 
            target_ghosts = True
230
 
        # now target always supports ghosts.
231
 
 
232
209
        # try filling target with ghosts and filling in reverse -  
233
 
        target.add_lines_with_ghosts('notbase', ['base'], [])
 
210
        try:
 
211
            target.add_lines_with_ghosts('notbase', ['base'], [])
 
212
        except NotImplementedError:
 
213
            # The target does not support ghosts; the test is irrelevant.
 
214
            return
234
215
        try:
235
216
            source.join(target)
236
217
        except errors.RevisionNotPresent:
237
 
            # can't join a ghost containing target onto a non-ghost supporting
238
 
            # source.
239
 
            self.assertFalse(source_ghosts)
240
218
            return
241
 
        else:
242
 
            self.assertTrue(source_ghosts)
243
219
        # legacy apis should behave
244
220
        self.assertEqual(['notbase'], source.get_ancestry(['notbase']))
245
221
        self.assertFalse(source.has_version('base'))