info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How to detect if a file is new


From: Crisp, Norman (Norman)
Subject: RE: How to detect if a file is new
Date: Thu, 22 Nov 2012 20:08:59 +0000

Please ignore my previous post.

I found I can achieve this by looking for the 3rd field being a "0" instead of 
looking for the 4th field being the "dummy timestamp"

Norm. 

-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Crisp, Norman (Norman)
Sent: Thursday, November 22, 2012 1:50 PM
To: address@hidden
Subject: How to detect if a file is new

I was wondering if anyone knows if there is a way upon commit to detect if the 
file being committed is a new file.
I wish to implement a process by way of a script run through commitinfo that 
will block a file from being committed only if it is new, and being added into 
a certain part of the repository tree.

I can see that once a file has been created, and then cvs add applied, the 
entry for the new file gets put in the CVS/Entries file as something like this: 
 /test-file.txt/0/dummy timestamp/-ko/

Locally I can detect it is new by looking for "dummy timestamp"

# CommitFile=test-file.txt
# CommitType=`grep "^/${CommitFile}/" CVS/Entries | cut -d/ -f4` # echo 
$CommitType # dummy timestamp

But when this actually runs on the server something magical must happen as my 
return is always blank.

Thank you

Norm.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]