submodule subscriptions: be more verbose in debug log

Change-Id: I1046367139c45377b9e6b93c9d653ee23cddd556
This commit is contained in:
Stefan Beller
2016-05-24 08:28:17 -07:00
parent 174ad0a479
commit 198e97a5b6
2 changed files with 17 additions and 0 deletions

View File

@@ -68,4 +68,18 @@ public class SubscribeSection {
public Collection<RefSpec> getRefSpecs() {
return Collections.unmodifiableCollection(refSpecs);
}
@Override
public String toString() {
StringBuilder ret = new StringBuilder();
ret.append("[SubscribeSection, project=");
ret.append(project);
ret.append(", refs=[");
for (RefSpec r : refSpecs) {
ret.append(r.toString());
ret.append(", ");
}
ret.append("]");
return ret.toString();
}
}

View File

@@ -145,13 +145,16 @@ public class SubmoduleOp {
ProjectConfig cfg = projectCache.get(project).getConfig();
for (SubscribeSection s : projectStateFactory.create(cfg)
.getSubscribeSections(branch)) {
logDebug("Checking subscribe section " + s);
Collection<Branch.NameKey> branches =
getDestinationBranches(branch, s, orm);
for (Branch.NameKey targetBranch : branches) {
GitModules m = gitmodulesFactory.create(targetBranch, updateId, orm);
m.load();
for (SubmoduleSubscription ss : m.subscribedTo(branch)) {
logDebug("Checking SubmoduleSubscription " + ss);
if (projectCache.get(ss.getSubmodule().getParentKey()) != null) {
logDebug("Adding SubmoduleSubscription " + ss);
ret.add(ss);
}
}