YorgZ
YorgZ

Reputation: 21

SVN Externals migration

I have an SVN repo with dozens of externals. All the externals are defined with reference to "old_svr". The repo was moved to a new server, "new_svr" and all the externals references must be changed to refer to "new_svr" instead of "old_svr".

Do do so: 1) I checked out the repo from new server as is, which means all the externals still point to "old_svr" 2) I cd in the top directory for my working copy and ran

svn propget -R svn:externals . > old_externals.tmp 3) I changed "old_svr" to "new_svr" in the file old_externals.tmp sed 's/old_svr/new_svr/g' old_externals.tmp > new_externals.tmp 4) I applied the new externals definitions to my working copy propset svn:externals -F new_externals.tmp 5) Commit the change svn commit 6) Update the working copy svn update

At this point I get lots of errors: A) svn: warning: URL 'svn://new_svr/path/tag/directory' at revision 123 doesn't exist B) There are still references to the old server svn: warning: Unknown hostname 'old_svr'

Questions: - how to effectively remove all the referencs to old_svr so that it does not come up anymore. - I do not know why for some externals directories (most of them go through fine) svn cannot find a proper version to update.

YorgZ

Upvotes: 1

Views: 1197

Answers (2)

Lazy Badger
Lazy Badger

Reputation: 97282

You have at least (at first sight) two errors and one methodological flaw:

  • syntax of svn ps is wrong for externals (and thus you'll not be able propset all in one command)
  • (possible small mistake) svn pg > file write file with empty line after each definition,-F for ps require "definition per line" and accept only # as comment-line
  • BIG FLAW - you didn't read commands descriptions carefully and ignored error-output

In short:

Your svn ps just do nothing (or you had another ps?!)

>svn ps svn:externals -F z:\externals.new
svn: E205001: Try 'svn help propset' for more information
svn: E205001: Explicit target argument required

Longer:

You must to use one (correct) propset for every definition (in current form, when externals are scattered over the repo)

You can to use one (correct) propset for all definition, if you refactor their definitions previously (good time for it anyway) and collect all definitions in one repository-node (LOCALPATH have to be changed in the process): for local folder /Data/Collection (link to externals) it's definition can be

Data - file:///Z:/Repo1/trunk/Collection Collection

(in scattered model)

. - file:///Z:/Repo1/trunk/Collection Data/Collection

(in concentrated /in trunk-root/ model)

with the identical final result (the same externals on the same node of repo-tree)

Upvotes: 1

bahrep
bahrep

Reputation: 30662

You should check your environment. Use up-to-date Subversion server and clients.

Beginning with Subversion 1.5, that was released years ago (in 2008), it was recommended to use repository-relative URLs in svn:externals. Using them helps in such cases because the URL to the repository can be changed and svn:externals modification not required. Check SVNBook | Externals definitions for more information on repo-relative URLs.

Upvotes: 0

Related Questions