Exemplo n.º 1
0
 def test_describe_never_tagged_before(self):
     git = Git(root_dir_local, test_repo_dir)
     git.clone()
     lib.call_and_exit_if_failed(
         'git tag -a release/0.1.1 -m \'releasing version\'')
     latest_tag = git.describe()
     self.assertEqual(latest_tag, "0.1.1")
Exemplo n.º 2
0
 def tag(self, commit_id, tag):
     path = self.path()
     os.chdir(path)
     lib.call_and_exit_if_failed('git tag -a ' + tag + ' -m \'releasing version '
                                 + tag + ' of ' + self.repo_name() + '\' ' + commit_id)
     print 'Pushing new tag ' + tag + ' to origin'
     lib.call_and_exit_if_failed('git push -q origin ' + tag)
Exemplo n.º 3
0
 def tag(self, commit_id, tag):
     path = self.path()
     os.chdir(path)
     lib.call_and_exit_if_failed('git tag -a ' + tag +
                                 ' -m \'releasing version ' + tag + ' of ' +
                                 self.repo_name() + '\' ' + commit_id)
     print 'Pushing new tag ' + tag + ' to origin'
     lib.call_and_exit_if_failed('git push -q origin ' + tag)
Exemplo n.º 4
0
 def clone(self):
     path = self.path()
     if not os.path.exists(path):
         if not os.path.exists(self.root_dir):
             os.mkdir(self.root_dir)
         os.chdir(self.root_dir)
         if self.verbose:
             print 'cloning into ' + path
         lib.call_and_exit_if_failed('git clone -q %s' % self.repo_url)
     os.chdir(path)
     lib.call_and_exit_if_failed('git fetch -q')
Exemplo n.º 5
0
 def clone(self):
     path = self.path()
     if not os.path.exists(path):
         if not os.path.exists(self.root_dir):
             os.mkdir(self.root_dir)
         os.chdir(self.root_dir)
         if self.verbose:
             print 'cloning into ' + path
         lib.call_and_exit_if_failed('git clone -q %s' % self.repo_url)
     os.chdir(path)
     lib.call_and_exit_if_failed('git fetch -q')
Exemplo n.º 6
0
 def test_update(self):
     git = Git(root_dir_local, test_repo_dir)
     git.clone()
     self.assertTrue(os.path.exists(os.path.join(test_repo_dir, "ANOTHER_FILE.txt")) != 1)
     os.chdir(test_repo_dir)
     with open("ANOTHER_FILE.txt", "a") as the_file:
         the_file.write("Another file")
     lib.call_and_exit_if_failed("git add .")
     lib.call_and_exit_if_failed('git commit -m "another commit"')
     git.update()
     self.assertTrue(os.path.exists(os.path.join(test_repo_dir, "ANOTHER_FILE.txt")) == 1)
Exemplo n.º 7
0
 def test_update(self):
     git = Git(root_dir_local, test_repo_dir)
     git.clone()
     self.assertTrue(
         os.path.exists(os.path.join(test_repo_dir, "ANOTHER_FILE.txt")) !=
         1)
     os.chdir(test_repo_dir)
     with open('ANOTHER_FILE.txt', 'a') as the_file:
         the_file.write('Another file')
     lib.call_and_exit_if_failed('git add .')
     lib.call_and_exit_if_failed('git commit -m "another commit"')
     git.update()
     self.assertTrue(
         os.path.exists(os.path.join(test_repo_dir, "ANOTHER_FILE.txt")) ==
         1)
Exemplo n.º 8
0
 def setUp(self):
     # This is setting up a local git server with a test project
     if not os.path.exists(root_dir_remote):
         os.makedirs(test_repo_dir)
     os.chdir(test_repo_dir)
     lib.call_and_exit_if_failed("git init")
     with open("README.md", "a") as the_file:
         the_file.write("Hello")
     lib.call_and_exit_if_failed("git add .")
     lib.call_and_exit_if_failed('git commit -m "test"')
Exemplo n.º 9
0
 def setUp(self):
     # This is setting up a local git server with a test project
     if not os.path.exists(root_dir_remote):
         os.makedirs(test_repo_dir)
     os.chdir(test_repo_dir)
     lib.call_and_exit_if_failed('git init')
     with open('README.md', 'a') as the_file:
         the_file.write('Hello')
     lib.call_and_exit_if_failed('git add .')
     lib.call_and_exit_if_failed('git commit -m "test"')
Exemplo n.º 10
0
 def latest_commit_id(self):
     query = lib.call_and_exit_if_failed('git log -1 --pretty="%H"')
     return query.stdout.read().strip()
Exemplo n.º 11
0
 def update(self):
     path = self.path()
     os.chdir(path)
     lib.call_and_exit_if_failed('git checkout -q ' + branch)
     lib.call_and_exit_if_failed('git pull -q origin ' + branch)
Exemplo n.º 12
0
 def latest_commit_id(self):
     query = lib.call_and_exit_if_failed('git log -1 --pretty="%H"')
     return query.stdout.read().strip()
Exemplo n.º 13
0
 def update(self):
     path = self.path()
     os.chdir(path)
     lib.call_and_exit_if_failed('git checkout -q ' + branch)
     lib.call_and_exit_if_failed('git pull -q origin ' + branch)
Exemplo n.º 14
0
 def test_describe_never_tagged_before(self):
     git = Git(root_dir_local, test_repo_dir)
     git.clone()
     lib.call_and_exit_if_failed("git tag -a release/0.1.1 -m 'releasing version'")
     latest_tag = git.describe()
     self.assertEqual(latest_tag, "0.1.1")