コード例 #1
0
 def test_initial_tag_keep_version(self):
     # Tags were actually created in setup code:
     for pkg_name in TEST_PKGS:
         self.assertTrue(tag_exists_locally("%s-0.0.1-1" % pkg_name))
         self.assertTrue(
             os.path.exists(
                 os.path.join(self.repo_dir, "rel-eng/packages", pkg_name)))
コード例 #2
0
    def test_undo_tag(self):
        os.chdir(self.repo_dir)
        original_head = getoutput('git show-ref -s refs/heads/master')

        # Create tito tag, which adds a new commit and moves head.
        tito("tag --accept-auto-changelog --debug")
        tag = "%s-0.0.2-1" % PKG_NAME
        check_tag_exists(tag, offline=True)
        new_head = getoutput('git show-ref -s refs/heads/master')
        self.assertNotEqual(original_head, new_head)

        # Undo tito tag, which rewinds one commit to original head.
        tito("tag -u")
        self.assertFalse(tag_exists_locally(tag))
        new_head = getoutput('git show-ref -s refs/heads/master')
        self.assertEqual(original_head, new_head)
コード例 #3
0
    def _undo(self):
        """
        Undo the most recent tag.

        Tag commit must be the most recent commit, and the tag must not
        exist in the remote git repo, otherwise we report and error out.
        """
        tag = self._get_tag_for_version(get_latest_tagged_version(self.project_name))
        info_out("Undoing tag: %s" % tag)
        if not tag_exists_locally(tag):
            raise TitoException(
                "Cannot undo tag that does not exist locally.")
        if not self.offline and tag_exists_remotely(tag):
            raise TitoException("Cannot undo tag that has been pushed.")

        # Tag must be the most recent commit.
        if not head_points_to_tag(tag):
            raise TitoException("Cannot undo if tag is not the most recent commit.")

        # Everything looks good:
        print
        undo_tag(tag)
コード例 #4
0
ファイル: __init__.py プロジェクト: chmouel/origin
    def _undo(self):
        """
        Undo the most recent tag.

        Tag commit must be the most recent commit, and the tag must not
        exist in the remote git repo, otherwise we report and error out.
        """
        tag = "v{0}".format(get_latest_tagged_version(self.project_name))
        print("Undoing tag: {0}".format(tag))
        if not tag_exists_locally(tag):
            raise TitoException(
                "Cannot undo tag that does not exist locally.")
        if not self.offline and tag_exists_remotely(tag):
            raise TitoException("Cannot undo tag that has been pushed.")

        # Tag must be the most recent commit.
        if not head_points_to_tag(tag):
            raise TitoException("Cannot undo if tag is not the most recent commit.")

        # Everything looks good:
        print
        undo_tag(tag)
コード例 #5
0
ファイル: multiproject_tests.py プロジェクト: Conan-Kudo/tito
 def test_initial_tag_keep_version(self):
     # Tags were actually created in setup code:
     for pkg_name in TEST_PKGS:
         self.assertTrue(tag_exists_locally("%s-0.0.1-1" % pkg_name))
         self.assertTrue(os.path.exists(os.path.join(self.repo_dir,
             ".tito/packages", pkg_name)))
コード例 #6
0
 def test_initial_tag(self):
     self.assertTrue(tag_exists_locally("%s-0.0.1-1" % PKG_NAME))