Example #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)
Example #2
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)
Example #3
0
    def end_release(self, args):
        version = args.version
        repo = self.repo
        master = "master"
        debian_master = "debian"
        upstream = "develop"
        debian = "debian-develop"
        upstream_branch = self.get_branch("release", version)
        debian_branch = self.get_debian_branch("release", version)
        tag = upstream_branch
        debian_tag = "debian/" + tag

        edit_action = partial(self.edit_changelog, upstream_branch, "develop")
        self.check_edit_changelog(edit_action, args, default=True)

        vcs = utils.get_vcs_info()
        release_version = versioning.get_base_version(vcs)
        if re.match('.*'+RC_RE, release_version):
            new_version = re.sub(RC_RE, '', release_version)
            versioning._bump_version(new_version, vcs)

        #merge to master
        self._merge_branches(master, upstream_branch)
        self._merge_branches(debian_master, debian_branch)

        #create tags
        repo.git.checkout(master)
        repo.git.tag("%s" % tag)
        repo.git.checkout(debian)
        repo.git.tag("%s" % debian_tag)

        #merge release changes to upstream
        self.merge_branches(upstream, upstream_branch, args, default=True)
        self.merge_branches(debian, debian_branch, args, default=True)

        repo.git.checkout(upstream)

        branches = [upstream_branch, debian_branch]
        self.cleanup_branches(branches, args, default=True)