RE: How to detect new CVS dirs

"Arthur Barrett" <[email protected]>
Newsgroups gmane.comp.version-control.cvs.general
Message-ID <[email protected]>
Hi Peter,

What version client, and what version of server?  CVS 1.12 and CVSNT 2.5/2.8 have commands that older releases like CVS 1.10 do not.

Let me ask a fundamental question: why?

I ask this because I've often seen complex technical questions disguise a perfectly simple requirement that is solved a different way by CVS.

Software that detects changes in the repository, and advises users of this is quite common.  And commonly done poorly.  eg: Eclipse 'syncronise' and Oracle JDeveloper.  At least in the case or Oracle, the JDeveloper team did contact us at some point to ask suggestions of how to do it 'better'.  And I applaud you too for asking.

Technically my answer is that commitlog is the way to achieve this.  ie: when the server receives a change, it can trigger some event (typically sending an e-mail) and client apps can use that information, or query that information to get the result.  Typically this answer is not well liked.  Developers of GUIs often want something like what you are asking for, i.e.: oh just run command xyz and it'll tell you....

So here are some more technical thoughts:

1. you could use a variation of 'cvs log' to find all  changes between two points in time - the time your sandbox was last updated and the current time.

2. you could use 'cvs rls' to get a listing of a directory and compare it to your own directory.

3. try to avoid complex 'cvs -n ' cases - or at least test them thoroughly.  I mostly work on CVSNT (forked from CVS several years ago to support additional features), and I know that in many cases cvsnt 'cvs -n' does not do what it is advertised to do.  In fact we only 'support' a couple of specific cases of 'cvs -n up' since we consider it an 'outdated/deprecated' way to 'list modules'.  After 7 years and about 7 million downloads we've only ever had 1 person notice - and they were a CVS developer (GUI) not a 'person using CVS'.  My point?  'cvs -n' is not widely used and therefore probably not widely tested.


Regards,



Arthur Barrett




-----Original Message-----
From:	[email protected] on behalf of Peter Toft
Sent:	Thu 07/07/2011 7:45 AM
To:	Info cvs
Cc:	
Subject:	How to detect new CVS dirs

  

Hi all 

I have a small brain-teaser for the CVS-gurus.... 

Assume
that I "pto" have a CVS module checked out, and the user "donald" have
the same module checked out - 

both on HEAD version. Then "donald" adds
two dirs (Donald/ + Scrooge/) and one file (Scrooge/McDuck) 

 mkdir
Donald 

 mkdir Scrooge 

 echo "money" > Scrooge/McDuck 

 cvs add
Donald Scrooge 

 cvs commit Donald Scrooge 

 cvs add Scrooge/McDuck 


cvs commit -m "Money makes the world go around" Scrooge/McDuck 

My
question to you is how can "pto" detect what "donald" did - WITHOUT
changing the files locally. 

Part of the question is solved by running


 cvs -q -n update -AdP 

However now it gets a bit more blurry.... 

I
will see the directories "Donald" and "Scrooge" in my stderr output 


cvs update: New directory `Donald' -- ignored 

 cvs update: New
directory `Scrooge' -- ignored 

well - I kinda dislike this, since a
real "cvs update -AdP will prune the empty "Donald" away i.e. I cannot
see  

why "cvs -q -n update -AdP" should show this. Comments on this?


The other issue is that I cannot see the file "Scrooge/McDuck" with my
"cvs -q -n update -AdP". 

Clues to get that information - again without
actually modifying the local files of me? Comments? 

I can solve this
by first doing an actual update of the two dirs, and see what I get -
and then remove the  

two dirs, but I would like to solve this with
that strategy. 

Best 

Peter Toft 

-- 
Peter Toft,
PhD
http://petertoft.dk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.