]> khamidou — GitHub mirrors - arcanist.git/commit
Make rules for guessing onto/remote more powerful and more explicit in `arc land`
authorepriestley <git@epriestley.com>
Wed, 28 Oct 2015 15:28:46 +0000 (08:28 -0700)
committerepriestley <git@epriestley.com>
Wed, 28 Oct 2015 16:37:17 +0000 (09:37 -0700)
commitaa5c023fe8fa4b7a770f1e570870b96cf01a70bb
tree877a4ba982595dd05d6e9453f11b775d560fd21a
parenta03c6079bb71d4f8d4cd4c8c661642f753349760
Make rules for guessing onto/remote more powerful and more explicit in `arc land`

Summary:
Fixes T9543. Fixes T9658. Ref T3855.

Major functional change is that you can have a sequence of branches like:

  origin/master -> notmaster -> feature1

...where they track each other, but you named your local master something else. Currently, we resolve only one level of upstreams, so we try to land onto "notmaster" in this case, which is wrong.

Instead, keep resolving upstreams until we either hit a cycle, don't have another upstream to look at, or find someting in a remote. In this case we'll eventually find "origin/master" and select "origin" as the remote and "master" as the target.

Other minor changes:

  - Make this selection process explicit.
  - Make the help 3000x longer.

Also fix a bug where we could incorrectly try to tell Differential to update awith `--preview`.

Test Plan:
  - Landed from a tag.
  - Landed from a tracking branch.
  - Landed from an nth-degree tracking branch.
  - Tried to land from a local branch with a cycle in upstreams.
  - Landed with --remote and --onto.
  - Read `arc help land`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9658, T3855, T9543

Differential Revision: https://secure.phabricator.com/D14357
src/land/ArcanistGitLandEngine.php
src/repository/api/ArcanistGitAPI.php
src/workflow/ArcanistLandWorkflow.php