lpappone
lpappone

Reputation: 2755

Phabricator arc land won't work because that there are multiple revisions on feature branch

I have two branches, started at different points. They are mostly the same, except for a few extra commits on one of them. When I try to land that one, I get:

Usage Exception: There are multiple revisions on feature branch 'newbranch' which are not present on 'devel': -D newbranch1 -D othernew branch

Separate these revisions onto different branchs, or use --revision ' to use the commit message from and land them all.

I can't find any guidance as to how to separate the revisions onto different branches, or what that even means. Is there any way around this?

Upvotes: 33

Views: 29197

Answers (4)

dangerismycat
dangerismycat

Reputation: 854

No idea if this will be helpful for you, but I had a similar situation where a branch was associated with two revisions (due to a cherry-pick from a branch with an associated revision). arc land wouldn't let me land, with the error message

Caught exception: There are multiple revisions on feature branch '{BRANCH_NAME}' which are not present on 'master':

...

Separate these revisions onto different branches, or use --revision <id> to use the commit message from <id> and land them all.

I squashed the commits on the branch to a single commit, which allowed me to land as normal.

Upvotes: 0

Hieu Vo
Hieu Vo

Reputation: 3284

If you encounter merge conflicts error after running

Syntax: arc land --revision <diffID> --onto <branchX>

One way to resolve the conflicts is to delete your local branchX and pull the origin/branchX again, it helps in my case

Upvotes: 0

CEPA
CEPA

Reputation: 2602

I recommend to my developers that they need to use --revision to land the specific change.

Syntax: arc land --revision <diffID> --onto <branch>

For example: arc land --revision D123 --onto develop

Note: Only accepted revision can land.

Upvotes: 50

internetross
internetross

Reputation: 144

While the above answer (https://stackoverflow.com/a/30947476/181344) is correct, if you happen to be in a situation where you interact with Phabricator through commands that abstract on top of arc land and are not able to pass the --revision argument directly, know that you also have the option of squashing the commits from different revisions and then attempting to land again.

There is more than one way to accomplish squashing your commits. A couple suggestions are:

$ git checkout my-feature-branch && git reset --soft master && git commmit -am 'my new commit message'

Or

$ git rebase -i master

Upvotes: 1

Related Questions