Merge "Allow to use refspec shortcuts for push replication"
This commit is contained in:
@@ -164,6 +164,14 @@ public class PushReplication implements ReplicationQueue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In case if refspec destination for push is not set then we assume it is equal to source
|
||||||
|
for (RefSpec ref : c.getPushRefSpecs()) {
|
||||||
|
if (ref.getDestination() == null) {
|
||||||
|
ref.setDestination(ref.getSource());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (c.getPushRefSpecs().isEmpty()) {
|
if (c.getPushRefSpecs().isEmpty()) {
|
||||||
RefSpec spec = new RefSpec();
|
RefSpec spec = new RefSpec();
|
||||||
spec = spec.setSourceDestination("refs/*", "refs/*");
|
spec = spec.setSourceDestination("refs/*", "refs/*");
|
||||||
@@ -194,21 +202,17 @@ public class PushReplication implements ReplicationQueue {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void replicateNewProject(Project.NameKey projectName, String head) {
|
public void replicateNewProject(Project.NameKey projectName, String head) {
|
||||||
if (!isEnabled()) {
|
if (!isEnabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator<ReplicationConfig> configIter = configs.iterator();
|
for (ReplicationConfig config : configs) {
|
||||||
|
List<URIish> uriList = config.getURIs(projectName, "*");
|
||||||
|
|
||||||
while (configIter.hasNext()) {
|
for (URIish uri : uriList) {
|
||||||
ReplicationConfig rp = configIter.next();
|
replicateProject(uri, head);
|
||||||
List<URIish> uriList = rp.getURIs(projectName, "*");
|
|
||||||
|
|
||||||
Iterator<URIish> uriIter = uriList.iterator();
|
|
||||||
|
|
||||||
while (uriIter.hasNext()) {
|
|
||||||
replicateProject(uriIter.next(), head);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -267,6 +271,7 @@ public class PushReplication implements ReplicationQueue {
|
|||||||
private StringBuilder all = new StringBuilder();
|
private StringBuilder all = new StringBuilder();
|
||||||
private StringBuilder sb = new StringBuilder();
|
private StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
String r = all.toString();
|
String r = all.toString();
|
||||||
while (r.endsWith("\n"))
|
while (r.endsWith("\n"))
|
||||||
|
|||||||
Reference in New Issue
Block a user