summaryrefslogtreecommitdiff
path: root/ACE/bin/ChangeLogEditor/SVNFileLocator.pm
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/bin/ChangeLogEditor/SVNFileLocator.pm')
-rw-r--r--ACE/bin/ChangeLogEditor/SVNFileLocator.pm38
1 files changed, 30 insertions, 8 deletions
diff --git a/ACE/bin/ChangeLogEditor/SVNFileLocator.pm b/ACE/bin/ChangeLogEditor/SVNFileLocator.pm
index 246b9dc9c7f..55a8674af81 100644
--- a/ACE/bin/ChangeLogEditor/SVNFileLocator.pm
+++ b/ACE/bin/ChangeLogEditor/SVNFileLocator.pm
@@ -30,23 +30,45 @@ sub locate {
my(@removed) = ();
my(@conflicts) = ();
my(@unknown) = ();
- my($nul) = ($^O eq 'MSWin32' ? 'nul' : '/dev/null');
+ my($error) = undef;
+ my($err) = $self->tmpnam('cle_svn.err');
- if (open($fh, "svn diff @dirs 2> $nul |")) {
+ if (open($fh, "svn status @dirs 2> $err |")) {
while(<$fh>) {
my($line) = $_;
- if ($line =~ /^Index:\s+(.*)/) {
- if (-r $1) {
- push(@modified, $1);
+ if ($line =~ /^([A-Z\s\?])([A-Z\s])[A-Z\s][\+\*\s][A-Z\s][A-Z\s]\s+(.*)$/) {
+ my($content) = $1;
+ my($property) = $2;
+ my($file) = $3;
+
+ ## Subversion differs from CVS in that it will print paths with
+ ## windows style back-slashes instead of forward slashes.
+ $file =~ s!\\!/!g if ($^O eq 'MSWin32');
+
+ if ($property eq 'M' ||
+ $content eq 'M' || $content eq 'A' || $content eq 'R') {
+ push(@modified, $file);
+ }
+ elsif ($content eq 'D') {
+ push(@removed, $file);
+ }
+ elsif ($content eq 'C' || $property eq 'C') {
+ push(@conflicts, $file);
}
- else {
- push(@removed, $1);
+ elsif ($content eq '?' && index($line, $err) == -1) {
+ push(@unknown, $file);
}
}
}
close($fh);
+
+ $error = $self->process_errors($err);
+ }
+ else {
+ $error = "Unable to run svn with error redirection.";
}
- return \@modified, \@removed, \@conflicts, \@unknown;
+
+ return \@modified, \@removed, \@conflicts, \@unknown, $error;
}