def check_selective_push_or_pull(self, direction):
with TemporaryDirectory() as directory:<EOL><INDENT>source, target = self.get_source_and_target(directory)<EOL>for branch_name in '<STR_LIT>', '<STR_LIT>':<EOL><INDENT>source.checkout()<EOL>source.create_branch(branch_name)<EOL>source.context.write_file(branch_name, "<STR_LIT>" % branch_name)<EOL>source.add_files(branch_name)<EOL>source.commit("<STR_LIT>" % branch_name)<EOL><DEDENT>assert '<STR_LIT>' in source.branches<EOL>assert '<STR_LIT>' not in target.branches<EOL>assert '<STR_LIT>' in source.branches<EOL>assert '<STR_LIT>' not in target.branches<EOL>if direction == '<STR_LIT>':<EOL><INDENT>source.push(remote=target.local, revision='<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>target.pull(remote=source.local, revision='<STR_LIT>')<EOL><DEDENT>assert '<STR_LIT>' in source.branches<EOL>assert '<STR_LIT>' not in target.branches<EOL>assert '<STR_LIT>' in source.branches<EOL>assert '<STR_LIT>' in target.branches<EOL><DEDENT>
Test pushing and pulling of specific revisions.