[cvsnt-dev] Re: building + status/release woes

David Somers dsomers at trevezel.com
Sun Aug 1 14:04:10 BST 2004


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


> I modify the output name.  You need to do this as the two DLLs aren't
> compatible and it's not unusual to have a VC6 compiled version on a
> system (really it should also be different for debug and release also as
> they're different).  I never got around to filing a feature request with
> openssl to have their build do this automatically but it probably needs
> doing.

Its probably a good idea to file that feature request.

> >
> > So, I guess that in release, the vn_rcs should be "1.2" and not NULL.
> >
> vn_rcs only matters if you're connecting to the remote server.  It may
> be set my other means though.

Hmmm...

It looks like status/release, although both use Classify_File, do so in
subtly different ways.

Status seems to be mainly a server thing... the client sends the request to
the server, which runs Classify_File on the server, generates the messages,
which is sends to the client to display.

Release seems to be mainly a client thing... the client runs Classify_File
locally.

I think the difference happens because Classify_File calls Version_TS, and
this does things slightly differently depending upon whether its running on
the client or server side. Of course, I could be completely wrong and be
barking up the wrong tree.

> If all you're getting is T_REMOVE_FILE then just put that in the 'not
> modified' list on the switch statement...

OK. Here is a patch.

I've changed some of the behaviour of release. If the file is not
up-to-date, it now displays (unless -q/-Q is specified) a quick status
message (so you can see just what files have been altered). Please note that
now it becomes clear that things are quite strange between status/release...
for a locallly modified file, status gets Classify_File = T_MODIFIED,
whereas release gets Classify_File = T_CONFLICT. So, perhaps the
interpretation of these status codes needs to be changed depending upon
whether its server or client side oriented?

Meanwhile, I'm adding some trace code to vers_ts.c to see if I can shed some
further light.

cvs diff -u release.c (in directory W:\omz13\projects\cvsnt\cvsnt\src\)
Index: release.c
===================================================================
RCS file: /omz13/projects/cvsnt/cvsnt/src/release.c,v
retrieving revision 1.17.2.3
diff -u -r1.17.2.3 release.c
--- release.c	3 May 2004 14:50:53 -0000	1.17.2.3
+++ release.c	1 Aug 2004 12:53:21 -0000
@@ -40,10 +40,45 @@

 #endif /* SERVER_SUPPORT */

+
+char* CtypeToSZ(Ctype s)
+{
+	switch (s)
+	{
+	case T_UNKNOWN:
+		return "T_UNKNOWN";
+	case T_CONFLICT:
+		return "T_CONFLICT";
+	case T_NEEDS_MERGE:
+		return "T_NEEDS_MERGE";
+	case T_MODIFIED:
+		return "T_MODIFIED";
+	case T_CHECKOUT:
+		return "T_CHECKOUT";
+	case T_RESURRECT:
+		return "T_RESURRECT";
+	case T_ADDED:
+		return "T_ADDED";
+	case T_REMOVED:
+		return "T_REMOVED";
+	case T_REMOVE_ENTRY:
+		return "T_REMOVE_ENTRY";
+	case T_UPTODATE:
+		return "T_UPTODATE";
+	case T_PATCH:
+		return "T_PATCH";
+	case T_TITLE:
+		return "T_TITLE";
+	default:
+		return "T_????";	/* this shouldn't happen ;-) */
+	}
+}
+
 /*ARGSUSED*/
 static int release_fileproc (void *callerdat, struct file_info *finfo)
 {
 	int status, q;
+    char *sstat;

 	q=really_quiet;
 	really_quiet = 1;
@@ -51,13 +86,63 @@
 			    1, 0, NULL, 0, 0);
 	really_quiet = q;

+	if (trace)
+		printf("  File `%s' status %d (%s)\n", finfo->fullname, status,
CtypeToSZ(status));
+
+	if (!quiet && status!=T_REMOVE_ENTRY && status!=T_UPTODATE)
+	{
+		char *buf;
+		switch (status)
+		{
+		case T_UNKNOWN:
+			sstat = "Unknown";
+			break;
+		case T_CHECKOUT:
+		case T_RESURRECT:
+			sstat = "Needs Checkout";
+			break;
+		case T_PATCH:
+			sstat = "Needs Patch";
+			break;
+		case T_CONFLICT:
+			sstat = "Unresolved Conflict";
+			break;
+		case T_ADDED:
+			sstat = "Locally Added";
+			break;
+		case T_REMOVED:
+			sstat = "Locally Removed";
+			break;
+		case T_MODIFIED:
+			sstat = "Locally Modified";
+			break;
+		case T_NEEDS_MERGE:
+			sstat = "Needs Merge";
+			break;
+		default:
+			sstat = "??? classify error";
+			break;
+		}
+		buf = xmalloc (strlen(finfo->update_dir) + strlen (finfo->file) + strlen
(sstat) + 80);
+		if(quiet) // If we're not displaying the 'looking in....' messages, show
the relative file instead
+		{
+			char *buf2 = xmalloc(32 + strlen(finfo->file) + 80);
+			sprintf (buf2, "%-.32s/%s",finfo->update_dir,finfo->file);
+			sprintf (buf, "%-49s\t%s\n", buf2, sstat);
+			xfree(buf2);
+		}
+		else
+			sprintf (buf, "File: %-17s\tStatus: %s\n", finfo->file, sstat);
+		cvs_output (buf, 0);
+		xfree (buf);
+	}
+
     switch (status)
     {
 	case T_CHECKOUT:
 	case T_PATCH:
 	case T_NEEDS_MERGE:
 	case T_CONFLICT:
-	case T_REMOVE_ENTRY:
 	case T_MODIFIED:
 	case T_ADDED:
 	case T_REMOVED:
@@ -66,6 +151,7 @@
 		break;
 	case T_UNKNOWN:
 	case T_UPTODATE:
+	case T_REMOVE_ENTRY: /* fudge! */
 		break;
 	}

@@ -213,7 +299,7 @@
 			tmp=xmalloc(strlen(thisarg)+1024);

 			if(modified_files)
-				sprintf (tmp,"You have [%d] altered files in this repository.\n",
modified_files);
+				sprintf (tmp,"You have [%d] altered %s in this repository.\n",
modified_files, modified_files==1 ? "file" : "files");
 			else
 				*tmp='\0';


***** CVS exited normally with code 1 *****


Regards,

David



More information about the cvsnt-dev mailing list