help-rcs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RCS Enhancement - deleted file handling


From: Brian Lloyd
Subject: RCS Enhancement - deleted file handling
Date: Sun, 03 Jul 2005 19:34:35 -0500

The following patch updates RCS 5.7 to include support for the dead
state, as used by CVS.  The second patch shown updates the man pages to
reflect the new functionality.  The dead state allows an RCS repository
to keep the files of sources that are no longer used while not checking
out unneeded files with a command like co -r RCS/*.



diff -an rcs-5.7/src/ci.c rcs-patched/src/ci.c
a282 1
        static char const delete_state[] = DELETESTATE;
d290 1
a290 1
        char const *diffname, *expname, *delname;
d292 1
a292 1
        int initflag, mustread, deleteflag;
d304 1
a304 1
        initflag = lockflag = mustread =deleteflag = false;
d320 1
a320 1
                        deleteflag = keepworkingfile = lockflag = false;
a323 1
                        deleteflag = false;
d333 1
a333 5
                        keepworkingfile=true; deleteflag =
lockflag=false;
                        goto revno;

                case 'D':
                        keepworkingfile=lockflag=false; deleteflag =
true; 
d445 1
a445 6
        if (deleteflag && keepflag)
                error("Cannot use -k and -D options together");
        if (deleteflag && state)
                error("Cannot use -s and -D options together");

        /* Handle alrl pathnames.  */
a460 4
                if (deleteflag) {
                        rcserror("can not delete if not already in
RCS");
                        continue;
                }
d482 1
a482 2
        diagnose("%s  <--  %s%s\n", RCSname, workname,
            (deleteflag?" (delete)":""));
d485 2
a486 12
                FILE *tmp;
                if (!deleteflag) {
                        eerror(workname);
                        continue;
                }
                delname = maketemp(1);
                tmp = fopenSafer(delname, FOPEN_W_WORK);
                if (tmp) fclose(tmp);
                if (!(workptr = Iopen(delname, FOPEN_R_WORK, &workstat))) { 
                        eerror(workname);
                        continue;
                }
a487 4
        else if (deleteflag) {
                error("File should not exist when executing delete
option");
                continue;
        }
d542 1
a542 3
        if (deleteflag)
                newdelta.state=delete_state; /* set state to dead
*/
        else if (state)
diff -an rcs-5.7/src/co.c rcs-patched/src/co.c
a438 6
                if (strcmp(targetdelta->state, DELETESTATE)==0) {
                        diagnose("File dead\n");
                        if (!rmworkfile()) continue;
                        un_link(workname);
                        continue;
                }
diff -an rcs-5.7/src/rcsbase.h rcs-patched/src/rcsbase.h
d231 1
a231 4
#define DELETESTATE     "dead" /* state used to mark deleted files
*/
                               /* Since RCS keeps a history of old
versions */
                               /* we can't just delete the RCS file.
*/
                               


diff -an rcs-5.7/man/ci.1 rcs-patched/man/ci.1
d5 1
a5 1
.Id $Id: ci.1,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $
a109 1
.BR \-D ,
a218 13
.BR \-D [\f2rev\fP]
marks the revision checked in with a state of dead, 
and checks in an empty file.
.BR \-D ,
option does not work with the
.BR \-k
or the
.BR \-s
options.  The file nust already be in RCS and must not currently 
exist to be marked as dead.  The dead state is intended as a way 
to mark files as not used anymore so co does not check them out 
when requesting files.
.TP
diff -an rcs-5.7/man/co.1 rcs-patched/man/co.1
d5 1
a5 1
.Id $Id: co.1,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $
a672 10
.SH dead FILES
.B co
treats a file with state dead as a file that should be deleted.
Instead of producing an empty file, does all normal processing
except it does not actually produce an output file.
.BR ci (1)
does, except that it does not need to read the working file
unless a revision number of
.B $
is specified.
diff -an rcs-5.7/man/ident.1 rcs-patched/man/ident.1
d6 1
a6 1
.Id $Id: ident.1,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $
Only in rcs-patched/man: Makefile
diff -an rcs-5.7/man/Makefile.in rcs-patched/man/Makefile.in
d3 1
a3 1
#       $Id: Makefile.in,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $
diff -an rcs-5.7/man/merge.1 rcs-patched/man/merge.1
d5 1
a5 1
.Id $Id: merge.1,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $
Only in rcs-patched/man: RCS
diff -an rcs-5.7/man/rcs.1 rcs-patched/man/rcs.1
d5 1
a5 1
.Id $Id: rcs.1,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $
d280 1
a280 1
.IR state, but the value dead has special meaning.
a282 2
.B dead 
(for deleted files),
diff -an rcs-5.7/man/rcsclean.1 rcs-patched/man/rcsclean.1
d5 1
a5 1
.Id $Id: rcsclean.1,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $
diff -an rcs-5.7/man/rcsdiff.1 rcs-patched/man/rcsdiff.1
d5 1
a5 1
.Id $Id: rcsdiff.1,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $
diff -an rcs-5.7/man/rcsfile.5 rcs-patched/man/rcsfile.5
d8 1
a8 1
.Id $Id: rcsfile.5,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $
diff -an rcs-5.7/man/rcsfile.5in rcs-patched/man/rcsfile.5in
d7 1
a7 1
.Id $Id: rcsfile.5in,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $
diff -an rcs-5.7/man/rcsfreeze.1 rcs-patched/man/rcsfreeze.1
d5 1
a5 1
.Id $Id: rcsfreeze.1,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $
diff -an rcs-5.7/man/rcsintro.1 rcs-patched/man/rcsintro.1
d5 1
a5 1
.Id $Id: rcsintro.1,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $
diff -an rcs-5.7/man/rcsmerge.1 rcs-patched/man/rcsmerge.1
d5 1
a5 1
.Id $Id: rcsmerge.1,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $
diff -an rcs-5.7/man/rlog.1 rcs-patched/man/rlog.1
d5 1
a5 1
.Id $Id: rlog.1,v 1.1 2005/07/01 18:48:47 lloydbr Exp lloydbr $









reply via email to

[Prev in Thread] Current Thread [Next in Thread]