Did I find the right examples for you? yes no

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
Updates the Rietveld metadata for a branch from the issue metadata.

Args:
    current_branch: String; containing the name of a branch. Defaults to
        None, in which case Rietveld.from_branch uses get_current_branch.
    rietveld_info: RietveldInfo object containing metadata associated with
        the current branch. Defaults to None and here will be replaced by
        info for current branch.

Returns:(more...)

        def update_rietveld_metadata_from_issue(current_branch=None,
                                        rietveld_info=None):
    """Updates the Rietveld metadata for a branch from the issue metadata.

    Args:
        current_branch: String; containing the name of a branch. Defaults to
            None, in which case Rietveld.from_branch uses get_current_branch.
        rietveld_info: RietveldInfo object containing metadata associated with
            the current branch. Defaults to None and here will be replaced by
            info for current branch.

    Returns:
        A tuple containing a boolean indicating success or failure of the update
            and the RietveldInfo object associated with the current branch.
    """
    rietveld_info = rietveld_info or RietveldInfo.from_branch(
            branch_name=current_branch)
    if rietveld_info is None:
        return (False, None)

    server = rietveld_info.server
    review_info = rietveld_info.review_info
    if server is None or review_info is None:
        return (False, rietveld_info)

    issue = review_info.issue
    issue_metadata = get_issue_metadata(issue=issue, server=server)

    success = False
    if (REVIEWERS in issue_metadata and CC in issue_metadata and
        SUBJECT in issue_metadata):
        rietveld_info.reviewers = issue_metadata[REVIEWERS]
        rietveld_info.cc = issue_metadata[CC]
        review_info.subject = issue_metadata[SUBJECT]
        if ISSUE_DESCRIPTION in issue_metadata:
            if issue_metadata[ISSUE_DESCRIPTION] != review_info.subject:
                review_info.description = issue_metadata[ISSUE_DESCRIPTION]
            else:
                review_info.description = ''
        rietveld_info.save()
        success = True

    return (success, rietveld_info)
        


src/g/i/git-rv-HEAD/getinfo.py   git-rv(Download)
        """
        success, rietveld_info = utils.update_rietveld_metadata_from_issue(
                current_branch=self.__branch, rietveld_info=rietveld_info)
        if success:
            print 'Metadata update from code server succeeded.'

src/g/i/git-rv-HEAD/submit.py   git-rv(Download)
        """
        success, rietveld_info = utils.update_rietveld_metadata_from_issue(
                rietveld_info=self.__rietveld_info)
        if success:
            # TODO(dhermes): This assumes rietveld_info.review_info is not None.

src/g/i/git-rv-HEAD/export.py   git-rv(Download)
 
        success, _ = utils.update_rietveld_metadata_from_issue(
                rietveld_info=self.__rietveld_info)
        if success:
            print 'Metadata update from code server succeeded.'