Wed 17 Aug 2005 04:39:22 PM UTC, original submission:
Command.pm handles generating the cvs client
requests. Part of this process is figuring out
the "original directory".
Right now, Command.pm pretends that the current
directory is the root directory of the CVS repo.
Another way to do this is to look for a CVS admin
directory in our current directory, and use the
contents of Repository for that. The included
patch uses that method.
One final method is to extrapolate a common
ancestor from all the other Directory requests
which were sent. It would be a lot of work though.
Patch to look for a "CVS/Repository" in the cwd:
--- Command.pm 2003-06-08 21:59:05.000000000 -0400
+++ Command.pm-patch-original-directory 2003-06-09
14:01:49.000000000 -0400
@@ -31,7 +31,7 @@
# Class constants
###############################################################################
-use constant REVISION => '$Header:
/cvs/libcvs/Perl/VCS/LibCVS/Command.pm,v 1.4
2003/06/09 01:59:05 dissent Exp $ ';
+use constant REVISION => '$Header:
/cvs/libcvs/Perl/VCS/LibCVS/Command.pm,v 1.3
2003/06/08 18:59:58 dissent Exp $ ';
###############################################################################
# Class variables
@@ -184,7 +184,7 @@
# Save bandwidth by only sending directory
requests once
my $dirs = $f->_get_repo_dirs;
if (!$dirs_sent{$dirs->[0]}) {
- $dirs_sent{$dirs->[0]} = $dirs->[1];
+ $dirs_sent{$dirs->[0]} = [ $dirs->[0],
$dirs->[1] ];
my $dreq =
VCS::LibCVS::Client::Request::Directory->new($dirs);
$client->submit_request($dreq);
}
@@ -212,17 +212,15 @@
# Send the original directory request
# This could be the current directory, or the
common ancestor of all the sent
- # directories. We use the root directory.
+ # directories.
# If it's already been sent with one of the
previous arguments, just resend
- # that one. If it wasn't already sent, we
should look in the /CVS Admin
- # directory to get the repository for the
current directory. But that
- # doesn't match our paradigm very well, and it
doesn't really matter, because
- # we know that none of the files we are
interested in live in the current
- # directory. So, we just send the cwd (".")
and the repository root.
+ # that one. If it wasn't already sent, we look
in the /CVS Admin directory
+ # to get the repository for the current directory.
- my $r_dir = $dirs_sent{"."} ||
$repo->get_root()->get_dir();
- my $origd_req =
VCS::LibCVS::Client::Request::Directory->new([".","$r_dir"]);
+ my $origd = ( $dirs_sent{"."}
+ ||
VCS::LibCVS::WorkingDirectory->new(".")->_get_repo_dirs());
+ my $origd_req =
VCS::LibCVS::Client::Request::Directory->new($origd);
$client->submit_request($origd_req);
### Send the command request
|