• Get Review Board
  • What's New
  • Products
  • Review Board Code review, image review, and document review
  • Documentation
  • Release Notes
  • Power Pack Enterprise integrations, reports, and enhanced document review
  • Try for 60 Days
  • Purchase
  • RBCommons Review Board as a Service, hosted by us
  • Pricing
  • RBTools Command line tools and Python API for Review Board
  • Documentation
  • Release Notes
  • Review Bot Automated code review, connecting tools you already use
  • Documentation
  • Release Notes
  • RB Gateway Manage Git and Mercurial repositories in your network
  • Documentation
  • Release Notes
  • Learn and Explore
  • What is Code Review?
  • Documentation
  • Frequently Asked Questions
  • Support Options
  • Third-Party Integrations
  • Demo
  • Review Board RBTools Power Pack Review Bot Djblets RB Gateway
    1. RBTools 4.x
    2. Version 5.x
    3. Version 4.x
    4. Version 3.x
    5. Version 2.0
    6. Version 1.0
    7. Version 0.7
    8. Version 0.6
    9. Version 0.5
    10. RBTools Python API
    11. Module and Class References
    12. rbtools.commands.post
  • Home
  • Installing RBTools
  • rbt Command
  • Configuration
  • Authenticating to Review Board
  • Repository Configuration
  • Per-User Configuration
  • Team Foundation Server Configuration
  • Commands
  • alias
  • api-get
  • attach
  • clear-cache
  • close
  • diff
  • install
  • land
  • list-repo-types
  • login
  • logout
  • patch
  • post
  • publish
  • review
  • setup-completion
  • setup-repo
  • stamp
  • status
  • status-update
  • RBTools Workflows
  • Using RBTools With Cliosoft SOS
  • Using RBTools with Git
  • Using RBTools with HCL VersionVault and IBM ClearCase
  • Using RBTools With Perforce
  • RBTools Python API
  • Overview of the Python API Client
  • Tutorial
  • Resource-Specific Functionality
  • Module and Class References
  • rbtools
  • rbtools.deprecation
  • rbtools.api
  • rbtools.api.cache
  • rbtools.api.capabilities
  • rbtools.api.client
  • rbtools.api.decode
  • rbtools.api.decorators
  • rbtools.api.errors
  • rbtools.api.factory
  • rbtools.api.request
  • rbtools.api.resource
  • rbtools.api.transport
  • rbtools.api.transport.sync
  • rbtools.api.utils
  • rbtools.clients
  • rbtools.clients.base
  • rbtools.clients.base.patch
  • rbtools.clients.base.registry
  • rbtools.clients.base.repository
  • rbtools.clients.base.scmclient
  • rbtools.clients.errors
  • rbtools.clients.bazaar
  • rbtools.clients.clearcase
  • rbtools.clients.cvs
  • rbtools.clients.git
  • rbtools.clients.mercurial
  • rbtools.clients.perforce
  • rbtools.clients.plastic
  • rbtools.clients.sos
  • rbtools.clients.svn
  • rbtools.clients.tfs
  • rbtools.diffs
  • rbtools.diffs.tools
  • rbtools.diffs.tools.backends
  • rbtools.diffs.tools.backends.gnu
  • rbtools.diffs.tools.base
  • rbtools.diffs.tools.base.diff_file_result
  • rbtools.diffs.tools.base.diff_tool
  • rbtools.diffs.tools.errors
  • rbtools.diffs.tools.registry
  • rbtools.diffs.writers
  • rbtools.commands
  • rbtools.commands.main
  • rbtools.commands.alias
  • rbtools.commands.api_get
  • rbtools.commands.attach
  • rbtools.commands.clearcache
  • rbtools.commands.close
  • rbtools.commands.diff
  • rbtools.commands.info
  • rbtools.commands.install
  • rbtools.commands.land
  • rbtools.commands.list_repo_types
  • rbtools.commands.login
  • rbtools.commands.logout
  • rbtools.commands.patch
  • rbtools.commands.post
  • rbtools.commands.publish
  • rbtools.commands.review
  • rbtools.commands.setup_completion
  • rbtools.commands.setup_repo
  • rbtools.commands.stamp
  • rbtools.commands.status
  • rbtools.commands.status_update
  • rbtools.hooks
  • rbtools.hooks.common
  • rbtools.hooks.git
  • rbtools.testing
  • rbtools.testing.api
  • rbtools.testing.api.payloads
  • rbtools.testing.api.transport
  • rbtools.testing.commands
  • rbtools.testing.testcase
  • rbtools.testing.transport
  • rbtools.utils
  • rbtools.utils.aliases
  • rbtools.utils.checks
  • rbtools.utils.commands
  • rbtools.utils.console
  • rbtools.utils.diffs
  • rbtools.utils.encoding
  • rbtools.utils.errors
  • rbtools.utils.filesystem
  • rbtools.utils.graphs
  • rbtools.utils.match_score
  • rbtools.utils.process
  • rbtools.utils.repository
  • rbtools.utils.review_request
  • rbtools.utils.source_tree
  • rbtools.utils.testbase
  • rbtools.utils.users
  • Glossary
  • General Index
  • Python Module Index
  • Release Notes
  • This documentation covers RBTools 4.x. You can select a version above or view the latest documentation.

    rbtools.commands.post¶

    Implementation of rbt post.

    Module Attributes

    SquashedDiff(diff, parent_diff, ...)

    A squashed diff that may be the product of one or more revisions.

    DiffHistory

    A series of diffs that each correspond to a single revision.

    Classes

    DiffHistory

    A series of diffs that each correspond to a single revision.

    Post([transport_cls, stdout, stderr, stdin])

    Create and update review requests.

    SquashedDiff(diff, parent_diff, ...)

    A squashed diff that may be the product of one or more revisions.

    class rbtools.commands.post.SquashedDiff(diff, parent_diff, base_commit_id, base_dir, commit_id, changenum, review_request_extra_data)[source]¶

    Bases: tuple

    A squashed diff that may be the product of one or more revisions.

    Changed in version 3.1: Added review_request_extra_data.

    diff[source]¶

    The contents of the diff.

    Type:

    bytes

    parent_diff[source]¶

    The contents of the parent diff.

    Type:

    bytes

    base_commit_id[source]¶

    The ID of the commit that the diff and parent diff are relative to. This is required for SCMs like Mercurial that do not use blob IDs for files.

    Type:

    unicode

    base_dir[source]¶

    The directory that the diff is relative to.

    Type:

    unicode

    commit_id[source]¶

    The ID of the commit the diff corresponds to (if applicable).

    Type:

    unicode

    changenum[source]¶

    For SCMs such as Perforce, this is the change number that the diff corresponds to. This is None for other SCMs.

    Type:

    unicode

    review_request_extra_data[source]¶

    State to store in a review request’s extra_data field.

    New in version 3.1.

    Type:

    dict

    __getnewargs__()[source]¶

    Return self as a plain tuple. Used by copy and pickle.

    __match_args__ = ('diff', 'parent_diff', 'base_commit_id', 'base_dir', 'commit_id', 'changenum', 'review_request_extra_data')[source]¶
    static __new__(_cls, diff, parent_diff, base_commit_id, base_dir, commit_id, changenum, review_request_extra_data)[source]¶

    Create new instance of SquashedDiff(diff, parent_diff, base_commit_id, base_dir, commit_id, changenum, review_request_extra_data)

    __repr__()[source]¶

    Return a nicely formatted representation string

    __slots__ = ()[source]¶
    base_commit_id[source]¶

    Alias for field number 2

    base_dir[source]¶

    Alias for field number 3

    changenum[source]¶

    Alias for field number 5

    commit_id[source]¶

    Alias for field number 4

    diff[source]¶

    Alias for field number 0

    parent_diff[source]¶

    Alias for field number 1

    review_request_extra_data[source]¶

    Alias for field number 6

    rbtools.commands.post.DiffHistory[source]¶

    A series of diffs that each correspond to a single revision.

    Changed in version 3.1: Added review_request_extra_data.

    rbtools.commands.post.entries¶

    A list of the history entries. Each of these is a dict with the following keys:

    commit_id (unicode):

    The unique identifier for the commit. For an SCM like Git, this is a SHA-1 hash.

    parent_id (unicode):

    The unique identifier of the parent commit.

    diff (bytes):

    The contents of the diff.

    commit_message (unicode):

    The message associated with the commit.

    author_name (unicode):

    The name of the author.

    author_email (unicode):

    The e-mail address of the author.

    author_date (unicode):

    The date and time the commit was authored in ISO 8601 format.

    committer_name (unicode):

    The name of the committer (if applicable).

    committer_email (unicode):

    The e-mail address of the committer (if applicable).

    committer_date (unicode):

    The date and time the commit was committed in ISO 8601 format (if applicable).

    Type:

    list of dict

    rbtools.commands.post.parent_diff¶

    The contents of the parent diff.

    Type:

    bytes

    rbtools.commands.post.base_commit_id¶

    The ID of the commit that the diff and parent diff are relative to. This is required for SCMs like Mercurial that do not use blob IDs for files.

    Type:

    unicode

    rbtools.commands.post.validation_info¶

    Validation metadata from the commit validation resource.

    Type:

    list of unicode

    rbtools.commands.post.cumulative_diff¶

    The cumulative diff of the entire history.

    Type:

    bytes

    rbtools.commands.post.review_request_extra_data¶

    State to store in a review request’s extra_data field.

    New in version 3.1.

    Type:

    dict

    class rbtools.commands.post.Post(transport_cls=<class 'rbtools.api.transport.sync.SyncTransport'>, stdout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, stderr=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, stdin=<_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>)[source]¶

    Bases: Command

    Create and update review requests.

    name = 'post'[source]¶

    The name of the command.

    Type:

    unicode

    author = 'The Review Board Project'[source]¶

    The author of the command.

    Type:

    unicode

    description = 'Uploads diffs to create and update review requests.'[source]¶

    A short description of the command, suitable for display in usage text.

    Type:

    unicode

    needs_diffs = True[source]¶

    Whether the command needs to generate diffs.

    If this is set, the initialization of the command will check for the presence of a diff tool compatible with the chosen type of repository.

    This depends on needs_repository and needs_scm_client both being set to True.

    New in version 4.0.

    Type:

    bool

    needs_api = True[source]¶

    Whether the command needs the API client.

    If this is set, the initialization of the command will set api_client and api_root.

    New in version 3.0.

    Type:

    bool

    needs_repository = True[source]¶

    Whether the command needs the remote repository object.

    If this is set, the initialization of the command will set repository.

    New in version 3.0.

    Type:

    bool

    needs_scm_client = True[source]¶

    Whether the command needs the SCM client.

    If this is set, the initialization of the command will set repository_info and tool.

    New in version 3.0.

    Type:

    bool

    reserved_fields = ('description', 'testing-done', 'summary')[source]¶

    Reserved built-in fields that can be set using the --field argument.

    GUESS_AUTO = 'auto'[source]¶
    GUESS_YES = 'yes'[source]¶
    GUESS_NO = 'no'[source]¶
    GUESS_YES_INPUT_VALUES = (True, 'yes', 1, '1')[source]¶
    GUESS_NO_INPUT_VALUES = (False, 'no', 0, '0')[source]¶
    GUESS_CHOICES = ('auto', 'yes', 'no')[source]¶
    args = '[revisions]'[source]¶

    Usage text for what arguments the command takes.

    Arguments for the command are anything passed in other than defined options (for example, revisions passed to rbt post).

    Type:

    unicode

    option_list = [<rbtools.commands.OptionGroup object>, <rbtools.commands.OptionGroup object>, <rbtools.commands.OptionGroup object>, <rbtools.commands.OptionGroup object>, <rbtools.commands.OptionGroup object>, <rbtools.commands.OptionGroup object>, <rbtools.commands.OptionGroup object>, <rbtools.commands.OptionGroup object>, <rbtools.commands.OptionGroup object>, <rbtools.commands.OptionGroup object>][source]¶

    Command-line options for this command.

    Type:

    list of Option or OptionGroup

    post_process_options()[source]¶
    normalize_guess_value(guess, arg_name)[source]¶
    post_request(review_request=None, diff_history=None, squashed_diff=None, submit_as=None)[source]¶

    Create or update a review request, uploading a diff in the process.

    Parameters:
    • review_request (rbtools.api.resources.ReviewRequestResource, optional) –

      The review request to update.

      If not provided, a new review request will be created.

    • diff_history (DiffHistory, optional) –

      The diff history to post for multi-commit review requests.

      Exactly one of diff_history and squashed_diff must be specified.

    • squashed_diff (SquashedDiff, optional) –

      The squashed diff information to upload when uploading a traditional-style review request.

      Exactly one of diff_history and squashed_diff must be specified.

    • submit_as (unicode, optional) – The username to submit the review request as.

    Returns:

    A 2-tuple of:

    • The review request ID.

    • The review request URL.

    Return type:

    tuple

    Raises:

    rbtools.commands.CommandError – An error ocurred while posting the review request.

    check_guess_fields()[source]¶

    Checks and handles field guesses for the review request.

    This will attempt to guess the values for the summary and description fields, based on the contents of the commit message at the provided revisions, if requested by the caller.

    If the backend doesn’t support guessing, or if guessing isn’t requested, or if explicit values were set in the options, nothing will be set for the fields.

    main(*args)[source]¶

    Create and update review requests.

    Parameters:

    *args (tuple) – Command line arguments.

    Raises:

    rbtools.commands.CommandError – An error occurred while posting.

    Keep up with the latest Review Board releases, security updates, and helpful information.

    About
    News
    Demo
    RBCommons Hosting
    Integrations
    Happy Users
    Support Options
    Documentation
    FAQ
    User Manual
    RBTools
    Administration Guide
    Power Pack
    Release Notes
    Downloads
    Review Board
    RBTools
    Djblets
    Power Pack
    Package Store
    PGP Signatures
    Contributing
    Bug Tracker
    Submit Patches
    Development Setup
    Wiki
    Follow Us
    Mailing Lists
    Reddit
    Twitter
    Mastodon
    Facebook
    YouTube

    Copyright © 2006-2025 Beanbag, Inc. All rights reserved.

    Terms of Service — Privacy Policy — AI Ethics Policy — Branding

    On this page

    • [Top]