How to commit different svn branches without switching

I work on code, usually in trunk, but due to recent changes, I had to switch the workspace to a branch.

Is it possible to make any change in the connecting line while working in the branch without actually switching the project to the trunk

I basically want to commit changes to both the trunk and branch without switching back and forth again and again

+7
source share
3 answers

Short answer: No

This is why God created the svn switch in the first place. This allows you to change the main branch of the working directory without losing your work.

Think of it this way: how many times did a developer break something because they said to themselves, β€œHey, I don’t need to check this. Is this a minor change?”

Even if Subversion allowed you to do what you want, it would still be a bad idea. You basically make changes to the codebase without a real way to make sure that they work in the first place. This is why Subversion requires that you have a working directory before you can make changes * . How do you check your changes?

If you do not want to use svn switch because you do not want to lose your work, you can do the following:

  • Copy the entire working directory to another location, then use svn switch on one to make that tool.
  • Finish your work in your branch. Commit the changes and pay attention to the version number. Now either make svn co or svn switch to get a working copy of the trunk. Then use svn merge -r to merge your changes into the trunk. And, of course, check your changes before committing them.

* Subversion allows mkdir , cp , mv and rm to work directly with the URL, but basically it allows you to manipulate branches without having to create a working directory.

+6
source

Check the trunk in another folder.
Make changes to the trunk and check them. Then merge them with a branch and check merge.

0
source

You cannot commit the path outside the WC URL (see svn info WCROOT )

The above rule means that if the root of the WC is at a level that is the common parent of the branch and trunk, you can simultaneously make transactions in both locations (the branch and chest will be sub-dirs inside the WC). The common parent is the root of the repository, so as not to check the entire repo, you can play with the -depth and --setdepth commit / update options

0
source

All Articles