git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-cvsserver: added support for update -p
@ 2007-10-10 11:16 Jan Wielemaker
  2007-10-10 13:47 ` Johannes Schindelin
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Jan Wielemaker @ 2007-10-10 11:16 UTC (permalink / raw)
  To: Git Mailing List

[PATCH] git-cvsserver: added support for update -p
---
Hi,

Someone in our team uses "cvs update -p [-r rev] file" (somehow invoked
through TortoiseCVS). The patch below provides that. I think it is fine,
except that I don't know with wich other flags -p can be combined and
therefore when exactly this should be tested. Figured out that normal
CVS sends the file line-by-line preceeded by "M " using strace on the
client to a real CVS server.

	Enjoy --- Jan

 git-cvsserver.perl |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 13dbd27..987f4d6 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -956,6 +956,21 @@ sub req_update
             $meta = $updater->getmeta($filename);
         }
 
+	# if we have a -p we should just send the file
+        if ( exists ( $state->{opt}{p} ) )
+	{
+	    if ( open my $fh, '-|', "git-cat-file", "blob", $meta->{filehash} )
+	    {   while ( <$fh> )
+		{ print "M " . $_;
+		}
+		close $fh or die ("Couldn't close filehandle for transmitfile(): $!");
+	    } else
+	    { die("Couldn't execute git-cat-file");
+	    }
+
+	    next;
+	}
+
 	if ( ! defined $meta )
 	{
 	    $meta = {
-- 
1.5.3.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-10-11 21:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-10 11:16 [PATCH] git-cvsserver: added support for update -p Jan Wielemaker
2007-10-10 13:47 ` Johannes Schindelin
2007-10-10 14:26   ` Jan Wielemaker
2007-10-10 16:41     ` Johannes Schindelin
2007-10-10 17:27       ` Jan Wielemaker
2007-10-10 19:27         ` Johannes Schindelin
2007-10-10 20:00 ` Frank Lichtenheld
2007-10-11  8:45   ` Andreas Ericsson
2007-10-11 16:36 ` [PATCH] cvsserver: " Frank Lichtenheld
2007-10-11 16:52   ` Jan Wielemaker
2007-10-11 17:29     ` Frank Lichtenheld
2007-10-11 20:59   ` Johannes Schindelin
2007-10-11 21:07     ` Frank Lichtenheld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).