public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
- **land** __branch__ [--onto __master__]
+ **land** [__options__] __branch__ [--onto __master__]
Supports: git
Land an accepted change (currently sitting in local feature branch
In mutable repositories, this will perform a --squash merge (the
entire branch will be represented by one commit on __master__). In
- immutable repositories, it will perform a --no-ff merge (the branch
- will always be merged into __master__ with a merge commit).
+ immutable repositories (or when --merge is provided), it will perform
+ a --no-ff merge (the branch will always be merged into __master__ with
+ a merge commit).
EOTEXT
);
'param' => 'origin',
'help' => "Push to a remote other than 'origin' (default).",
),
+ 'merge' => array(
+ 'help' => 'Perform a --no-ff merge, not a --squash merge. If the '.
+ 'project is marked as having an immutable history, this is '.
+ 'the default behavior.',
+ ),
'*' => 'branch',
);
}
$remote = $this->getArgument('remote', 'origin');
$onto = $this->getArgument('onto', 'master');
- $is_immutable = $this->isHistoryImmutable();
+ $is_immutable = $this->isHistoryImmutable() ||
+ $this->getArgument('merge');
$repository_api = $this->getRepositoryAPI();
if (!($repository_api instanceof ArcanistGitAPI)) {
if ($revision['status'] != ArcanistDifferentialRevisionStatus::ACCEPTED) {
$ok = phutil_console_confirm(
- "Revision 'D{$id}: {$rev_title}' has not been accepted. Continue ".
+ "Revision 'D{$rev_id}: {$rev_title}' has not been accepted. Continue ".
"anyway?");
if (!$ok) {
throw new ArcanistUserAbortException();
throw new ArcanistUsageException(
"'git merge' failed. Your working copy has been left in a partially ".
"merged state. You can: abort with 'git merge --abort'; or follow ".
- "the instructions to complete the merge, and then push.");
+ "the instructions to complete the merge.");
}
} else {
// In mutable histories, do a --squash merge.
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
**merge** [__branch__] [--revision __revision_id__] [--show]
- Supports: git, hg
- Execute a "git merge <branch>" or "hg merge --rev <branch>" of a
- reviewed branch, but give the merge commit a useful commit message
- with information from Differential.
+ Supports: hg
+ Execute a "hg merge --rev <branch>" of a reviewed branch, but give the
+ merge commit a useful commit message with information from
+ Differential.
- In Git, this operates like "git merge <branch>" and should be executed
- from the branch you want to merge __into__, just like "git merge".
- Branch is required.
-
- In Mercurial, this operates like "hg merge" (default) or
- "hg merge --rev <branch>" and should be executed from the branch you
- want to merge __from__, just like "hg merge". It will also effect an
- "hg commit" with a rich commit message.
+ Tthis operates like "hg merge" (default) or "hg merge --rev <branch>"
+ and should be executed from the branch you want to merge __from__,
+ just like "hg merge". It will also effect an "hg commit" with a rich
+ commit message if possible.
EOTEXT
);
}
public function run() {
+ $repository_api = $this->getRepositoryAPI();
+
+ if ($repository_api instanceof ArcanistGitAPI) {
+ throw new ArcanistUsageException(
+ "'arc merge' no longer supports git. Use ".
+ "'arc land --keep-branch --hold --merge <feature_branch>' instead.");
+ }
+
$this->writeStatusMessage(
phutil_console_format(
"**WARNING:** 'arc merge' is new and experimental.\n"));
- $repository_api = $this->getRepositoryAPI();
+
if (!$repository_api->supportsLocalBranchMerge()) {
$name = $repository_api->getSourceControlSystemName();
throw new ArcanistUsageException(
}
protected function getSupportedRevisionControlSystems() {
- return array('git', 'hg');
+ return array('hg');
}
}