+ # Check if target_branch contains a subset of
+ # source_branch. If that is not the case,
+ # assume that source_branch has been replaced
+ # and remove target_branch
+ if not target_branch.last_revision() in \
+ source_branch.revision_history():
+ target_branch.set_revision_history([])
+