Merge changes I37ebd2bd,I952dd5aa
* changes:
SubscriptionGraph: trim log statements
SubscribeSection: compress multiple log lines together
diff --git a/java/com/google/gerrit/entities/SubscribeSection.java b/java/com/google/gerrit/entities/SubscribeSection.java
index b95517c..574cae8 100644
--- a/java/com/google/gerrit/entities/SubscribeSection.java
+++ b/java/com/google/gerrit/entities/SubscribeSection.java
@@ -99,9 +99,10 @@
public ImmutableSet<BranchNameKey> getDestinationBranches(
BranchNameKey src, Collection<Ref> allRefsInRefsHeads) {
Set<BranchNameKey> ret = new HashSet<>();
- logger.atFine().log("Inspecting SubscribeSection %s", this);
- for (RefSpec r : matchingRefSpecs()) {
- logger.atFine().log("Inspecting [matching] ref %s", r);
+
+ ImmutableList<RefSpec> matching = matchingRefSpecs();
+ ImmutableList<RefSpec> multiMatch = multiMatchRefSpecs();
+ for (RefSpec r : matching) {
if (!r.matchSource(src.branch())) {
continue;
}
@@ -118,8 +119,7 @@
}
}
- for (RefSpec r : multiMatchRefSpecs()) {
- logger.atFine().log("Inspecting [all] ref %s", r);
+ for (RefSpec r : multiMatch) {
if (!r.matchSource(src.branch())) {
continue;
}
@@ -133,7 +133,9 @@
}
}
}
- logger.atFine().log("Returning possible branches: %s for project %s", ret, project());
+ logger.atFine().log(
+ "getDestinationBranches(%s): %s. matching refs: %s, multimatch refs: %s",
+ this, ret, matching, multiMatch);
return ImmutableSet.copyOf(ret);
}
diff --git a/java/com/google/gerrit/server/submit/SubscriptionGraph.java b/java/com/google/gerrit/server/submit/SubscriptionGraph.java
index ad16cb0..26c8ac9 100644
--- a/java/com/google/gerrit/server/submit/SubscriptionGraph.java
+++ b/java/com/google/gerrit/server/submit/SubscriptionGraph.java
@@ -231,7 +231,6 @@
Map<BranchNameKey, GitModules> branchGitModules,
MergeOpRepoManager orm)
throws SubmoduleConflictException {
- logger.atFine().log("Calculating superprojects - submodules map");
LinkedHashSet<BranchNameKey> allVisited = new LinkedHashSet<>();
for (BranchNameKey updatedBranch : updatedBranches) {
if (allVisited.contains(updatedBranch)) {
@@ -332,7 +331,6 @@
Map<BranchNameKey, GitModules> branchGitModules,
MergeOpRepoManager orm)
throws IOException {
- logger.atFine().log("Calculating possible superprojects for %s", srcBranch);
Collection<SubmoduleSubscription> ret = new ArrayList<>();
Project.NameKey srcProject = srcBranch.project();
for (SubscribeSection s :
@@ -340,7 +338,6 @@
.get(srcProject)
.orElseThrow(illegalState(srcProject))
.getSubscribeSections(srcBranch)) {
- logger.atFine().log("Checking subscribe section %s", s);
Collection<BranchNameKey> branches = getDestinationBranches(srcBranch, s, orm);
for (BranchNameKey targetBranch : branches) {
Project.NameKey targetProject = targetBranch.project();
@@ -348,11 +345,11 @@
OpenRepo or = orm.getRepo(targetProject);
ObjectId id = or.repo.resolve(targetBranch.branch());
if (id == null) {
- logger.atFine().log("The branch %s doesn't exist.", targetBranch);
+ logger.atFine().log("SubscribeSection %s: branch %s doesn't exist.", s, targetBranch);
continue;
}
} catch (NoSuchProjectException e) {
- logger.atFine().log("The project %s doesn't exist", targetProject);
+ logger.atFine().log("SubscribeSection %s: project %s doesn't exist", s, targetProject);
continue;
}