I am currently trying to create a pre-commit hook that prevent user to tag a version of code with external that are not tags.
I am just trying to figure out a way to get the external that are specify in a transaction but cant figure out how. The command svnlook dont seem to be able to return anything that remotely look like externals modification. And with the svn command it seem to be the transaction that I am unable to specify. I have no idea what command to use in my pre-commit hook. I am currently in windows but making a python script to be able to test this on our linux server.
What I tested so far is the following :
svnlook propget C:\TestReposLocal svn:externals <== Give me error something is missing
svn propget svn:externals C:\Test <== Give me externals but I cant figure out how to get this from a transaction to place in a pre-commit hook.
In my repository (C:\TestReposLocal) I have one external that is the trunk of another repository. This repository is displayed with the svn propget command but I need to know with the current transaction in a pre-commit if this external is something else than a Tag.
Any help would be gladly receive.
Tnx
This just work for me
Well, I can't see really your trouble-point here
svnlook
Edit
OK, I see: additional details is needed here. For tests and experimenting I used open repository Proving Ground for externals on Assembla, which have PEG-ed revision in tags and not PEG-ed in trunk. In order to use svnlook locally I just svnrdump'ed it into local repository.
Tag 1.0.1 was created with r7
where:
rep
is relative path to repository on local filesystemtags/1.0.1/
is path inside repository, for which I previously know, that it should have definition-r 7
is revision, which I want to testTag was created from trunk, in which external is not binded to specific revision
You'll have to see difference in specification now
WARNING: format of externals-definition will be different in case of using ancient (pre 1.4) SVN-clients and can be slightly different (can't recall exact details) in case of using CLI-version of SVN or SVN-integration from IDE (definitions above I created with TortoiseSVN), but it will be your part of job
dirs-changed
subcommanddirs-changed
for commit into tagsdirs-changed
for commit into other locationyou can
|grep tags
in good OS, do some tricks in Windows, operate according to resultsPS: Don't forget replace
-r
with-t
on production and store transaction-id+repo-path, which you'll get as parameters for hook