def _push_status(gitContext, review_branch, working_branch, status):
    clone = gitContext.clone
    remote = gitContext.remote

    old_branch = working_branch.branch

    working_branch = abdt_gittypes.makeWorkingBranchWithStatus(
        working_branch, status)

    new_branch = working_branch.branch
    if old_branch == new_branch:
        phlgit_push.push_asymmetrical_force(
            clone,
            review_branch.remote_branch,
            phlgitu_ref.make_local(new_branch),
            remote)
    else:
        phlgit_push.move_asymmetrical(
            clone,
            review_branch.remote_branch,
            phlgitu_ref.make_local(old_branch),
            phlgitu_ref.make_local(new_branch),
            remote)

    return working_branch
def _push_new_status_branch(gitContext, review_branch, status, revision_id):
    clone = gitContext.clone
    remote = gitContext.remote

    if revision_id is None:
        revision_id = "none"
    else:
        revision_id = str(revision_id)

    working_branch_name = abdt_naming.makeWorkingBranchName(
        status,
        review_branch.description,
        review_branch.base,
        revision_id)

    working_branch = abdt_naming.makeWorkingBranchFromName(
        working_branch_name)

    working_branch = abdt_gittypes.makeGitWorkingBranch(
        working_branch, gitContext.remote)

    phlgit_push.push_asymmetrical_force(
        clone,
        phlgitu_ref.make_remote(review_branch.branch, remote),
        phlgitu_ref.make_local(working_branch_name),
        remote)

    return working_branch
def pushBadPreReview(gitContext, review_branch):
    working_branch_name = abdt_naming.makeWorkingBranchName(
        abdt_naming.WB_STATUS_BAD_PREREVIEW,
        review_branch.description, review_branch.base, "none")
    phlgit_push.push_asymmetrical(
        gitContext.clone,
        phlgitu_ref.make_remote(
            review_branch.branch, gitContext.remote),
        phlgitu_ref.make_local(working_branch_name),
        gitContext.remote)
Exemple #4
0
    def _push_new(self, status, revision_id):
        tracking_branch = self._review_branch.make_tracker(status, revision_id)

        phlgit_push.push_asymmetrical_force(
            self._repo, self._review_branch.remote_branch,
            phlgitu_ref.make_local(tracking_branch.branch),
            tracking_branch.remote)

        self._tracking_branch = tracking_branch
        self._tracking_hash = self._review_hash
Exemple #5
0
    def _push_status(self, status):
        old_branch = self._tracking_branch.branch

        self._tracking_branch.update_status(status)

        new_branch = self._tracking_branch.branch
        if old_branch == new_branch:
            phlgit_push.push_asymmetrical_force(
                self._repo, self._review_branch.remote_branch,
                phlgitu_ref.make_local(new_branch),
                self._tracking_branch.remote)
        else:
            phlgit_push.move_asymmetrical(self._repo,
                                          self._review_branch.remote_branch,
                                          phlgitu_ref.make_local(old_branch),
                                          phlgitu_ref.make_local(new_branch),
                                          self._repo.get_remote())

        self._tracking_hash = self._review_hash
    def _push_new(self, status, revision_id):
        tracking_branch = self._review_branch.make_tracker(
            status, revision_id)

        phlgit_push.push_asymmetrical_force(
            self._repo,
            self._review_branch.remote_branch,
            phlgitu_ref.make_local(tracking_branch.branch),
            tracking_branch.remote)

        self._tracking_branch = tracking_branch
        self._tracking_hash = self._review_hash
    def _push_status(self, status):
        old_branch = self._tracking_branch.branch

        self._tracking_branch.update_status(status)

        new_branch = self._tracking_branch.branch
        if old_branch == new_branch:
            phlgit_push.push_asymmetrical_force(
                self._repo,
                self._review_branch.remote_branch,
                phlgitu_ref.make_local(new_branch),
                self._tracking_branch.remote)
        else:
            phlgit_push.move_asymmetrical(
                self._repo,
                self._review_branch.remote_branch,
                phlgitu_ref.make_local(old_branch),
                phlgitu_ref.make_local(new_branch),
                self._repo.get_remote())

        self._tracking_hash = self._review_hash