From 38f2d9bcd66b0261384814f42ebafe7f3d5c7113 Mon Sep 17 00:00:00 2001 From: "terry%netscape.com" Date: Thu, 1 Apr 1999 23:07:19 +0000 Subject: [PATCH] Silly utility to generate lists of who has ever checked in a file in a directory. --- webtools/bonsai/whohastouchedwhat.cgi | 78 +++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100755 webtools/bonsai/whohastouchedwhat.cgi diff --git a/webtools/bonsai/whohastouchedwhat.cgi b/webtools/bonsai/whohastouchedwhat.cgi new file mode 100755 index 000000000000..f4789ee1525d --- /dev/null +++ b/webtools/bonsai/whohastouchedwhat.cgi @@ -0,0 +1,78 @@ +#!/usr/bonsaitools/bin/perl -- +# -*- Mode: perl; indent-tabs-mode: nil -*- +# +# The contents of this file are subject to the Netscape Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations +# under the License. +# +# The Original Code is the Bonsai CVS tool. +# +# The Initial Developer of the Original Code is Netscape Communications +# Corporation. Portions created by Netscape are Copyright (C) 1998 +# Netscape Communications Corporation. All Rights Reserved. + +require 'lloydcgi.pl'; +require 'utils.pl'; + +# use diagnostics; +# use strict; + +my $db = ConnectToDatabase(); + +$| = 1; + +if (!defined $form{'repositoryid'}) { + print "Content-type: text/html + +This will create a cryptic report of all the people who have ever +touched each file within a directory heirarchy. + +

+ +

+Repository:
+Directory: + +
+"; + exit; +} + + +print "Content-type: text/plain\n\n"; + +my $qstr = "select distinct who, dir, file from checkins, people, dirs, files where repositoryid = $form{'repositoryid'} and dirid=dirs.id and dir like '$form{'dir'}%' and fileid=files.id and whoid=people.id order by dir, file"; +my $query = $db->Query($qstr); + +if (!$query) { + die "Bad query: $qstr \n\n $::db_errstr"; +} + + +my @row; +my $last = ""; +while (@row = $query->fetchrow()) { + my ($who, $dir, $file) = (@row); + my $cur = "$dir/$file"; + if ($cur ne $last) { + print "\n$cur\n"; + $last = $cur; + } + print "$who\n"; +} +