• 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 Workflows
    11. Using RBTools With Perforce
  • 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.

    Using RBTools With Perforce¶

    This guide covers how you can use RBTools to post changes to Perforce.

    A typical workflow looks like this:

    1. Create a changeset for each review request

    2. Post your change for review

    3. Make changes based on feedback and re-post for review

    4. Submit your change to the depot

    5. Close your review request

    We’ll go over these concepts and then show you an example session.

    Before you begin¶

    This guide assumes the following are already set up:

    • An administrator has configured a Perforce repository in Review Board.

    • A .reviewboardrc file has been created and placed in your checkout location.

    • RBTools is installed and the p4 command line tool is in your system path.

    Step 1: Create your change¶

    Create your change using p4 change and open/add/delete any files you want included in the review request:

    $ p4 change
    $ p4 open -c <changenum> <filename>
    $ vim <filename>
    $ p4 add -c <changenum> <filename>
    $ ...
    

    Changes can optionally be associated with a stream.

    You’ll want to populate the changeset with a summary and description. These will be used to populate the review request’s own summary and description.

    Step 2: Post your change for review¶

    Once you have a change with modifications to the depot, and you’re ready to post it for review, you can run post and include the change number:

    $ rbt post <changenum>
    

    For example:

    $ rbt post 10291
    Review request #123 posted.
    
    https://reviewboard.example.com/r/123/
    https://reviewboard.example.com/r/123/diff/
    

    You can use the -o option to automatically open this review request in your web browser for editing.

    The posted review request will be populated with your changeset’s summary and description. If you have default reviewers set up, they’ll be assigned.

    Once you’re done filling out fields on the review request, click Publish to send it out for review.

    Step 3: Update from reviewer feedback and re-post¶

    Got some reviewer feedback to incorporate into your change? Easy.

    1. Update the files in your change, and/or the information in your changeset.

    2. Re-run rbt post to update your review request.

      This will update the same review request already associated with your change number, and will also update the review request details (such as the summary and description) from the changeset description.

    3. Update any information on the review request, if you want to.

      We recommend describing the changes you’ve made, so reviewers know what to look for. The field for this is on the green draft banner.

    4. Publish the new changes for review.

    Step 4: Submit your change to Perforce¶

    Once you’ve received approval to land the change, it’s time to submit your change. You’ll do this using the standard p4 submit:

    $ p4 submit -c <changenum>
    

    Step 5: Close your review request¶

    Now that your change is in, it’s time to close your review request.

    This might happen automatically, if your server and repositories are set up to auto-close review requests when changes are pushed.

    This can be configured in Perforce using a custom Perforce change-submit trigger script.

    If you’re not set up this way, no problem. You have two options:

    1. Navigate to the review request and close it.

      In Review Board 6 and newer, click Close -> Completed.

      In Review Board 5 and older, click Close -> Submitted.

    2. Run rbt close <review request ID> (see the documentation).

    Putting it all together¶

    Let’s walk through an example.

    1. We’ll create a new change and make some modifications:

      $ p4 change
      <edit the changeset:>
      ...
      
      Description:
          Add a change to do something great.
      
          Let me spend a lot of time explaining what this change is doing
          so that reviewers can fully understand it.
      
      <save the changeset...>
      
      Change 105 created.
      
      $ p4 add -c 105 art/spritesheet.png
      $ p4 open -c 105 src/engine/collision.cs
      $ vim src/engine/collision.cs
      $ p4 delete -c 105 docs/proposed-spec.txt
      $ p4 move -c 105 src/utils.cs src/common/utils.cs
      
    2. We’ll now post change #105 for review:

      $ rbt post 105
      Review request #1001 posted.
      
      https://reviewboard.example.com/r/1001/
      https://reviewboard.example.com/r/1001/diff/
      

      That review request will be populated with your changeset’s summary and description.

    3. Let’s create a second review request, covering a couple more changes.

      We’ll take the opportunity to mark these as dependent on our new review request #1001:

      $ p4 change
      ...
      Change 106 created.
      
      $ p4 add -c 106 art/character-model.png
      $ rbt post --depends-on 1001 106
      Review request #1002 posted.
      
      https://reviewboard.example.com/r/1002/
      https://reviewboard.example.com/r/1002/diff/
      
    4. Meanwhile, we got some feedback on change #105/review request #1001, so let’s update our changes.

      $ vim src/engine/collision.cs
      $ rbt post 105
      Review request #1001 posted.
      
      https://reviewboard.example.com/r/1001/
      https://reviewboard.example.com/r/1001/diff/
      

      Go to the review request, describe the changes you made, and publish the new changes.

      Tip

      You can update, describe the changes (-m), and publish (-p), all in the same step:

      $ rbt post -p -m "Fixed a broken link." 105
      
    5. Hey, we got a Ship It! for both review requests! Great, let’s submit these and close out the review requests.

      $ p4 submit -c 105
      $ p4 submit -c 106
      $ rbt close 1001
      $ rbt close 1002
      

      rbt close isn’t necessary if using a Perforce change-submit trigger script for the repository!

      If a script is installed, the changes will be checked for approval before they can be submitted, and the review requests will be closed automatically:

      $ p4 submit -c 105
      $ p4 submit -c 106
      

    You’ll get the hang of this process in no time. Soon you’ll be well on your way to better code quality.

    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]
    • Before you begin
    • Step 1: Create your change
    • Step 2: Post your change for review
    • Step 3: Update from reviewer feedback and re-post
    • Step 4: Submit your change to Perforce
    • Step 5: Close your review request
    • Putting it all together