svn question

We live switching to the SVN (Subversion) variant control system at the job: we have our own local working duplicates, and the live server is definitely another working copy in the same repository. It works great, but there’s a problem that caused an enormous stir about weekly ago that pretty much caused an apocalypse. That scenario:

  1. Somebody edits a file to the live server without under-going SVN (i. e., they FTP it or something).
  2. Somebody employs the right workflow in addition to edits the document on his community working copy and commits it.
  3. Yet another person runs on your live server to help update the file towards latest in your repository.

What occurs is, instead in the update failing because of the two files come in conflict, SVN will take it upon by itself to just merge the 2 main files and create a diff of the effect. That’s all good and good, but most are PHP files over a live site, so the merge actually results in syntax errors in the file. The only fast solution is to delete the actual working copy’s file and redo that update, which just gives the version in the repository back with.

So, how can anyone stop SVN coming from automatically merging files on an update and instead please have it complain

POST argued this circumstance with co employees when subversion had been introduced. " svn update" is often a command that is used to be used to update your work with what other people have worked on. So, in impact, the behaviour everyone describe is what’s desired because you’re treating the internet server directory like a developers directory.

before doing a
svn update

you can do a
svn status

OR if you’re feeling dangerous plus don’t care precisely what someone did through ftp towards live site, you can do
svn revert –recursive.
svn update

POST argued that all people should push their own updates through svn, and no one should have the live site to the reasons you express above.

I understand that the workflow ended up being wrong (people modifying files without doing them)… but a revert would blow away any incorrect changes and ensure it is safe to redesign

Well, this is one of those cases where your tool isn’t really responsible. The workflow seriously isn’t only wrong in the sense that everyone is making changes not having committing, but in the sense that a copy in the trunk is running to the server. The checkout you desire running on your server, if it is just a production server, should always be a stable tag in the repository.

Nonetheless, that won’t save this specific issue from taking place. A simple script that could help with this:

Code:
#! /bin/bash
in the event -z svn rank grep " M"; then
svn up
in addition
echo " Modified local file. Aborting replace. Please manually repair this before looking to run an svn update avoiding conflicts. "
fi

The revert that kingmundi described destroys all nearby changes (i. e., changes that haven’t been committed towards repository). It does not remove files which have been added or files which might be not currently being tracked whatsoever.

ALTER: Another interesting option will be to make a neighborhood change check component to the login shell’s financial services. Assuming it appeared to be bash, something that could run SVN rank and output some sort of message as preceding, except in bright red is actually exclamation points before it, would end up being good. That approach, it isn’t merely when someone would go to svn up in which it’s displayed, it’s if he or she log in. It might be possible to ensure it is happen when these people exit, too, or possibly even whenever these people run a command (I don’t know for sure).

Bejesus, you could even wrap the many editing commands on the server with scripts that can warn the user to make sure they commit their particular changes.

Nonetheless, just about almost everything I’ve posted up to now relies on this being UNIX server, which it is probably not…

EDIT2: Incidentally, for learning with regards to SVN, this book appears to be great. I haven’t purchased it yet, but I’m thinking I will do so in the near future.

This entry was posted in Web Design and tagged , , , , , , , , , , , , , , , , . Bookmark the permalink.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *