SVN: rename in a Repo browser while saving a working copy

I renamed the branch to the repo and casually continued to work with the same working copy (which was extracted from this branch before renaming). When I later tried to commit, I noticed that the working copy is still aimed at the old path. I want to commit the changes in a new way in the repo, and, of course, keep the story, etc.

Does SVN have an elegant way?

I read about the Switch and Relocate commands, but I'm not sure if any of them fully satisfies my problem (the described scenarios are different), and I was always a little scared about trying the commands in SVN ... Does anyone have experience with these teams?

I think I can solve the problem, for example, check the renamed project for another working copy and then overwrite it with the changes (everything except SVN metadata). I can also write some script that finds all the occurrences of the old path and brutally changes them to the new paths, but I decided that there must be some kind of SVN command for this.

Thanks!

+6
source share
2 answers

If the repository URL changes, you need to move your working copy. The switch command is used to change the branching of your working copy points. The concepts themselves are perfectly clear.

But you are talking about a project , and I think that the problem you are facing: you will not find references to projects in the Subversion documentation, because this is not the concept of Subversion.

There are two main ways to implement projects in Subversion:

  • Create a repository for each project:

    • https://example.com/svn/foo/trunk
    • https://example.com/svn/bar/trunk
  • Create a branch for each project in the same repository:

    • https://example.com/svn/projects/foo/trunk
    • https://example.com/svn/projects/bar/trunk

So, when you say “rename the project”, you mean either “rename the repository” (# 1) or “rename the branch” (# 2), and the solution:

  • svn relocate to link your working copy to the repository
  • Either svn update to make changes to the working copy (if this change is in the working copy directory tree) or svn switch to change the branch of your working copy of points (if you deleted the current branch efficiently).

Update . My advice so far is that you start from scratch. Rename your current working copy, check out the new one, and reinsert the pending changes using a regular file comparison tool such as WinMerge or Kdiff3 (or TortoiseMerge). There is no use trying to figure out what exact changes you made if they are not obvious from the magazine.

In the future ... You do not need to study the full Subversion book, but you should become familiar with the basic concepts, especially. when they turned out to be a problem in your daily work.

+6
source

You tried to use the svn switch.

 switch --relocate OLDURL TO NEWURL 

which should solve your problem.

0
source

Source: https://habr.com/ru/post/913839/


All Articles