314d1a9a41231220ae79fc971758da141c21f233
markd
Fri Oct 2 21:36:10 2026 -0700
Revert the superTrack nesting fix on master; it lives on superTrackNesting. refs #38460
Taken off master with its only consumer, the TSS trackDb change reverted in the
previous commit. It is a library change every CGI links, in trackDbCustom.c,
hdb.c, hubConnect.c and hgTracks.c, and nothing on master needs it until the TSS
tracks nest again.
Kept on the superTrackNesting branch with its regression evidence. Note for
whoever lands it: trackDbToTxt has to be rebuilt too, or the curated hub it
writes names a parent stanza it did not emit.
diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index 6aa8b05af50..3ac8722e87c 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -4330,45 +4330,40 @@
}
static struct trackDb *rFindTrack(int level, struct trackDb *tdbList, char *track)
/* Look for named track in list or children. */
{
struct trackDb *tdb;
for (tdb = tdbList; tdb != NULL; tdb = tdb->next)
{
if (sameString(track, tdb->track))
return tdb;
struct trackDb *matchingChild = rFindTrack(level+1, tdb->subtracks, track);
if (matchingChild != NULL)
return matchingChild;
}
-/* Look "to the sky" in parents of root generation as well. Walk the whole
- * chain: a supertrack may sit inside another supertrack, and neither is in the
- * list itself, so the outer one is only reachable through the inner one. */
+/* Look "to the sky" in parents of root generation as well. */
if (level == 0)
{
for (tdb = tdbList; tdb != NULL; tdb = tdb->next)
{
- struct trackDb *p;
- for (p = tdb->parent; p != NULL; p = p->parent)
- {
- if (sameString(track, p->track))
+ struct trackDb *p = tdb->parent;
+ if (p != NULL && sameString(track, p->track))
return p;
}
}
- }
return NULL;
}
#ifdef DEBUG
static void dumpFlagStatus(struct trackDb *tdbList, char *tableName, char *label)
/* Look for tdbList for track matching tableName. Print out info on it starting with label. */
{
struct trackDb *tdb = rFindTrack(0, tdbList, tableName);
if (tdb == NULL)
printf("%s: nil
\n", label);
else
printf("%s: treeNodeType %d, composite? %d, supertrack ? %d
\n", label, tdb->treeNodeType, COMPOSITE_NODE(tdb->treeNodeType), SUPERTRACK_NODE(tdb->treeNodeType));
}
#endif /* DEBUG */
@@ -4377,35 +4372,30 @@
/* Go through tdbList and set up the ->children field in parents with references
* to their children. */
{
struct trackDb *tdb;
/* Insert a little paranoid check here to make sure this doesn't get called twice. */
for (tdb = tdbList; tdb != NULL; tdb = tdb->next)
if (tdb->children != NULL)
internalErr();
for (tdb = tdbList; tdb != NULL; tdb = tdb->next)
{
struct trackDb *parent = tdb->parent;
if (parent != NULL)
refAdd(&parent->children, tdb);
- /* A supertrack that is a member of another supertrack is not in tdbList
- * itself, so the loop above never reaches it. Add it to its own parent's
- * children the first time one of its members brings us here. */
- for (; parent != NULL && tdbIsSuperTrackChild(parent); parent = parent->parent)
- refAddUnique(&parent->parent->children, parent);
}
}
struct trackDb *trackDbPolishAfterLinkupKeepAll(struct trackDb *tdbList)
/* The part of trackDbPolishAfterLinkup that every caller wants, without dropping
* tracks whose data cannot be reached. hubCheck needs this: a track pruned because
* its bigDataUrl does not resolve is exactly the track hubCheck has to report on. */
{
addChildRefsToParents(tdbList);
trackDbContainerMarkup(NULL, tdbList);
rInheritFields(tdbList);
slSort(&tdbList, trackDbCmp);
return tdbList;
}