info-cvs
[Top][All Lists]
Advanced

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

How to detect if a file is new


From: Crisp, Norman (Norman)
Subject: How to detect if a file is new
Date: Thu, 22 Nov 2012 18:50:03 +0000

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]