emacs-devel
[Top][All Lists]
Advanced

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

Re: mh-e/mh-loaddefs.el removed from CVS


From: Stefan Monnier
Subject: Re: mh-e/mh-loaddefs.el removed from CVS
Date: Tue, 18 Oct 2005 10:27:42 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> I'm not sure how important it is to be able to start from a clean CVS
> tree without checking it out fresh.

For some people, checking out the whole CVS tree takes a long time.
For subversions.gnu.org it also adds unnecessary load.

Admittedly, this is not specific to Emacs, and arguably CVS should come with
a tool to delete non-CVS-managed files to revert to the "fresh checkout"
state.  I use a littel Perl script `cvsclean' to do that.


        Stefan


#!/usr/bin/perl

sub cvsclean {
    my($path) = @_;
    my(%files) = ();
    my(@subdirs);

    print STDOUT "Cleaning $path\n";
    opendir (DIR, "$path/") || die "No directory $path";
    open (ENTRIES, "$path/CVS/Entries") || die "No $path/CVS/Entries file";
    while (<ENTRIES>) {
        if (m[^D/([^/]+)]) {
            push (@subdirs, "$path/$1");
        } elsif (m[^/([^/]+)/[^/-]]) {
            $files{$1} = "managed";
        }
    }

    foreach $entry (readdir(DIR)) {
        if (!exists ($files{$entry})) {
            $entry = "$path/$entry";
            if (-f $entry) {
                print STDOUT "unlink $entry\n";
                unlink $entry;
            }
        }
    }
    
    foreach $subdir (@subdirs) {
        &cvsclean ($subdir);
    }
}

&cvsclean (".");




reply via email to

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