[cvsnt-dev] change proposal - edit flags in branches

Zsolt Branyiczky brazso at easymail.hu
Mon Jul 3 11:47:42 UTC 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.


Hi,

if one has to use a SCC2CVS interface, because the used IDE supports 
just SCC, but one insists on CVS repository as a source control, there 
can be a problem with exclusive checkouts of objects in different 
branches. Usually SCC supported IDEs use exclusive checkouts (only one 
developer can edit an object at the same time). SCC2CVS interfaces 
implement this function as a "cvs edit -x", placing an exclusive edit 
flag on the object to be checked out. It does work until there is not a 
single branch is used. If there are more branches, unfortunately CVS 
does not distinguish the edit flags, and a second checkout of the same 
object in a different branch simply overwrites the first edit flag. My 
proposal is altering CVS code to cope with this situation.

File named fileattr.xml stores the edit flag in the repository. In the 
example below user daboczyg checked out exclusively object 
n_transactionex.sru in the branch HEAD.

<file name="n_transactionex.sru">
     <editor name="daboczyg">
       <exclusive />
       <hostname>daboczy1gerg</hostname>
       <pathname>C:\work\pulika\pb\pulika\base_pulika</pathname>
       <tag>HEAD</tag>
       <time>Fri Jun 30 06:12:25 2006 GMT</time>
     </editor>
     <watcher name="daboczyg">
       <temp_commit />
       <temp_edit />
       <temp_unedit />
     </watcher>
</file>

then user brazso checkeded out the same object in branch b1_17_0 (label 
#2), and the edit(or) flag is simply overwritten:

<file name="n_transactionex.sru">
     <editor name="brazso">
       <exclusive />
       <hostname>branyiczky2z</hostname>
       <pathname>C:\work\pulika\pb\pulika\base_pulika</pathname>
       <tag>b1_17_0</tag>
       <time>Mon Jul  3 10:21:35 2006 GMT</time>
     </editor>
     <watcher name="brazso">
       <temp_commit />
       <temp_edit />
       <temp_unedit />
     </watcher>
     <watcher name="daboczyg">
       <temp_commit />
       <temp_edit />
       <temp_unedit />
     </watcher>
   </file>

Using my proposed modification after the second checkout the file tag 
contains both edit flags,

<file name="n_transactionex.sru">
     <editor name="brazso">
       <exclusive />
       <hostname>branyiczky2z</hostname>
       <pathname>C:\work\pulika\pb\pulika\base_pulika</pathname>
       <tag>b1_17_0</tag>
       <time>Mon Jul  3 10:21:35 2006 GMT</time>
     </editor>
     <editor name="daboczyg">
       <exclusive />
       <hostname>daboczy1gerg</hostname>
       <pathname>C:\work\pulika\pb\pulika\base_pulika</pathname>
       <tag>HEAD</tag>
       <time>Fri Jun 30 06:12:25 2006 GMT</time>
     </editor>
     <watcher name="daboczyg">
       <temp_commit />
       <temp_edit />
       <temp_unedit />
     </watcher>
     <watcher name="brazso">
       <temp_commit />
       <temp_edit />
       <temp_unedit />
     </watcher>
</file>

and of course edit command handles correctly the repeated editor flags. 
The modified cvsnt has been used at my firm for a couple of months, 
there was no problem with it.

The following files were modified:
src/edit.cpp, modification in method editor_set
fileattr.cpp, new method fileattr_newnode to create a new node in xml
fileattr.h, new method fileattr_newnode to create a new node in xml

If the proposed modification is too serious compared to the operation of 
the original cvs, then it should be enabled/disabled with a new switch 
of command edit. There is already a similar 'w' switch (although I could 
not figure out what it does), perhaps my modification could be switched 
off with it.

Perhaps this proposal is marginal for a normal CVS user, but a poor 
SCC2CVS user (where exclusive chekouts are used heavily) is a must.

If the CVSNT community including the respectable authors find it useful, 
we may discuss it more thoroughly here, and of course on request I can 
send the differences of the altered files.

Regards
Zsolt Branyiczky

ps. I do not wish to alter and recompile the cvsnt source at each new 
cvs version release, that is why I would like to commit my modification 
into the source :)


More information about the cvsnt-dev mailing list