How to detect if a file is new
"Crisp, Norman (Norman)" <[email protected]> Thu, 22 Nov 2012 18:50:03 +0000
| Newsgroups | gmane.comp.version-control.cvs.general |
|---|---|
| Message-ID | <755AF814786B004F9837F99BA903C0A41383F77C@US70TWXCHMBA07.zam.alcatel-lucent.com> |
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.