Our SVN server has recently moved servers (from serverA to serverB). I did a "relocate" in Eclipse for the repository and moved it to serverB. SVN has been uninstalled from ServerA. When syncing everything is fine, however upon "update" I get the following in the console:
No connection could be made because the target machine actively refused it.
svn: Can't connect to host 'serverA.mysite.com': No connection could be made because the target machine actively refused it.
So, somehow there is a reference to the old server stored somewhere, how can I find & change it?
I guess it's somewhere in the entries files of your WC (working copy). To find references to serverA.mysite.com, utilize the help of grep (in the root of your WC):
grep -rni --include "entries" "serverA.mysite.com" .
If you're on Windows, you might install cygwin or wingrep to do the work for you.
One of the possible solution is that your project tree is using "externals" feature with explicit urls.
In that case, you'll have to go through your properties and patch them (something like)
svn propget svn:externals folder > ext.txt
cat ext.txt | sed -e 's/ServerA/ServerB/' > ext_patch.txt
svn propset svn:externals -F ext_patch.txt folder
It should have been done while migrating the depot by your admin however, when the deport was migrated, with a similar regexp on the raw dump. The previous proposition is good for patching live development codeline, but won't patch your existing tags, which became broken.
Note that if you don't know about svn:externals (convenient way to handle external dependencies), my response does not concern you.
EDIT : added link to svn doc for externals, added sample code for patching, added exaplanations
Related
I have to add a file in a project in the svn repository. What is the best method to add a file? And I have to run that file through command line and for that I need the location of the svn repository. How do I find the location of the SVN repository? I tried svn info and I got an error stating '.' is not a working copy.
The Problem is, the ones who installed the svn are not available. And I need to know the location of the repository to run a file through the command line.
Much thanks.
You need to ask your fellow developers or repository administrator what your repository location is. You should already have the project checked out, in which case you are already using a working copy that is linked to it and you don't need to do any more to point at the right location.
As for how to add an item, that will depend on what client you're using. In Subclipse, it's Team -> Add. In TortoiseSVN, it's TortoiseSVN -> Add. On the command line, it's svn add <filename>
It sounds like you have no experience with Subversion. You would do well to read the fine manual before you get yourself into trouble.
I'm currently helping to maintain a project for a client remotely. I'm the only developer ergo some of my unorthodox approaches/thinking.
the problem
The client is using Visual Studio 2010 + Team Foundation Server for their source control. I am working on a Mac over VPN and have tried several approaches to make committing to their TFS workable. I've tried TFS plugin for Eclipse with no luck (VPN really hoses the connection to TFS). Currently I am having to do a full "checkout for edit" through a virtual machine to the TFS, then transferring the project over the VPN to overwrite those files. Not a sustainable solution to say the least.
the solution?
I'm wondering if there is a way to:
get a list of changed files from GIT (I think this is the solution
(How to list all the files in a commit?)
then use that list as a means to go in and fetch those file, maintaining their folder structure
from there I can do my dump over
VPN into the VM that has the project mapped in TFS.
Or if there is something I've overlooked or hadn't thought of, please do recommend them, I'm all ears.
First, I'm assuming you are running the VM on or near the TFS server, not on your Mac. If not, you can just share a directory using VMware/VirtualBox and edit away on your Mac...
It sounds like you could achieve what you want with plain old Git. If you:
Create a bare repository on the VM (git init --bare)
Add a post-receive hook to copy the files from the master branch (for example) into the TFS directory, overwriting merrily (http://git-scm.com/book/en/Customizing-Git-Git-Hooks)
Initialise your local copy of the source as a Git repository (git init)
Add the remote repository. Assuming it's a Windows box you can use an SMB shared folder over the VPN so your remote is "local" as far as Git is concerned. (git remote add tfsserver file:///Volumes/tfsmount/code
Your first push will be expensive (but you could prepopulate the remote repo to get around that), but subsequent pushes would be just the changesets. The post-receive hook would then take care of updating the files, and you're laughing.
Of course, you then get to impress them with how amazing Git is, get them to migrate, and your problem goes away forever :).
Update: Here's a link which describes these steps in more detail, under the guise of updating a remote website: http://toroid.org/ams/git-website-howto.
I am working on a Java project in Eclipse and I use SVN to commit various versions of it in the repository. However I have noticed, that when I delete a class and I then commit the project, the old class is still included in the latest committed version of the project. Is there any way to prevent the SVN from maintaining classes which have been actually deleted?
Update: The same problem comes out when I rename a class and then I try to commit the new version of the project. It keeps both classes and stores both on the repository version. How can I prevent it from storing the old ones? I appreciate deeply any help bacause I would not like in any case to store it spoiled with the old classes.
If you use an Subversion for Eclipse like SubClipse then deleting a file in Eclipse will automatically schedule the file for deletion on next commit.
If you use a Subversion client outside of Eclipse you will have to delete the file using that client and then refresh the project in Eclipse after the file is gone from your working copy.
You need to also delete the class in svn as well, something like:
$ svn rm path/to/class.java
You can also remove the file using Eclipse, assuming that you have the svn plugin installed. Make sure that you select the file when you are committing your changeset, otherwise the deletion won't be sent to the server.
Update: Answering the update to the question
$ svn mv path/to/OldClass.java path/to/NewClass.java
Or, as Martin mentioned, ensure that your have your subversion plugin in eclipse properly configured, then it will also do the svn rm and svn mv commands for you.
SVN needs to know about any changes for all files and folders that are controlled by SVN (i.e. that are put under version control). It is easy to detect file changes, but it is not easy to detect rename and delete operations. If you just delete a file (using your operating system tools), SVN will warn you about a missing file.
For these operations you must use the corresponding SVN commands. SVN is best learned, when doing it manually with all those SVN commands (at first).
Using a SVN client makes it a little easier for you. For example, if you use TortoiseSVN, you can right-click a file and choose "SVN delete" for doing both, deleting the file and communicate it to SVN. Same for renaming.
The same is done by using a SVN plugin in Eclipse (Subclipse or Subversive, for example). If you then use Eclipse for deleting or renaming a file, the plugin will also do the operation and communicate it to SVN.
Keep something in mind: When deleting or renaming files (and/or folders) - using SVN commands, of course - you should always do a SVN update prior to SVN commit. Otherwise you might get an error about a revision problem.
I'm trying to get an install of Mercurial setup at work to evaluate it with our legacy code. The "server" I'm currently using is simply a desktop running Windows XP with SP3 on our intranet. The "client" install is on my local desktop, also running Windows XP with SP3. (I'm also using TortoiseHG on both machines.)
The web server is running at http://localhost:8000, and I can view the repository in a browser. But, when I try to detect outgoing changes to the repo, I get an HTTP 404 error. I can see the request show up in the server's log, so I'm pointing to the right location, but it shows GET http://host:8000/reponame?cmd=capabilities HTTP/1.1 404. No matter what settings I change, I can't seem to get the client to successfully execute a command against the repo. Does anyone have an idea why this wouldn't be working?
I have a similar setup, and I had similar problems.
I use the following command to run my HG serve (it's in a batch file):
hg.exe serve --prefix mercurial --address 123.12.1.1 --port 8008 --web-conf hg-web.conf --accesslog hg-access.log --errorlog hg-error.log
In the hg-web.conf I have:
[web]
style = default
allow_push = *
push_ssl = false
[paths]
my-repo = c:\hg\my-repo
With this setup, I can access my repository by accessing url http://ip:port/mercurial/my-repo
I can push without a problem.
Try this setup and I hope it helps you resolve your problem.
Well, when I start internal server in my TortoiseHG (for single repo, Repostory - Start Web-server from Workbench main menu)
Server window tells 'Running on localhost:8000', but really server listens on all interfaces (netstat -na shows TCP 0.0.0.0:8000 0.0.0.0:0 LISTENING)
On clone-edit-commit in fork and testing outgoing (from THG directly) I see
% hg --repository Z:\clone outgoing http://10.1.14.94:8000/
comparing with http://10.1.14.94:8000/
searching for changes
changeset: 39:c57a9357ec55
tag: tip
user: I
date: Fri Mar 08 17:00:05 2013 +0600
summary: Test-change
Some times ago I also pulled|pushed from|to these Mercurial repos from my another host. Server config is trivial and all was done inside TortoiseHG settings.
My [web] section in mercurial.ini (and nothing more)
[web]
port = 8000
encoding = UTF-8
allow_archive = bz2, gz, zip
style = gitweb
(push disabled now, work in pull-only mode)
PS: TortoiseHg version 2.7.1 on Windows XP SP3
Push means to move a changeset from one repo to another. You haven't stated that you made two separate clones of the repo, then try to push from A to B. So let's assume you're confused here, and talk about that confusion: Imagine I try to push from my own repo to an hg serve instance running against my own repo. That's like trying to phone myself to tell myself something.
Secondly, if you're really trying to push from A to B, and there really are changes in A that need to get to B, then, your actual problem is probably that you haven't got the URL of the repository input correctly into your GUI tool, which is Tortoise HG, I assume. Try it again from the command line while you're learning. If you get an error post the error here: hg push http://myserver:8000
The first time I tried Mercurial, after a long history of using Subversion, I had come to think I needed a "server" component more than I actually did. In subversion the server is where commits happen. IN mercurial, commits happen locally, and when you push to the remote (perhaps central) server, then the other people on your team see your changes. This is the big difference. I asssume you're trying to push, because commits happen locally. If you're confused about the difference between a commit and a push, then I suggest you look at http://hginit.com/
As far as setting up a server, there are three fairly easy options I can recommend:
"hg serve" from the commandline, as shown by other answers. Easy, and for temporary use only. Perfect for learning.
Install Mercurial inside Apache (easier than installing Mercurial inside IIS) for a permanent web-server with full authentication and perhaps encryption. If you use hgwebdir instructions on the Mercurial wiki it should take you about an hour. If you use the pre-built solutions, it should take much less time. I used Bitnami's pre-built solutions for windows and got one up in 5 minutes recently. Bitnami makes available installers that will get python, apache, mercurial, and other stuff, all installed and working together in what they call a "stack" (bunch o stuff that already works).
Here's the really brilliant solution. Use the free private web repositories at BitBucket.org. Free for public (open source) and private (small teams and personal) use, and quite cheap for large teams. Admin effort for you? No more than logging into a website. And you're done.
When I switch to another branch or tag I can't browse the available options in the repository. Subclipse says
Could not find a repository
svn: No repository found in 'svn://foo.com'
The repository is actually at svn://foo.com/bar. I can fetch the branches if I type in the full address by hand but it'd be nice to be able to choose from all available options. How do I tell Subclipse where the repository root is?
Is bar a top level folder on the filesystem of the server?
If not, check that the server has been started correctly by specifying:
svnserve -d -r /path/to/repository/root
In this example, the full path to your repo would be /path/to/repository/root/bar.