Esempio n. 1
0
    def start_hotfix(self, args):
        repo = self.repo
        upstream = "master"
        debian = "debian"
        repo.git.checkout(upstream)
        #maybe provide major.minor version, find the latest release/hotfix and
        #branch from there ?

        vcs = utils.get_vcs_info()
        version = versioning.get_base_version(vcs)
        if not args.version:
            version = get_hotfix_version(version)
            if not args.defaults:
                version = query_user("Hotfix version", default=version)
        else:
            #validate version?
            pass

        rc_version = "%src1" % version
        new_develop_version = "%snext" % version

        upstream_branch = self.get_branch("hotfix", version)
        debian_branch = self.get_debian_branch("hotfix", version)

        #create hotfix branch
        repo.git.branch(upstream_branch, upstream)
        self.new_branches.append(upstream_branch)
        repo.git.checkout(upstream_branch)
        versioning.bump_version(rc_version)

        #create debian hotfix branch
        repo.git.checkout(debian)
        repo.git.branch(debian_branch, debian)
        self.new_branches.append(debian_branch)

        repo.git.checkout(upstream_branch)
        repo.git.checkout(debian)

        #bump develop version. Ask first or verify we have the same
        #major.minornext?
        #repo.git.checkout(upstream)
        #versioning.bump_version(new_develop_version)

        repo.git.checkout(upstream_branch)
Esempio n. 2
0
 def start_common(self, mode, version):
     if mode not in ["release", "hotfix"]:
         raise ValueError("Unknown mode: %s" % mode)
     repo = self.repo
     upstream = "develop" if mode == "release" else "master"
     debian = "debian-develop" if mode == "release" else "debian"
     upstream_branch = "%s-%s" % (mode, version)
     debian_branch = "debian-%s-%s" % (mode, version)
     repo.git.checkout(upstream)
     repo.git.branch(upstream_branch, upstream)
     self.new_branches.append(upstream_branch)
     versioning.bump_version("%snext" % version)
     repo.git.checkout(upstream_branch)
     versioning.bump_version("%src1" % version)
     repo.git.checkout(debian)
     repo.git.branch(debian_branch, debian)
     self.new_branches.append(debian_branch)
     repo.git.checkout(upstream_branch)
     repo.git.checkout(debian)
Esempio n. 3
0
    def start_release(self, args):
        repo = self.repo
        upstream = "develop"
        debian = "debian-develop"
        repo.git.checkout(upstream)

        vcs = utils.get_vcs_info()
        develop_version = versioning.get_base_version(vcs)
        if not args.version:
            version = get_release_version(develop_version)
            if not args.defaults:
                version = query_user("Release version", default=version)
        else:
            #validate version?
            pass
        rc_version = "%src1" % version
        new_develop_version = "%snext" % version

        upstream_branch = self.get_branch("release", version)
        debian_branch = self.get_debian_branch("release", version)

        #create release branch
        repo.git.branch(upstream_branch, upstream)
        self.new_branches.append(upstream_branch)
        repo.git.checkout(upstream_branch)
        versioning.bump_version(rc_version)

        #create debian release branch
        repo.git.checkout(debian)
        repo.git.branch(debian_branch, debian)
        self.new_branches.append(debian_branch)

        repo.git.checkout(upstream_branch)
        repo.git.checkout(debian)

        #bump develop version
        repo.git.checkout(upstream)
        versioning.bump_version(new_develop_version)

        repo.git.checkout(upstream_branch)