-1

Requirement

Changes will be made to the REPO directory and this should get updated to wc(working copy) as opposed to the normal way of WC > REPO.

Senario:

My svn repo- /var/www/svn/drupal

My checkout-dir/working-copy- /var/www/html/drupalsite

So I've done:

  1. edited post-commit hook to contain: "/usr/bin/svn update /var/www/html/drupalsite"

  2. I won't make any change to svn WC. I'll make changes to svn REPO- /var/www/svn/drupal.

  3. After changes are made to svn repo, run "svn commit /var/www/html/drupalsite". This will trigger the post-commit hook. This inturn will run "svn update /var/www/svn/drupal" and thus my WC will get updated with the changes of REPO.

Query

a. Would the above steps 1-3 help achieve my 'Requirement'?

b. I'd need advise on how to test if the above setup works successfully or not. I'm at loss about the success of steps 1-3 the reason why query(a) is present. This is a bit more of a concern for me.

NB: I'm new to subversion. Whatever I've configured till now have been done by reading articles online. Reason for query (b) is because I'm not into development. It seems to be a php drupal website and I happen to be setting it up. So I'm not aware as to how to make a "PROPER" change in REPO so that it gets reflected in WC. If reflected, my configs are right and the team can start on development. I manually put a random file/folder into REPO dir for seeing a change in WC and ran steps 1-3 but was of no avail and later on learned that it was NOT the way to make a change to a REPO.

Pleas advise. Thanks

1
  • Are you sure you understand SVN basics The way to make a change in the "repo" is to checkout -> <change> -> commit. Maybe you can elabourate on why you want this to happen..
    – Karthik T
    Nov 30, 2012 at 4:58

2 Answers 2

1
  1. You can't make changes in repository directly - it's database, not "mirror of real tree"
  2. You can't execute "strange", bad commands (svn commit /var/www/html/drupalsite )and wait and get good expected from good commands results

Your workflow ("Site as WC, updated by hook with commits from another WC") will work, when you'll have fixed workflow

How it must work

  1. Create (or have) SVN-repository at path /var/www/svn/drupal
  2. Define placement of own Working Copy (hereinafter WC-Work), in which you'll make changes of code (can be same host, which contain Repo and site, or or any other, from which you can reach Repo)
  3. Depending on the choice of WC-Work location, configure and run SVN-server on Repo host (svn:// or http:// for remote access) may be needed. Detect and remember URL of Repository (hereinafter REPO-URL)
  4. Convert /var/www/html/drupalsite into Working Copy (hereinafter WC-Site) of your repository: svn co REPO-URL
  5. Protect .svn dir of WC-Site with .htaccess rule
  6. Prepare WC-Work: svn co REPO-URL
  7. Add post-commit hook to repo (you hook is acceptable starting point)
  8. Work-work-work in WC-Work
  9. Commit changes from WC-Work
  10. Check state of site

Areas of improvement

For p.3: you can define user of WC-Site as read-only user, which can't commit to site under any conditions

For p.7: hook may publish to WC-Site revisions only from user of WC-Work, only some URLs maybe have to be published (more than one, which was checkouted initially and if it's correct - WC-Site have to be relocated before update), in case of "Single point of publish" policy: commits outside of publish-point can be ignored (if only trunk promoted, we can do nothing for commits into branches|tags)

1
  • Thanks for your great effort and due consideration in explaining things in such detail. Really appreciable ! Great work and thank you once again!
    – user492160
    Dec 4, 2012 at 0:03
0

Just do a diff - see svn diff.

Alternatively get a notebook.

Also see trunk and branch - http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.diff.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .