bugLibCVS Perl Implementation - Bugs: bug #14186, Figuring out the "original...

 
 

bug #14186: Figuring out the "original directory" in Command.pm

Submitted by:  Alexander Taler <dissent>
Submitted on:  Wed 17 Aug 2005 04:39:22 PM UTC  
 
Category: NonePriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Release: NoneFixed Release: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

Alexander Taler <dissent>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

No Changes Have Been Made to This Item

Back to the top


Powered by Savane 3.1-cleanup