command for pull requests

Issue #3 resolved
Former user created an issue

i'd be extremely useful if we could:

$ bitbucket pull-request owner/repo

i'm not very familiar with the bitbucket (rest) api, but i may take a stab at if if you're interested

Comments (15)

  1. Colin Powell

    Hey folks, turns out pull requests only exist in V2 of the API. I added a pull request which gives us a pull_request command, but it's not very robust right not.

    Add to this that the API docs are either out of date or there's a bug in the API, but my properly formated data dict for the API is being rejected.

    TL;DR, every thing is in pull request #11 to make this work, but Atlassian needs to get back to me as to why their API is rejecting the requests.

  2. Colin Powell

    Well ... Bb got back to me and it turns out the APIv2 requires a content-type header, which because I based my command of the others, was missing.

    So now with a content-type header in there, it's at least giving me a proper response. But now it just responds with 400s. So I'll debug that hopefully update the pull request in the next day or two with a command that works, woot!

  3. com4 NA

    I've opened pull request #14 for this issue.

    For those watching who don't want to wait:

    git clone git@bitbucket.org:zhemao/bitbucket-cli.git
    cd bitbucket-cli
    git remote add com4 git@bitbucket.org:com4/bitbucket-cli.git
    git fetch com4
    git checkout -t com4/feature/add-pull-requests
    sudo rm /usr/local/bin/bb /usr/bin/bb  # Remove the old link.
    sudo ln -s `pwd`/_bbcli /usr/local/bin/bb
    

    Then when it's included in the mainline, you can just remove the symlink and repository and pip install -U bitbucket-cli.

  4. Dylan Sale

    FYI its easier to install this version using pip install git+https://bitbucket.org/com4/bitbucket-cli.git@feature/add-pull-requests

  5. Log in to comment