2
1
The title must sound strange but I'm trying to achieve the following:
SVN repo location: /home/flx/svn/flxdev SVN repo "flxdev" structure:
+ Project1
++ files
+ Project2
+ Project3
+ Project4
I'm trying to set up a post-commit hook that automatically checks out on the other end when I do a commit.
The post-commit doc explicitly lists the following:
# POST-COMMIT HOOK
#
# The post-commit hook is invoked after a commit. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-commit' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] REV (the number of the revision just committed)
So I made the following command to test:
REPOS="$1"
REV="$2"
echo "Updated project $REPOS to $REV"
However when I edit files in Project1 for example, this outputs "Updated project /home/flx/svn/flxdev to 1016"
I'd like this to be: "Updated project Project1 to 1016"
Having this variable allows me to specify to do different actions per project post-commit. How can I specify the project parameter?
Thanks!
Dennis
This may be better suited for stackoverflow.com – Daisetsu – 2010-12-22T19:25:34.870
The repository is
fixdev
,Project1
is just a path within. How would you handle commits that modify multiple projects in a single action? You just have to take the data you get, andsvn log
for details. – Daniel Beck – 2010-12-22T19:25:51.650@Daisetsu SVN can be used as a general purpose tool. How do you know that these projects are software development related (I know, they probably are)? If Visual Studio questions are acceptable, so is this. – Daniel Beck – 2010-12-22T19:28:20.523
I would suspect that you would have to make a call to
svnlook
with $REPOS, pass $REV as --revision, and parse out the results yourself to get what you are looking for. Theinfo
orcat
commands might give you the answer you are looking for, I'm a bit rusty on the details. – vcsjones – 2010-12-23T11:49:30.447@Daniel Beck, yes, you can version any file but the reason why I recommended stack overflow is because they probably have someone who has asked a question similar to this already, and a lot of the users over there really know SVN like the back of their hand. – Daisetsu – 2010-12-23T23:36:17.707
@Daisetsu Of course, you're right. I mistook your comment as suggestion that this might be off-topic for this site. – Daniel Beck – 2010-12-23T23:38:53.413