Let’s say I have script.py. When I’m branching this using svn copy I want to append a line to the top of the file.
Is this possible to do? Or can it not be done?
So
svn copy -rHEAD file:///svn/repo/trunk/script.py file:///svn/repo/branches/script.py
(Add line to the top of the branched file)
svn commit -m "Branching script.py"
Should be easy!
The flavour of
svn copyyou have chosen will do the copy from one repository location to another repository location atomically. In that case yoursvn commitis not necessary.You have two choices:
switch) modify the script, checkin, ORsvn copy . $DEST_URL. This will take the state of your working copy and create a new branch for you.More automation is not possible in a clean way, because modifying hook scripts on the repository/server side are considered evil by the Subversion developers.