On 20 Mar 2000, at 14:38, Adam Bidema wrote:

> 
> I am trying to make it so I can lock a branch. I have searched through the
> code to find a centralized place where I can determine the branch a user is
> using on the server side, but can not find where I would add this code.
> 
> Any help in finding this place, or another way to lock a branch would be
> much appreciated.
> 
> Thanks,
> --Adam
> 

I recently installed the Alternate Info patch by John P Cavanaugh 
<[EMAIL PROTECTED]>. Which you should be able to find in the 
archives of this mailing list.

That gives you a different format for the information passed to your commitinfo 
and taginfo scripts, which includes the branch name (or 'main' for the trunk).

I then added a bit of code to my perl commitinfo script which checked another 
file to see if the branch was 'locked'.

I don't use this extra information for my taginfo script.

There are a couple of bugs in the patch, which I had to correct.

The first was a sprintf string with two many replaceable params.

Index: src/tag.c
===================================================================
RCS file: /spower/repository/cvs/ccvs/src/tag.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- src/tag.c   2000/02/25 17:40:42     1.2
+++ src/tag.c   2000/03/03 10:53:05     1.3
@@ -441,7 +441,7 @@
        type_stat=(delete_flag ? "BT_DEL" : force_tag_move ? "BT_MOV" : 
"BT_ADD");
     else
        type_stat=(delete_flag ? "RT_DEL" : force_tag_move ? "RT_MOV" : 
"RT_ADD");
-    sprintf(argBuf,"%s:%s:%s:%s",p->key,type_stat,p->data);
+    sprintf(argBuf,"%s:%s:%s",p->key,type_stat,p->data);
        run_arg (argBuf);
     }
     }


The second, concerned with adding new files was ok on linux but seg faulted 
on Solaris 2.5

Index: src/commit.c
===================================================================
RCS file: /spower/repository/cvs/ccvs/src/commit.c,v
retrieving revision 1.3
diff -u -r1.3 commit.c
--- src/commit.c        2000/03/03 10:53:04     1.3
+++ src/commit.c        2000/03/20 10:41:02
@@ -1144,7 +1144,7 @@
     { tag_stat="main"; }
     else
     { tag_stat=li->tag; }
-    sprintf(argBuf,"%s:%s:%s:%s",p->key,type_stat,tag_stat,li->rev_old);
+    sprintf(argBuf,"%s:%s:%s:%s",p->key,type_stat,tag_stat, ((li->rev_old) ? 
li->rev_old : ""));
        run_arg (argBuf);
     }
     }

I can send you my scripts (and the one I wrote to manipulate the branchlock
file) if you wish.

Mike

--
Mike Little
Share what you know. Learn what you don't.

ServicePOWER Business Solutions Ltd
home: [EMAIL PROTECTED]

Reply via email to