PatchSet: Change isRef to isChangeRef
The name isChangeRef is clearer. Update the replication plugin to use the new method name. For backwards compatibility for other plugins, keep the isRef method and mark it as deprecated. Change-Id: I99c6b2daeaf6c3a5e5d948ae32e0751f3ffedf31
This commit is contained in:
@@ -26,10 +26,18 @@ import java.util.List;
|
||||
/** A single revision of a {@link Change}. */
|
||||
public final class PatchSet {
|
||||
/** Is the reference name a change reference? */
|
||||
public static boolean isRef(String name) {
|
||||
public static boolean isChangeRef(String name) {
|
||||
return Id.fromRef(name) != null;
|
||||
}
|
||||
|
||||
/** Is the reference name a change reference?
|
||||
*
|
||||
* @deprecated use isChangeRef instead.
|
||||
**/
|
||||
public static boolean isRef(String name) {
|
||||
return isChangeRef(name);
|
||||
}
|
||||
|
||||
public static String joinGroups(Iterable<String> groups) {
|
||||
if (groups == null) {
|
||||
return null;
|
||||
|
||||
@@ -84,13 +84,13 @@ public class PatchSetTest {
|
||||
}
|
||||
|
||||
private static void assertRef(int changeId, int psId, String refName) {
|
||||
assertThat(PatchSet.isRef(refName)).isTrue();
|
||||
assertThat(PatchSet.isChangeRef(refName)).isTrue();
|
||||
assertThat(PatchSet.Id.fromRef(refName))
|
||||
.isEqualTo(new PatchSet.Id(new Change.Id(changeId), psId));
|
||||
}
|
||||
|
||||
private static void assertNotRef(String refName) {
|
||||
assertThat(PatchSet.isRef(refName)).isFalse();
|
||||
assertThat(PatchSet.isChangeRef(refName)).isFalse();
|
||||
assertThat(PatchSet.Id.fromRef(refName)).isNull();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ class TagSet {
|
||||
|
||||
static boolean skip(Ref ref) {
|
||||
return ref.isSymbolic() || ref.getObjectId() == null
|
||||
|| PatchSet.isRef(ref.getName());
|
||||
|| PatchSet.isChangeRef(ref.getName());
|
||||
}
|
||||
|
||||
private static boolean isTag(Ref ref) {
|
||||
|
||||
Submodule plugins/replication updated: e9fd84329b...1fda499fea
Reference in New Issue
Block a user