r24713 - /scripts/KGB/server/KGB
dmn at users.alioth.debian.org
dmn at users.alioth.debian.org
Fri Aug 29 07:37:08 UTC 2008
Author: dmn
Date: Fri Aug 29 07:37:05 2008
New Revision: 24713
URL: http://svn.debian.org/wsvn/?sc=1&rev=24713
Log:
use %dirs for finding out the common directory of the change
Modified:
scripts/KGB/server/KGB
Modified: scripts/KGB/server/KGB
URL: http://svn.debian.org/wsvn/scripts/KGB/server/KGB?rev=24713&op=diff
==============================================================================
--- scripts/KGB/server/KGB (original)
+++ scripts/KGB/server/KGB Fri Aug 29 07:37:05 2008
@@ -259,19 +259,8 @@
$dirs{dirname($path)}++;
}
- my %most_dirs;
- for my $dir (keys %dirs) {
- $most_dirs{$dir}++;
- while (1) {
- my $ndir = dirname($dir);
- last if $ndir = $dir; # reached the root?
- $most_dirs{$ndir}++;
- $dir = $ndir;
- }
- }
-
- my $topdir;
- my $max;
+ my $topdir = '';
+ my $max = 0;
# This needs to be tested - the idea is that we've now built up a
# hash of all the dirs in the changeset, in incremental lengths.
@@ -282,10 +271,10 @@
# to choose the last in the list. Otherwise all messages will
# end up being roughly /trunk/ or /tags/, which gets a bit boring.
- for my $dirpath (keys %most_dirs) {
+ for my $dirpath (keys %dirs) {
if ((length($topdir) < length($dirpath)) &&
- ($max <= $most_dirs{$dirpath})) {
- $max = $most_dirs{$dirpath};
+ ($max <= $dirs{$dirpath})) {
+ $max = $dirs{$dirpath};
$topdir = $dirpath;
}
}
More information about the Pkg-perl-cvs-commits
mailing list