1. Bitbucket
  2. Public Issue Tracker
  3. master
  4. Issues


Issue #5737 resolved

Cannot update pull request with replaced commit in hg (BB-7006)

Christian Walther
created an issue

When I make a pull request, an issue is found with it that I need to fix before it can be merged, and I fix the issue by amending a commit of the pull request (rather than adding another commit on top), then I am unable to update the pull request to include the new commit.

Steps to reproduce:

  1. Create repository “prupdate” on Bitbucket
  2. Populate it:

    ~$ hg init prupdate
    ~$ cd prupdate
    ~/prupdate$ echo "Hello" > hello.txt
    ~/prupdate$ hg add hello.txt
    ~/prupdate$ hg ci -m "Initial"
    ~/prupdate$ hg push https://cwalther@bitbucket.org/cwalther/prupdate
  3. Fork prupdate as “prupdatefork” on Bitbucket

  4. Create a flawed feature branch:

    ~/prupdate$ echo "Hello Wold" > hello.txt
    ~/prupdate$ hg branch feature
    ~/prupdate$ hg ci -m "Greet the world"
    ~/prupdate$ hg push --new-branch -r 1 https://cwalther@bitbucket.org/cwalther/prupdatefork
  5. Create a pull request asking to merge prupdatefork:feature into prupdate:default

  6. Fix the typo discovered in the pull request review by creating an amended version of the flawed commit:

    ~/prupdate$ hg up 0
    ~/prupdate$ echo "Hello World" > hello.txt
    ~/prupdate$ hg branch --force feature
    ~/prupdate$ hg ci -m "Greet the world"
    ~/prupdate$ hg push --force -r 2 https://cwalther@bitbucket.org/cwalther/prupdatefork
  7. Strip the replaced revision 1 from Bitbucket

  8. Attempt to edit the pull request to switch it from the flawed to the fixed revision

Expected result:

There should be an “Edit” button on the pull request page.

Actual result:

There is no “Edit” button, the pull request cannot be updated.

Second try:

1. – 6. as above

7. Do not strip the superseded revision, but leave it on Bitbucket (branch “feature” has two heads now)

8. Push the “Edit” button on the pull request page (which is still there this time, good)

9. Open the source branch popup to attempt to switch from the flawed to the fixed head

Expected result:

There should be two entries for the two heads of branch “feature” in the popup.

Actual result:

There is only one “feature” entry, and it seems to still refer to the old head, as when I choose it and save the pull request, nothing happens.

Comments (5)

  1. Log in to comment