• 
      

    Enabling rbt stamp for Perforce

    Review Request #7153 — Created April 2, 2015 and submitted — Latest diff uploaded

    Information

    RBTools
    master
    1eff637...

    Reviewers

    Enable rbt stamp for Perforce

    Previously, rbt stamp supported only git. I want to use it for perforce too,
    so this change accomplishes that. I've tried to make stamp behave as similarly
    as possible to post, with respect to the way a changelist is specified.

    For perforce, rbt post is able to "update" an existing review without the -u
    flag by trying to post the changelist to a new review. ReviewBoard then returns
    an exception stating that the changelist already has a review, and then rbt
    updates that review instead. To imitate this behavior in rbt stamp, since I
    didn't want to actually have to post a review, I implemented a "guessing
    strategy" that queries ReviewBoard for a review request associated with the
    particular changelist ID. If one is found, that is the review whose URL is
    stamped.

    I would also like to add a stamp option directly into rbt post, so that a
    review can be posted and stamped in one command (this would also eliminate
    ambiguity about which commit the stamp is attached to), but that will come in a
    a separate code review. This would also allow for an additional useful guessing
    strategy, to find the review request ID by searching the commit message for a
    URL.

    Tested manually by posting and stamping many draft reviews with Perforce and Git.