--- rlog.c 1995/06/16 06:19:24 5.18 +++ rlog.c 2005/08/15 19:26:15 @@ -212,6 +212,8 @@ static int branchflag; /*set on -b */ static int exitstatus; static int lockflag; +static int onlyRCSflag; /* print only RCS pathname */ +static int printedRCS; /* RCS pathaname printed for -R */ static struct Datepairs *datelist, *duelst; static struct Revpairs *revlist, *Revlst; static struct authors *authorlist; @@ -235,7 +237,6 @@ struct rcslock const *currlock; int descflag, selectflag; int onlylockflag; /* print only files with locks */ - int onlyRCSflag; /* print only RCS pathname */ int pre5; int shownames; int revno; @@ -371,11 +372,6 @@ if (onlylockflag && !Locks) continue; - if ( onlyRCSflag ) { - aprintf(out, "%s\n", RCSname); - continue; - } - gettree(); if (!getnumericrev()) @@ -385,51 +381,53 @@ * Output the first character with putc, not printf. * Otherwise, an SVR4 stdio bug buffers output inefficiently. */ - aputc_('\n', out) - - /* print RCS pathname, working pathname and optional - administrative information */ - /* could use getfullRCSname() here, but that is very slow */ - aprintf(out, headFormat, RCSname, workname, - Head ? " " : "", Head ? Head->num : "", - Dbranch ? " " : "", Dbranch ? Dbranch : "", - StrictLocks ? " strict" : "" - ); - currlock = Locks; - while( currlock ) { - aprintf(out, symbolFormat, currlock->login, - currlock->delta->num); - currlock = currlock->nextlock; - } - if (StrictLocks && pre5) - aputs(" ; strict" + (Locks?3:0), out); - - aputs(accessListString, out); /* print access list */ - curaccess = AccessList; - while(curaccess) { - aprintf(out, accessFormat, curaccess->login); - curaccess = curaccess->nextaccess; - } + if (! onlyRCSflag ) { + afputc('\n', out); - if (shownames) { - aputs("\nsymbolic names:", out); /* print symbolic names */ - for (curassoc=Symbols; curassoc; curassoc=curassoc->nextassoc) - aprintf(out, symbolFormat, curassoc->symbol, curassoc->num); - } - if (pre5) { - aputs("\ncomment leader: \"", out); - awrite(Comment.string, Comment.size, out); - afputc('\"', out); - } - if (!pre5 || Expand != KEYVAL_EXPAND) - aprintf(out, "\nkeyword substitution: %s", - expand_names[Expand] + /* print RCS pathname, working pathname and optional + administrative information */ + /* could use getfullRCSname() here, but that is very slow */ + aprintf(out, headFormat, RCSname, workname, + Head ? " " : "", Head ? Head->num : "", + Dbranch ? " " : "", Dbranch ? Dbranch : "", + StrictLocks ? " strict" : "" ); + currlock = Locks; + while( currlock ) { + aprintf(out, symbolFormat, currlock->login, + currlock->delta->num); + currlock = currlock->nextlock; + } + if (StrictLocks && pre5) + aputs(" ; strict" + (Locks?3:0), out); - aprintf(out, "\ntotal revisions: %d", TotalDeltas); + aputs(accessListString, out); /* print access list */ + curaccess = AccessList; + while(curaccess) { + aprintf(out, accessFormat, curaccess->login); + curaccess = curaccess->nextaccess; + } + + if (shownames) { + aputs("\nsymbolic names:", out); /* print symbolic names */ + for (curassoc=Symbols; curassoc; curassoc=curassoc->nextassoc) + aprintf(out, symbolFormat, curassoc->symbol, curassoc->num); + } + if (pre5) { + aputs("\ncomment leader: \"", out); + awrite(Comment.string, Comment.size, out); + afputc('\"', out); + } + if (!pre5 || Expand != KEYVAL_EXPAND) + aprintf(out, "\nkeyword substitution: %s", + expand_names[Expand] + ); - revno = 0; + aprintf(out, "\ntotal revisions: %d", TotalDeltas); + revno = 0; + } + if (Head && selectflag & descflag) { exttree(Head); @@ -444,13 +442,20 @@ revno = extdate(Head); - aprintf(out, ";\tselected revisions: %d", revno); + if (! onlyRCSflag ) { + aprintf(out, ";\tselected revisions: %d", revno); + } } - afputc('\n',out); + if (! onlyRCSflag ) { + afputc('\n',out); + } if (descflag) { - aputs("description:\n", out); - getdesc(true); + if (! onlyRCSflag ) { + aputs("description:\n", out); + getdesc(true); + } else + getdesc(false); } if (revno) { while (! (delta = readdeltalog())->selector || --revno) @@ -459,10 +464,14 @@ /* Read through delta->next to get its insertlns. */ while (readdeltalog() != delta->next) continue; + printedRCS = false; putrunk(); putree(Head); + printedRCS = false; } - aputs("=============================================================================\n",out); + if (! onlyRCSflag ) { + aputs("=============================================================================\n",out); + } } Ofclose(out); exitmain(exitstatus); @@ -571,6 +580,13 @@ return; out = stdout; + if ( onlyRCSflag ) { + if (! printedRCS ) { + aprintf(out, "%s\n", RCSname); + printedRCS = true; + } + return; + } aprintf(out, "----------------------------\nrevision %s%s", node->num, pre5 ? " " : ""