Author Topic: How to divert a Bitbucket pull request to my own test repo?  (Read 3477 times)

Marsu42

  • Contributor
  • Hero Member
  • *****
  • Posts: 1557
  • 66d + flashes
How to divert a Bitbucket pull request to my own test repo?
« on: October 20, 2013, 05:00:28 PM »
How do I add the code from a pull request to the main repo to my own repo fork (for example, if I want to try the adv_int module)?

All I can see is a possibility to get a diff for individual commits, but not for the whole pull request - and I am not able to divert a pull request via fork or compare to my own repo either.

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: How to divert a Bitbucket pull request to my own test repo?
« Reply #1 on: October 21, 2013, 03:33:32 AM »
you can specify a different repo in the hg pull command, simply specify the repo of the pull request, and pull into your local clone (I wouldn't try pulling into your bitbucket repo, so as to leave it 'clean', basically you're only modifying you're local repo clone)

http://www.selenic.com/mercurial/hg.1.html#pull

Marsu42

  • Contributor
  • Hero Member
  • *****
  • Posts: 1557
  • 66d + flashes
Re: How to divert a Bitbucket pull request to my own test repo?
« Reply #2 on: October 24, 2013, 12:23:43 AM »
you can specify a different repo in the hg pull command

Thanks a lot! ... I didn't think of this :-o

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: How to divert a Bitbucket pull request to my own test repo?
« Reply #3 on: October 24, 2013, 01:56:22 AM »
you might want to create a branch and then pull it into the branch so you can switch back more easily

Marsu42

  • Contributor
  • Hero Member
  • *****
  • Posts: 1557
  • 66d + flashes
Re: How to divert a Bitbucket pull request to my own test repo?
« Reply #4 on: October 24, 2013, 09:40:05 AM »
you might want to create a branch and then pull it into the branch so you can switch back more easily

Thanks again, it really works, I didn't know mercurial is clever enough not to overwrite changes I made in my repo, but just updates it with the newer files from the pull request as it's meant to do. 

The only problem I've recently read about (http://mercurial.selenic.com/wiki/PruningDeadBranches) that with mercurial - and unlike git - you cannot delete branches from your repo. eternally. ever. That's why I'm a bit shy with polluting my repo with branches, but I guess I should easy up a little on that :-p