

def test_log_with_branches(self):
    vcs = self.get_vcs()
    check_call('git checkout -b B2'.split(' '), cwd=self.remote_path)
    self._add_file('BAZ', self.remote_path, commit_msg='second branch commit')
    check_call(['git', 'checkout', vcs.get_default_revision()], cwd=self.remote_path)
    check_call('git checkout -b B3'.split(' '), cwd=self.remote_path)
    self._add_file('IPSUM', self.remote_path, commit_msg='3rd branch')
    vcs.clone()
    vcs.update()
    revisions = list(vcs.log())
    assert (len(revisions) == 4)
    (last_rev, previous_rev) = self._get_last_two_revisions('B3', revisions)
    self.assertRevision(last_rev, message='3rd branch', branches=['B3'])
    self.assertRevision(previous_rev, message='second branch commit', branches=['B2'])
    self.assertRevision(revisions[3], message='test', branches=[vcs.get_default_revision(), 'B2', 'B3'])
    revisions = list(vcs.log(branch='B3'))
    assert (len(revisions) == 3)
    self.assertRevision(vcs[0], message='3rd branch', branches=['B3'])
    self.assertRevision(revisions[2], message='test', branches=[vcs.get_default_revision(), 'B2', 'B3'])
    check_call(['git', 'checkout', vcs.get_default_revision()], cwd=self.remote_path)
    revisions = list(vcs.log(branch=vcs.get_default_revision()))
    assert (len(revisions) == 2)

dataset/ETHPy150Open dropbox/changes/tests/changes/vcs/test_git.py GitVcsTest.test_log_with_branches/VarMisuse@239/356 `revisions`->`vcs`