コード例 #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")
コード例 #2
0
ファイル: git.py プロジェクト: RawToast/release
 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)
コード例 #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)
コード例 #4
0
ファイル: git.py プロジェクト: RawToast/release
 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')
コード例 #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')
コード例 #6
0
ファイル: test_git.py プロジェクト: RawToast/release
 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)
コード例 #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)
コード例 #8
0
ファイル: test_git.py プロジェクト: RawToast/release
 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"')
コード例 #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"')
コード例 #10
0
ファイル: git.py プロジェクト: RawToast/release
 def latest_commit_id(self):
     query = lib.call_and_exit_if_failed('git log -1 --pretty="%H"')
     return query.stdout.read().strip()
コード例 #11
0
ファイル: git.py プロジェクト: RawToast/release
 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)
コード例 #12
0
 def latest_commit_id(self):
     query = lib.call_and_exit_if_failed('git log -1 --pretty="%H"')
     return query.stdout.read().strip()
コード例 #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)
コード例 #14
0
ファイル: test_git.py プロジェクト: RawToast/release
 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")