[cvsnt] Binary with Keywords

Ian Epperson Ian at axiomdesign.com
Wed Aug 27 18:08:35 BST 2003


> -----Original Message-----
> From: Glen Starrett [mailto:grstarrett at cox.net] 
> 
> > So, I was wondering, is it possible to tell CVSNT that a file 
> > is binary, but
> > with keyword expansion enabled?  My old version (1.11.1.3 - 
> > 57j) doesn't
> > allow this, does the newer version?
> 
> It sounds like you're doing just the opposite of what the different
> options do (this is from memory, I don't normally use these directly):
> 
> Normal -kk: Allow keyword expansion, Do CR/LF translation
> Old data -ko: No keyword expansion, Do CR/LF translation
> Binary -kb: No keyword expansion, do NOT do CR/LF expansion
> Unicode (not even sure what that does)
> 
> So you want NO CR/LF translation but YES to keyword 
> expansion?  I think
> that's what you're asking, but I also don't think it does that.

We run with watch on.  This is often a hindrance, but would be helpful on
these type of projects where multiple users CANNOT work on the same file.
Indicating that the file is binary would prevent two people from
accidentally working on the same file at the same time.


> Looking at your statements, I'm a little confused still as to 
> *why* the
> indexing is getting hosed--is it because the relative positions in the
> file are changing with the keyword expansions??  If that is the case
> then you should just turn them off entirely and treat the 
> files as 'old
> data' or binary with no expansion.

OK, the gory details:

The language is graphical.  You drag symbols (like AND, OR, BUFFER) into the
workspace, then attach signals to them.  A very simple file is something
like this:

[symbol list]
 [symbol 1 - OR]
 signal inputs 1,2
 signal outputs 3
[signal list]
 1 "or_input_1"
 2 "or_input_2"
 3 "or_output_3"

Where there is a single OR symbol (ref 1 in the file) and 3 signals attached
to the inputs and outputs of the OR (refs 1-3 in the file).  Note that the
ref's are completely hidden from the developer, s/he just deals with the
names.  Note this is a bit of oversimplification - each symbol and signal
listing is much longer.

Then, turn two developers loose.  They both add symbols and signals, and for
each one, the next symbol is #2, and the next signal is #4.  Now, merging
the file, it looks like this:

[symbol list]
 [symbol 1 - OR]
 signal inputs 1,2
 signal outputs 3
 [symbol 2 - AND]   <- added by dev 1
 signal inputs 3,4
 signal outputs 5
 [symbol 2 - BUFFER]  <- added by dev 2 - same reference!
 signal inputs 3
 signal outputs 4
[signal list]
 1 "or_input_1"
 2 "or_input_2"
 3 "or_output_3"
 4 "and_input_2"      <- added by dev 1
 4 "buffer_output"    <- added by dev 2 - same reference!
 5 "and_output"

CVS thinks the merge succeeded - but this file doesn't work.  There are 2
different symbol 2s and 2 different signal 4s.  Trying to load this file
gives an error from the IDE and shuts it down.  There is no way to figure
out if the signal 4 referred to in the symbol is the and_input_2 or
buffer_output.  Also note that we usually name our signals for what they do,
not what they're connected to ;-)

We're able to use keyword expansion because some of the symbols use
parameters.  There is a symbol that generates a string, and in the file it
looks kinda like this:

[symbol 1 - INIT]
 signal input 1
 signal output 2
 parameter "Any text here!  So, $KEYWORD$"

We use that to give a revision text.


> > Also, if I do build a script to handle this issue, is there 
> > some way to have
> > it automatically run on the client or server for just this 
> > file type before
> > and after a merge?  Perhaps have it run for every commit 
> (keeping the
> > mergable version in CVS) then re-translating it to a useful 
> > version after
> > updates and merges?
> 
> I would imagine you could set up a postcommit script, then just alter
> the appropriate files.  Even if they aren't neatly in 1 
> module then you
> could loop through the files committed and massage only the necessary
> ones.

But I don't think there's a "pre-update" script.  Because of this issue, I
may want to lobby form a "pre-merge" and "post-merge" script if possible.
However, don't the merges run on the client?

 
> Regards,
> 
> Glen Starrett

Thanks much!


More information about the cvsnt mailing list