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()
209
source.has_ghost('a')
211
except NotImplementedError:
212
source_ghosts = False
213
208
target = self.get_target()
215
target.has_ghost('a')
217
except NotImplementedError:
218
target_ghosts = False
220
if not source_ghosts and not target_ghosts:
223
if source_ghosts and not target_ghosts:
224
# switch source and target so source is ghostless
228
source_ghosts = False
230
# now target always supports ghosts.
232
209
# try filling target with ghosts and filling in reverse -
233
target.add_lines_with_ghosts('notbase', ['base'], [])
211
target.add_lines_with_ghosts('notbase', ['base'], [])
212
except NotImplementedError:
213
# The target does not support ghosts; the test is irrelevant.
235
216
source.join(target)
236
217
except errors.RevisionNotPresent:
237
# can't join a ghost containing target onto a non-ghost supporting
239
self.assertFalse(source_ghosts)
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'))