Page MenuHomePhabricator

Extend documentation on arc land
Closed, ResolvedPublic

Description

Forking from T7339#97782:

I found it difficult to find out how to use arc land properly, even after reading the docs.

My first mistake was not using feature branches:

$ arc land
Landing current branch 'default'.
Usage Exception: You can not land a branch onto itself -- you are trying to land 'default' onto 'default'. For more information on how to push changes, see 'Pushing and Closing Revisions' in 'Arcanist User Guide: arc diff' in the documentation.

The next issue was that arc land needs a named branch and cannot operate on the bookmarks created by arc patch. Nevertheless it will use a bookmark for the missing <branch> parameter, even if the branch is named:

$ hg strip -r tip
$ hg branch test/umlaut
$ arc patch D1
$ arc land
Landing current bookmark 'arcpatch-D1'.
Usage Exception: Source arcpatch-D1 is a bookmark but destination default is a branch. When landing a bookmark, the destination must also be a bookmark. Use --onto to specify a bookmark, or set arc.land.onto.default in .arcconfig.

Thus I specified the branch name manually, but that was not enough, since this type of operation is not supported for Mercurial:

$ arc land test/umlaut
[…]
Updating default...
The following commit(s) will be landed:

11ec2683cc37 Ümläüt Test 2

Switched to branch test/umlaut. Identifying and merging...
Usage Exception: --merge is not currently supported for hg repos.

So I tried to squash instead of merge, but arc land apparently "forgot" where the commit, created by the previous arc patch, came from:

$ arc land test/umlaut --squash
[…]
Updating default...
The following commit(s) will be landed:

11ec2683cc37 Ümläüt Test 2

Switched to branch test/umlaut. Identifying and merging...
Usage Exception: arc can not identify which revision exists on branch 'test/umlaut'. Update the revision with recent changes to synchronize the branch name and hashes, or use 'arc amend' to amend the commit message at HEAD, or use '--revision <id>' to select a revision exp
licitly.

Finally, after giving all the information manually, it worked:

$ arc land test/umlaut --squash --revision D1
[…]
Updating default...
The following commit(s) will be landed:

11ec2683cc37 Ümläüt Test 2

Switched to branch test/umlaut. Identifying and merging...
Landing revision 'D1: Ümläüt Test 2'...
Pushing change...

pushing to ssh://…/diffusion/…/…/
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 0 changes to 0 files

Cleaning up feature branch...
Done.

What I would like to know is how Mercurial bookmarks (created by arc patch) are properly used, how arc land would usually figure out which revision it is operating on and why that did not work in my case, etc. Maybe the docs could be extended a bit, and at least include the information that arc land will break badly if I do not use feature branches.

Event Timeline

devurandom raised the priority of this task from to Needs Triage.
devurandom updated the task description. (Show Details)
devurandom added projects: Arcanist, Diviner.
devurandom added a subscriber: devurandom.
epriestley claimed this task.
epriestley added a subscriber: epriestley.

The arc help land documentation was improved by T9657.

I think most of the other behaviors you discuss are bugs/unintended, see T9948 for remaining work specific to Mercurial.