Domanda

I have a mercurial repository on Bitbucket that is forked from another repo. I made several commits to my fork and now want to make pull-request to the main repo. But I want to include in pull-request only last 2 commits, not all that I have done as Bitbucket offer. Is it possible to do pull-request through Bitbaket, which includes only those commits that I want?

È stato utile?

Soluzione

On a pull or push, you can specify a revision, but it necessarily comes with all its ancestors that are not on the repo. If you planned it correctly, and the last two commits are the sole constituents of a separate branch, started from the main trunk, yes, only those 2 commits should be pulled. But from your question, I doubt this is the case.

In Bitbucket, it seems to be possible to request a pull on a branch. So my suggestion is to create another branch, started from the main trunk, and replicate your last 2 commits. There are many ways to do that, but the fastest, albeit not recommended in a normal workflow, but considering your current state, is to graft the 2 commits on that new branch.

hg update default
hg branch <new feature branch>
hg graft -r <commit 1>
hg graft -r <commit 2>

Then, request a pull on <new feature branch>.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top