8074 |
RCSVers *versp; |
RCSVers *versp; |
8075 |
Node *p, *branch; |
Node *p, *branch; |
8076 |
|
|
8077 |
|
/* Previously, this function used a recursive implementation, but |
8078 |
|
if the trunk has a huge number of revisions and the program |
8079 |
|
stack is not big, a stack overflow could occur, so this |
8080 |
|
nonrecursive version was developed to be more safe. */ |
8081 |
|
Node *k, *branchlist, *onebranch; |
8082 |
|
List *branches; |
8083 |
|
List *onebranchlist; |
8084 |
|
|
8085 |
if (rev == NULL) |
if (rev == NULL) |
8086 |
return; |
return; |
8087 |
|
|
8088 |
/* Find the delta node for this revision. */ |
branches = getlist(); |
8089 |
p = findnode (rcs->versions, rev); |
|
8090 |
if (p == NULL) |
for (; rev != NULL;) |
8091 |
{ |
{ |
8092 |
error (1, 0, |
/* Find the delta node for this revision. */ |
8093 |
"error parsing repository file %s, file may be corrupt.", |
p = findnode (rcs->versions, rev); |
8094 |
rcs->print_path); |
if (p == NULL) |
8095 |
} |
{ |
8096 |
|
error (1, 0, |
8097 |
|
"error parsing repository file %s, file may be corrupt.", |
8098 |
|
rcs->path); |
8099 |
|
} |
8100 |
|
|
8101 |
versp = p->data; |
versp = p->data; |
8102 |
|
|
8103 |
|
/* Print the delta node and go for its `next' node. This |
8104 |
|
prints the trunk. If there are any branches printed on this |
8105 |
|
revision, mark we have some. */ |
8106 |
|
putdelta (versp, fp); |
8107 |
|
/* Store branch information into branch list so to write its |
8108 |
|
trunk afterwards */ |
8109 |
|
if (versp->branches != NULL) |
8110 |
|
{ |
8111 |
|
branch = getnode(); |
8112 |
|
branch->data = versp->branches; |
8113 |
|
|
8114 |
|
addnode(branches, branch); |
8115 |
|
} |
8116 |
|
|
8117 |
/* Print the delta node and recurse on its `next' node. This prints |
rev = versp->next; |
8118 |
the trunk. If there are any branches printed on this revision, |
} |
8119 |
|
|
8120 |
|
/* If there are any branches printed on this revision, |
8121 |
print those trunks as well. */ |
print those trunks as well. */ |
8122 |
putdelta (versp, fp); |
branchlist = branches->list; |
8123 |
RCS_putdtree (rcs, versp->next, fp); |
for (branch = branchlist->next; |
8124 |
if (versp->branches != NULL) |
branch != branchlist; |
8125 |
|
branch = branch->next) |
8126 |
{ |
{ |
8127 |
branch = versp->branches->list; |
onebranchlist = (List *)(branch->data); |
8128 |
for (p = branch->next; p != branch; p = p->next) |
onebranch = onebranchlist->list; |
8129 |
|
for (p = onebranch->next; p != onebranch; p = p->next) |
8130 |
RCS_putdtree (rcs, p->key, fp); |
RCS_putdtree (rcs, p->key, fp); |
8131 |
|
|
8132 |
|
branch->data = NULL; /* so to prevent its freeing on dellist */ |
8133 |
} |
} |
8134 |
|
|
8135 |
|
dellist(&branches); |
8136 |
} |
} |
8137 |
|
|
8138 |
|
|