Skip to content

Commit

Permalink
Remove deprecated flags
Browse files Browse the repository at this point in the history
Keeping the Option object for now as we'll probably have new
options soon.

Change-Id: I0a597d16b295ebb5ab68a4c9457f0c3fa496a336
  • Loading branch information
mikelalcon committed May 13, 2022
1 parent 91075e1 commit 2091426
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 30 deletions.
8 changes: 0 additions & 8 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2650,14 +2650,6 @@ partial_fetch | `bool`<br><p>This is an experimental feature that only works for
description | `string` or `NoneType`<br><p>A description of what this migration achieves</p>
actions | `sequence`<br><p>Experimental feature. A list of mirror actions to perform, with the following semantics:<br> - There is no guarantee of the order of execution.<br> - Actions need to be independent from each other.<br> - Failure in one action might prevent other actions from executing. --force can be used to continue for 'user' errors like non-fast-forward errors.<br><br>Actions will be in charge of doing the fetch, push, rebases, merges,etc.Only fetches/pushes for the declared refspec are allowed</p>



**Command line flags:**

Name | Type | Description
---- | ---- | -----------
<span style="white-space: nowrap;">`--git-mirror-force`</span> | *boolean* | Force push even if it is not fast-forward

<a id="git.origin" aria-hidden="true"></a>
### git.origin

Expand Down
15 changes: 1 addition & 14 deletions java/com/google/copybara/git/GitMirrorOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

package com.google.copybara.git;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.google.copybara.GeneralOptions;
import com.google.copybara.Option;

/**
Expand All @@ -27,16 +25,5 @@
@Parameters(separators = "=")
public class GitMirrorOptions implements Option {

public GitMirrorOptions() {
}

// TODO(malcon): Remove once internal references removed.
@Deprecated
public GitMirrorOptions(GeneralOptions ignore1, GitOptions ignore2) {
}

// TODO(malcon): Deprecate and use --force instead
@Parameter(names = "--git-mirror-force",
description = "Force push even if it is not fast-forward")
boolean forcePush = false;
public GitMirrorOptions() {}
}
2 changes: 1 addition & 1 deletion java/com/google/copybara/git/Mirror.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private void defaultMirror(GitRepository repo) throws RepoException, ValidationE
+ " commits to push in: %s", destination, repo.getGitDir());
} else {
generalOptions.console().progressFmt("Pushing to %s", destination);
List<Refspec> pushRefspecs = mirrorOptions.forcePush || generalOptions.isForced()
List<Refspec> pushRefspecs = generalOptions.isForced()
? refspec.stream().map(Refspec::withAllowNoFastForward).collect(Collectors.toList())
: refspec;
try (ProfilerTask ignore1 = profiler.start("push")) {
Expand Down
7 changes: 0 additions & 7 deletions javatests/com/google/copybara/git/GitMirrorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,6 @@ public void testMirrorConflict() throws Exception {
+ "because local/origin history is behind destination.*");
}

@Test
public void testMirrorNoConflictIfGitMirrorForce() throws Exception {
options.gitMirrorOptions.forcePush = true;
Migration mirror = prepareForConflict();
mirror.run(workdir, ImmutableList.of());
}

@Test
public void testMirrorNoConflictIfForce() throws Exception {
options.setForce(true);
Expand Down

0 comments on commit 2091426

Please sign in to comment.