Exemplo n.º 1
0
 def test_simple_merge_from_existing_git(self):
     # Launched from an existing git repository
     remotes = [{
         'name': 'r1',
         'url': self.url_remote1
     }, {
         'name': 'r2',
         'url': self.url_remote2
     }]
     merges = [{
         'remote': 'r1',
         'ref': 'tag1'
     }, {
         'remote': 'r2',
         'ref': self.commit_3_sha
     }]
     target = {
         'remote': 'r1',
         'branch': 'agg'
     }
     subprocess.call(['git', 'init', self.cwd])
     repo = Repo(self.cwd, remotes, merges, target, fetch_all=True)
     repo.aggregate()
     last_rev = git_get_last_rev(self.cwd)
     self.assertEqual(last_rev, self.commit_3_sha)
     # push
     repo.push()
     rtype, ref, sha = list(repo.query_remote('r1', 'agg'))[0]
     self.assertEquals(rtype, 'branch')
     self.assertTrue(sha)
Exemplo n.º 2
0
 def test_simple_merge(self):
     remotes = [{
         'name': 'r1',
         'url': self.url_remote1
     }, {
         'name': 'r2',
         'url': self.url_remote2
     }]
     merges = [{
         'remote': 'r1',
         'ref': 'tag1'
     }, {
         'remote': 'r2',
         'ref': self.commit_3_sha
     }]
     target = {
         'remote': 'r1',
         'branch': 'agg'
     }
     repo = Repo(self.cwd, remotes, merges, target, fetch_all=True)
     repo.aggregate()
     last_rev = git_get_last_rev(self.cwd)
     self.assertEqual(last_rev, self.commit_3_sha)
     # push
     repo.push()
     rtype, ref, sha = list(repo.query_remote('r1', 'agg'))[0]
     self.assertEquals(rtype, 'branch')
     self.assertTrue(sha)