开发者

Using Subversion working directly on the repository

开发者 https://www.devze.com 2022-12-19 22:11 出处:网络
I have been struggling with Subversion for some time, thinking it was beginners problems that would go over.Though today I have been thinking through it, and realizethat the problem is the way it is e

I have been struggling with Subversion for some time, thinking it was beginners problems that would go over. Though today I have been thinking through it, and realize that the problem is the way it is embedded with the client files, and that you work on the server db through these embedded files.

So I wonder if:

  1. Is it perhaps just as easy to work directly towards the repository, but that the commands are "more hidden" (not mentioned in popular books)?
  2. Are the any GUI clients that can work without these embedded files.(16Feb: Using Subversion in a way that would difficult or hard to figure out otherwise)
  3. Are there perhaps any relatives of Subversion that is "better" in this respect?

Before I used the VSS client GUI application, and it was much easier (though I do want to move on to something more modern). To take an example I have a Drupal installation where most of the files are third party files that I need to keep track of. To get started I needed to check everything in and then out. Most changes are new versions from the Drupal project. (I know there are scripts to handle third party code, but I still think it must be cumbersome, especially when this code is spread in several directories).

Another thing I often has done in the past is to have the same source files in several VSS databases. (16feb:Which would be diff开发者_开发问答icult in Subversion because the embedded .svn directories refers to one directory)

**13 Feb ** Seems some people don't quite understand, so: The main problem is if you do a lot of changes without using the svn commands, especially when you replace directories as when you replace 3d party code, since then you loose the .svn directories.

If you plan ahead you can use svn_load_dirs.pl as described in http://svnbook.red-bean.com/en/1.5/svn.advanced.vendorbr.html Though what I want is to be able o do arbitrary things with my files, and then diff and commit towards the repository. I can't see how to do this with tortoise or svn commands.

16Feb: Another problem that I think many people are running into when they start with Subversion is if you don't want to do the "initial checkout" - say you want to do changes on a production site.


I've used CVS for a while, tired of it and wanted something better. I've started to use SVN but then discovered Bazaar. It's the best tool for both beginners and advanced users with both great GUI and command line. It supports many different workflows and you can use it with or without a server, alone or in a command. It's fast, cross platform, integrates with launchpad code hosting, supports subversion repositories and tons of other features and plugins. It's used by Ubuntu, MySQL, Emacs and many others. Bazaar is a free and open source software by Canonical, and a part of the GNU Project. For more details see "Why Switch to Bazaar?" and Bazaar home page.


I would recommend using Git, Bazaar, or another VCS which doesn't require you to tell it when you move sources around. I know Git best, so I'll say regarding it that you don't need to tell it when you've moved files and you don't need to maintain VCS-specific directories in each of your own directory. There are lots of complicated things you can do, but you don't have to expose yourself to the complicated bits :).


SVN consists of two parts:

  • the repository - server's side
  • the working copy - part of repository copied to your local machine

Part of svn operations are server side operations, others are operating on working copy. Normally, server side commands operate repository's URL and local (working copy) commands take a local path as an argument.

You don't mandatory need a working copy, to perform server side operations, as: - browse repository - view log history - preview individual files or folders - diff branches - preview properties - etc.

you can use either svn command line client or any SVN GUI client - Tortoise Svn http://tortoisesvn.tigris.org/ is the most popular one for Windows - to perform both server side and client side operations.

given your repository URL is http://yoursvnserver/repo, the commands would look like:

  • svn ls http://yoursvnserver/repo
  • svn log http://yoursvnserver/repo
  • svn diff http://yoursvnserver/repo/branches/project1 http://yoursvnserver/repo/branches/project2
  • etc.


If you try to do these 'arbitrary things' from Visual Studio you could use AnkhSVN (VS integration like VSS) or VisualSVN (Uses TortoiseSVN for most repository operation and adds its own features in VS on top of that).

See AnkhSVN vs VisualSVN and AnkhSVN versus VisualSVN. (Looks like a duplicate answer to me)

Added later Which would you rather use: VisualSVN or AnkhSVN?.


I am not completely sure that I understand your question, but if it is client gui tools for Subversion you need, have a look at Tortoise Svn http://tortoisesvn.tigris.org/


SVN is a different beast in the sense how working copy relates to the 'server'. Here is how I would group some revision systems in this perspective in order of reliance on the 'server':

  1. TFS, Perforce
  2. SVN, CVS
  3. Mercurial, Git


Seems using the --force option with add can resolve most issues.

If .svn files are lost I think the best solution is to put them back (from the repository for example), but I haven't found discussion on or script-support for this technique.


If you use Subversion 1.7, there is only one .svn directory in the top working directory, rather than having them spread out in all the subdirectories. This makes Subversion more similar to git and others, and may make it easier for you to move things around in the subdirectories.


If you are tied to using Subversion, then Bazaar (bzr) is actually great as a Subversion client. For your particular problem, it has a command that may be useful: bzr mv --auto, which tries to track changes even as you move things around manually.

If you have the choice to use whatever tool you like, git handles renames well, identifying renames automatically if you just do git add -A, which adds any new files and removes any removed files since last check-in.

0

精彩评论

暂无评论...
验证码 换一张
取 消