[cvsnt] Re: Uservariables not expanded in commitinfo file

Scott Lehman slehman at Spectralink.com
Fri Mar 24 04:39:06 GMT 2006


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.


Tony,

Here is a diff of triggers/info_trigger.cpp that is needed to get user
variables to work.

1640c1640,1643
<                               uservar_t::const_iterator i =
gen_info.uservar.find(tmp.c_str());
---
>                 uservar_t::const_iterator i;
>                 for (i = gen_info.uservar.begin();i !=
gen_info.uservar.end(); i++)
>                     if ( !strcmp(i->first,tmp.c_str()) ) break;
>
1645c1648
<
cur+=gen_info.uservar[tmp.c_str()];
---
>                                               cur+=i->second;
1647c1650
<
cur+=auto_escape(gen_info.uservar[tmp.c_str()],'\\');
---
>
cur+=auto_escape(i->second,'\\');


Some things to point out:

1) std::map.find() does not do string compares.  I would suggest not
storing raw pointers in a map to avoid just such a bug.

2) Once the map iterator i has found a entry you get the value with
i->second not map[key].  The latter will reset the value to the default
constructor for the type of the map.

3) there is also a bug that causes any variable delimited with {} to
consume the following space if there is one.  I have not had time to fix
that one yet. 

Thanks, scott

-----Original Message-----
From: cvsnt-bounces at cvsnt.org [mailto:cvsnt-bounces at cvsnt.org] On Behalf
Of Tony Hoyle
Sent: Monday, March 20, 2006 2:33 AM
To: cvsnt at cvsnt.org cvsnt downloads at march-hare.com @CVSNT on Twitter CVSNT on Facebook
Subject: Re: [cvsnt] Re: Uservariables not expanded in commitinfo file

Scott Lehman wrote:
> Tony,
> 
> Any idea why cvsnt server is not expanding user variables?  Is there
> some logging that will show what is happening?  I have tried the cvsnt
> client (command line) and cygwin's cvs client (again command line).
> 
> What release does expand user variables?
> 
User variables were a new feature added when the backends were rewrtten 
around 2.5.02ish (cvshome had them on the client but not the server for 
some reason, so they were pretty useless).  Primarily they're expanded 
into the RCS files using custom keywords definitions, although they 
should work in loginfo as well.

Tony
_______________________________________________
cvsnt mailing list
cvsnt at cvsnt.org cvsnt downloads at march-hare.com @CVSNT on Twitter CVSNT on Facebook
http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt https://www.march-hare.com/cvspro/en.asp#downcvs



More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook