How to issue multiple PR's on BitBucket?
Hey devs, I apologize in advance for my naivety... I asked this in IRC, and Kacper was kind enough to provide some insight, but alas I was still having problems getting this to work. I know it involves bookmarks and heads, but I'm still not as familiar with mercurial as I am with git, so this all confuses my gitsense. Also, I know there are others who have this issue - perhaps this should be on the docs page somewhere... Let's say I have my fork of yt wherein I already have a pending PR on BB. I can't simply make changes to my fork and push them in the default branch/bookmark because BB likes to automagically update PRs. What is the recommended procedure for committing and pushing new changes to my fork so that I can issue an additional PR? Do I create a bookmark, then commit my changes, then push that bookmark to BB? If so, how then can I issue a PR from that bookmark - I can't seem to find this on the BB interface. Chris
On Thu, Sep 11, 2014 at 10:14 AM, Chris Malone <chris.m.malone@gmail.com> wrote:
Hey devs,
I apologize in advance for my naivety...
I asked this in IRC, and Kacper was kind enough to provide some insight, but alas I was still having problems getting this to work. I know it involves bookmarks and heads, but I'm still not as familiar with mercurial as I am with git, so this all confuses my gitsense. Also, I know there are others who have this issue - perhaps this should be on the docs page somewhere...
Bookmarks are actually unnecessary.
Let's say I have my fork of yt wherein I already have a pending PR on BB. I can't simply make changes to my fork and push them in the default branch/bookmark because BB likes to automagically update PRs.
What is the recommended procedure for committing and pushing new changes to my fork so that I can issue an additional PR? Do I create a bookmark, then commit my changes, then push that bookmark to BB? If so, how then can I issue a PR from that bookmark - I can't seem to find this on the BB interface.
Maybe this is a little awkward because it requires me to look at the current state of the yt_analysis/yt repo, but it works for me. First, I take a look at this page: https://bitbucket.org/yt_analysis/yt/commits/branch/yt You want to update to the current tip of the yt branch (right now, this is the commit f663cb9): hg pull https://bitbucket.org/yt_analysis/yt hg up f663cb9 This will update away from your current PR head. Next, you need to do some work, fix a bug, whatever, and then commit it: <do work> hg commit -m "I did some work" This will create a new local head. Next, you push the new head to bitbucket: hg push -r . -f https://bitbucket.org/my_username/yt "push -r ." means "push only the commit I'm standing on and any ancestors". I needed to force push since I'm creating a new remote head. Now you can create your PR on the bitbucket interface. Bookmarks come in at the point where you create the new head. Instead of just <do work>, I could have created a new bookmark: hg bookmark mybookmark <do work> hg commit -m "I did some work" push push -B mybookmark -f https://bitbucket.org/my_username/yt The bookmark just names the commit head. I tend not to use bookmarks for one-commit bugfixes but they're definitely useful for longer lived work. Hope that's made things clearer, Nathan
Chris
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
On Thu, Sep 11, 2014 at 12:25 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Thu, Sep 11, 2014 at 10:14 AM, Chris Malone <chris.m.malone@gmail.com> wrote:
Hey devs,
I apologize in advance for my naivety...
I asked this in IRC, and Kacper was kind enough to provide some insight, but alas I was still having problems getting this to work. I know it involves bookmarks and heads, but I'm still not as familiar with mercurial as I am with git, so this all confuses my gitsense. Also, I know there are others who have this issue - perhaps this should be on the docs page somewhere...
Bookmarks are actually unnecessary.
Let's say I have my fork of yt wherein I already have a pending PR on BB. I can't simply make changes to my fork and push them in the default branch/bookmark because BB likes to automagically update PRs.
What is the recommended procedure for committing and pushing new changes to my fork so that I can issue an additional PR? Do I create a bookmark, then commit my changes, then push that bookmark to BB? If so, how then can I issue a PR from that bookmark - I can't seem to find this on the BB interface.
Maybe this is a little awkward because it requires me to look at the current state of the yt_analysis/yt repo, but it works for me.
First, I take a look at this page: https://bitbucket.org/yt_analysis/yt/commits/branch/yt
You want to update to the current tip of the yt branch (right now, this is the commit f663cb9):
This can be done with shorthand: hg pull hg up -r "remote(tip)" I have the main yt repo aliased to "ytanalysis" so I do: hg pull ytanalysis hg up -r "remote(tip, ytanalysis)" [commit, etc]
hg pull https://bitbucket.org/yt_analysis/yt hg up f663cb9
This will update away from your current PR head.
Next, you need to do some work, fix a bug, whatever, and then commit it:
<do work> hg commit -m "I did some work"
This will create a new local head. Next, you push the new head to bitbucket:
hg push -r . -f https://bitbucket.org/my_username/yt
"push -r ." means "push only the commit I'm standing on and any ancestors". I needed to force push since I'm creating a new remote head.
Now you can create your PR on the bitbucket interface.
Bookmarks come in at the point where you create the new head. Instead of just <do work>, I could have created a new bookmark:
hg bookmark mybookmark <do work> hg commit -m "I did some work" push push -B mybookmark -f https://bitbucket.org/my_username/yt
The bookmark just names the commit head. I tend not to use bookmarks for one-commit bugfixes but they're definitely useful for longer lived work.
Hope that's made things clearer,
Nathan
Chris
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
Hi Chris, Here's what I do, which is very similar to what Nathan outlined. I use a combination of aliases and the remotebranches extension. The remotebranches extension mocks up the namespace of "ALIAS/BRANCH" for the tip of any given branch on a given aliased repository. (My example that I gave in the earlier email was for when I'm not using RB.) So let's say I've got a bunch of stuff going on, but I identify an isolated bug. If I have not yet committed the fix, I do: hg pull ytanalysis hg up -r "ytanalysis/yt" [fix bug] hg commit hg nudge (I have aliased "nudge" to "push -r .") Then I issue a pull request. If I'm expecting it to take a long time, I can also bookmark it at that point, which makes it easier to remember which is which. Other things that are useful are the shelve command, which will pull all uncommitted changes into a spot that they can be unshelved from. This is what I do if I find a bug and have to fix it. Usually I'll do "hg record" to interactively commit everything but the bug, then shelve it, then update to the remote tip, unshelve, issue PR. Mind you, some of this relies on things still being "draft" changesets. This means they haven't been pushed to a "publishing" repository, which by default on BB I think repos are. The fluidity that comes with history rewriting using obsolete changesets in hg is not yet accessible on BB, but I think it will be some day, and it will make this whole process considerably easier. The repo history will still be append-only, but that append-only will include an obsolesence indicator that shows which changesets have been supplanted. This is "safe" history rewriting. I'm considering spinning up some Kallithea instances for review of PRs that are likely to undergo lots of history rewriting, as a supplement (but not replacement for) bitbucket, as Kallithea already supports obsolete marker exchange. Anyway, does that help at all? -Matt On Thu, Sep 11, 2014 at 12:14 PM, Chris Malone <chris.m.malone@gmail.com> wrote:
Hey devs,
I apologize in advance for my naivety...
I asked this in IRC, and Kacper was kind enough to provide some insight, but alas I was still having problems getting this to work. I know it involves bookmarks and heads, but I'm still not as familiar with mercurial as I am with git, so this all confuses my gitsense. Also, I know there are others who have this issue - perhaps this should be on the docs page somewhere...
Let's say I have my fork of yt wherein I already have a pending PR on BB. I can't simply make changes to my fork and push them in the default branch/bookmark because BB likes to automagically update PRs.
What is the recommended procedure for committing and pushing new changes to my fork so that I can issue an additional PR? Do I create a bookmark, then commit my changes, then push that bookmark to BB? If so, how then can I issue a PR from that bookmark - I can't seem to find this on the BB interface.
Chris
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
A lot of good information here - thanks Matt and Nathan. I'll play with the two approaches to see which better fits my workflow. I imagine others will be benefited from this discussion as well, and it might be worth adding a note in the docs. I'll add that to my todo list. Chris On Thu, Sep 11, 2014 at 11:47 AM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Chris,
Here's what I do, which is very similar to what Nathan outlined. I use a combination of aliases and the remotebranches extension. The remotebranches extension mocks up the namespace of "ALIAS/BRANCH" for the tip of any given branch on a given aliased repository. (My example that I gave in the earlier email was for when I'm not using RB.)
So let's say I've got a bunch of stuff going on, but I identify an isolated bug. If I have not yet committed the fix, I do:
hg pull ytanalysis hg up -r "ytanalysis/yt" [fix bug] hg commit hg nudge
(I have aliased "nudge" to "push -r .")
Then I issue a pull request. If I'm expecting it to take a long time, I can also bookmark it at that point, which makes it easier to remember which is which.
Other things that are useful are the shelve command, which will pull all uncommitted changes into a spot that they can be unshelved from. This is what I do if I find a bug and have to fix it. Usually I'll do "hg record" to interactively commit everything but the bug, then shelve it, then update to the remote tip, unshelve, issue PR.
Mind you, some of this relies on things still being "draft" changesets. This means they haven't been pushed to a "publishing" repository, which by default on BB I think repos are. The fluidity that comes with history rewriting using obsolete changesets in hg is not yet accessible on BB, but I think it will be some day, and it will make this whole process considerably easier. The repo history will still be append-only, but that append-only will include an obsolesence indicator that shows which changesets have been supplanted. This is "safe" history rewriting. I'm considering spinning up some Kallithea instances for review of PRs that are likely to undergo lots of history rewriting, as a supplement (but not replacement for) bitbucket, as Kallithea already supports obsolete marker exchange.
Anyway, does that help at all?
-Matt
Hey devs,
I apologize in advance for my naivety...
I asked this in IRC, and Kacper was kind enough to provide some insight, but alas I was still having problems getting this to work. I know it involves bookmarks and heads, but I'm still not as familiar with mercurial as I am with git, so this all confuses my gitsense. Also, I know there are others who have this issue - perhaps this should be on the docs page somewhere...
Let's say I have my fork of yt wherein I already have a pending PR on BB. I can't simply make changes to my fork and push them in the default branch/bookmark because BB likes to automagically update PRs.
What is the recommended procedure for committing and pushing new changes to my fork so that I can issue an additional PR? Do I create a bookmark,
On Thu, Sep 11, 2014 at 12:14 PM, Chris Malone <chris.m.malone@gmail.com> wrote: then
commit my changes, then push that bookmark to BB? If so, how then can I issue a PR from that bookmark - I can't seem to find this on the BB interface.
Chris
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
participants (3)
-
Chris Malone
-
Matthew Turk
-
Nathan Goldbaum