Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /svnutils/trunk/, /svnutils/trunk/src/

svnutils
Discussion topic

Back to topic list

CVS update: /svnutils/trunk/, /svnutils/trunk/src/

Author sunny
Full name Øyvind A. Holm
Date 2004-06-06 20:52:18 PDT
Message User: sunny
Date: 04/06/06 20:52:18

Removed:
 /svnutils/trunk/
  strip_id

Added:
 /svnutils/trunk/src/
  strip_id

Log:
 r34 | sunny | 2004-06-07 05:46:21 +0200 (Mon, 07 Jun 2004) | 4 lines
 Changed paths:
    A /trunk/src/strip_id (from /trunk/strip_id:33)
    D /trunk/strip_id
 
 trunk$ svn mv strip_id src/
 
 Stored the strip_id in the wrong directory when saving r28.
 
 For CVS, this is the complete history of this file:
 
 # r33 | sunny | 2004-06-07 05:29:26 +0200 (Mon, 07 Jun 2004) | 5 lines
 # Changed paths:
 # M /trunk/strip_id
 #
 # M trunk/strip_id
 # Try to minimise the use of author names in copylefts and files
 # generally.
 # --------------------​--------------------​--------------------​------------
 # r30 | sunny | 2004-06-01 08:06:24 +0200 (Tue, 01 Jun 2004) | 3 lines
 # Changed paths:
 # M /trunk/strip_id
 #
 # * trunk/strip_id
 # Translated to English.
 # --------------------​--------------------​--------------------​------------
 # r29 | sunny | 2004-05-29 08:10:39 +0200 (Sat, 29 May 2004) | 4 lines
 # Changed paths:
 # M /trunk/strip_id
 #
 # * strip_id
 #
 # svn:keywords and svn:eol-style.
 # --------------------​--------------------​--------------------​------------
 # r28 | sunny | 2004-05-29 08:07:12 +0200 (Sat, 29 May 2004) | 4 lines
 # Changed paths:
 # A /trunk/strip_id
 #
 # This is "strip_id 819 2004-05-16 00:00:27Z sunny" from my "bin" repository.
 # It strips things like "$Id: ", " $", "$Date: " etc from the text in the
 # files to avoid them being mangled by other imports into CVS or Subversion.

File Changes:

Directory: /svnutils/trunk/
===========================

File [removed]: strip_id

Directory: /svnutils/trunk/src/
===============================

File [added]: strip_id
Url: http://svnutils.tigr​is.org/source/browse​/svnutils/trunk/src/​strip_id?rev=1.1​&content-type=text/v​nd.viewcvs-markup
Added lines: 71
---------------
#!/usr/bin/perl -w

#===================​====================​====================​=================
# $Id: strip_id 34 2004-06-07 03:46:21Z sunny $
# Strips the " $","$Id: :" and "$Date: " fom RCS/CVS/Subversion keywords to
# protect it from changes when importing or adding the file to a new
# repository.
#
# Syntax: strip_id file [file [...]]
#
# Default behaviour at the moment (% = $):
#
# "%Id: file.txt 123 2004-01-21 17:12:16Z fjodor %"
# is changed to
# "file.txt 123 2004-01-21 17:12:16Z fjodor"
#
# "%Date: 2004-05-18 10:44:54 +0200 (Tue, 18 May 2004) %"
# is changed to
# "2004-05-18 10:44:54 +0200"
#
# Character set:
# UTF-8
# Project page:
# http://svnutils.tigris.org
# Subversion repository:
# http://svn.sunbase.o​rg/repos/svnutils
# License:
# GNU General Public License
# Authors:
# Use "svn blame" or "svn log" against the Subversion repository to
# nail the responsible guys. As of 2004-06-07, it is only:
# - sunny, Øyvind A. Holm <sunny at sunbase dot org>
#===================​====================​====================​=================

use strict;

$| = 1;

my $rand_ext = "$$." . substr(rand, 2, 8);
while (defined($ARGV[0])) {
    my $Curr = shift;
    my $Dest = "$Curr.$rand_ext.tmp";
    if (open(FromFP, $Curr)) {
        (-e $Dest) && die("$Dest: What??? File already exists!");
        if (open(ToFP, ">$Dest")) {
            while (<FromFP>) {
                $_ = process_line($_);
                print(ToFP $_);
            }
            close(FromFP);
            close(ToFP);
            rename($Dest, $Curr) || warn("rename($Dest, $Curr): $!");
        } else {
            warn("$Dest: Unable to create file: $!");
        }
    } else {
        warn("$Curr: Unable to open file for read: $!");
    }
}

sub process_line {
    my $Retval = shift;
    $Retval =~ s/(\$Date: .*?)\(..., \d+ ... \d\d\d\d\) (\$)/$1$2/g;
    $Retval =~ s/\$(Id|Date): (.*?) \$/$2/g;
    return($Retval);
}

__END__

# vim: set fileencoding=UTF-8 filetype=perl foldmethod=marker foldlevel=0 :
# End of file $Id: strip_id 34 2004-06-07 03:46:21Z sunny $




--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@svnu​tils.tigris.org
For additional commands, e-mail: cvs-help at svnutils dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /svnutils/trunk/, /svnutils/trunk/src/ sunny Øyvind A. Holm 2004-06-06 20:52:18 PDT
Messages per page: