git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cvsserver: fix legacy cvs client and branch rev issues
@ 2007-06-16 18:50 Dirk Koopman
  2007-06-17  8:19 ` Frank Lichtenheld
  2007-06-17  8:31 ` [PATCH] cvsserver: always initialize state in argsplit() Frank Lichtenheld
  0 siblings, 2 replies; 8+ messages in thread
From: Dirk Koopman @ 2007-06-16 18:50 UTC (permalink / raw)
  To: git; +Cc: Dirk Koopman

Early cvs clients don't cause state->{args} to be initialised,
so force this to occur.
Some revision checking code assumes that revisions will be
recognisably numeric to perl, Branches are not, because they
have more decimal points (eg 1.2.3.4 instead of just 1.2).
---
 git-cvsserver.perl |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 5cbf27e..0a4b75e 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -1813,11 +1813,14 @@ sub req_annotate
 # the second is $state->{files} which is everything after it.
 sub argsplit
 {
+    $state->{args} = [];        # need this here because later code depends on it
+                                # and for some reason earlier versions of CVS don't
+                                # satisfy the next condition on plain 'cvs update'
+
     return unless( defined($state->{arguments}) and ref $state->{arguments} eq "ARRAY" );
 
     my $type = shift;
 
-    $state->{args} = [];
     $state->{files} = [];
     $state->{opt} = {};
 
@@ -1906,11 +1909,13 @@ sub argsfromdir
 
     # push added files
     foreach my $file (keys %{$state->{entries}}) {
-	if ( exists $state->{entries}{$file}{revision} &&
-		$state->{entries}{$file}{revision} == 0 )
-	{
-	    push @gethead, { name => $file, filehash => 'added' };
-	}
+        # remember that revisions could be on branches 1.2.3.4[.5.6..]
+        # not just a recogisable "numeric" 1.2
+        if ( exists $state->{entries}{$file}{revision} &&
+             !$state->{entries}{$file}{revision} )
+        {
+            push @gethead, { name => $file, filehash => 'added' };
+        }
     }
 
     if ( scalar(@{$state->{args}}) == 1 )
-- 
1.5.2.1

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

end of thread, other threads:[~2007-06-17 21:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-16 18:50 [PATCH] cvsserver: fix legacy cvs client and branch rev issues Dirk Koopman
2007-06-17  8:19 ` Frank Lichtenheld
2007-06-17  9:10   ` Dirk Koopman
2007-06-17 10:37     ` Frank Lichtenheld
2007-06-17 16:53       ` Dirk Koopman
2007-06-17 17:20         ` Frank Lichtenheld
2007-06-17 21:27       ` Martin Langhoff
2007-06-17  8:31 ` [PATCH] cvsserver: always initialize state in argsplit() 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).