Menu
  • HOME
  • TAGS

SVN Merging and tree conflicts “local add, incoming add upon merge”

Tag: svn,svn-merge

I'm trying to follow the release branching model described at http://svnbook.red-bean.com/en/1.7/svn.branchmerge.commonpatterns.html, but on attempting to do the merge I get a merge conflict.

# Normal SVN Structure
svn-testing2> ls -l
total 12K
drwxrwxr-x 3 xxx yyy 4.0K Jan 13 17:28 branches/
drwxrwxr-x 3 xxx yyy 4.0K Jan 13 17:28 tags/
drwxrwxr-x 3 xxx yyy 4.0K Jan 13 17:28 trunk/

# Create & commit some  data
svn-testing2> echo "line1" > trunk/file1; svn add trunk/file1; svn commit -m "created file1 " trunk/file1
Adding         trunk/file1
Transmitting file data .
Committed revision 2.

# Create the release branch
svn-testing2> svn copy trunk branches/release
A         branches/release
svn-testing2> svn commit -m "created release branch" branches/release
Adding         branches/release
Adding         branches/release/file1

Committed revision 3.

# Make & commit a change to trunk
svn-testing2> echo "line1-file2" > trunk/file2; svn add trunk/file2; svn commit -m "created file2" trunk/file2
A         trunk/file2
Adding         trunk/file2
Transmitting file data .
Committed revision 4.

# Attempt to merge the change to trunk:
svn-testing2> cd branches/release/
svn-testing2/branches/release> svn merge ^/trunk
--- Merging r2 through r4 into '.':
   C file1
A    file2
Summary of conflicts:
  Tree conflicts: 1
[email protected]:~/svn-testing/svn-testing2/branches/release> svn st
 M      .
      C file1
      >   local add, incoming add upon merge
A  +    file2

I can fix this with

svn-testing2> svn resolve --accept=working *

But it seems wrong that I have to do this.

If I then apply a "hotfix" (e.g. create "release/file3") to my release branch, how do I port that back to trunk? If I merge "release" into "trunk" it merges OK but when merging "trunk" back to "release", I get another local add, incoming add upon merge conflict on e.g. "file3"

I'm not trying to "reintegrate" a feature branch, as these are both long running branches.

It's frustrating that the SVN redbook (which is generally excellent) describes this common branching pattern, with no worked examples of what commands to actually run!

What exactly do I need to run to follow this branching pattern without all these incorrect merge conflicts? Or are there any worked examples of this branching pattern anywhere - I can't find any!

Best How To :

This is due to your copy operation being done completely on the client-side. This operation does not include any merge tracking information and so when you attempt the merge it tries to add file1 on top of itself. This behavior is described in the disclaimer in the help for the copy command:

> svn help copy

copy (cp): Copy files and directories in a working copy or repository.
usage: copy SRC[@REV]... DST

  SRC and DST can each be either a working copy (WC) path or URL:
    WC  -> WC:   copy and schedule for addition (with history)
    WC  -> URL:  immediately commit a copy of WC to URL
    URL -> WC:   check out URL into WC, schedule for addition
    URL -> URL:  complete server-side copy;  used to branch and tag
  All the SRCs must be of the same type. When copying multiple sources,
  they will be added as children of DST, which must be a directory.

  WARNING: For compatibility with previous versions of Subversion,
  copies performed using two working copy paths (WC -> WC) will not
  contact the repository.  As such, they may not, by default, be able
  to propagate merge tracking information from the source of the copy
  to the destination.

If you change the copy to a server-side copy, the merge will succeed:

# This is the difference, the copy happens on the server
> svn copy ^/trunk ^/branches/release2 -m "Creating release2"
Committed revision 5.

# Update our working copy to get the new release
> svn update branches
Updating 'branches':
A    branches\release2
A    branches\release2\file1
A    branches\release2\file2
Updated to revision 5.

> echo blah>trunk\file3; svn add trunk\file3; svn commit -m "created file3"
A         trunk\file3
Adding         trunk\file3
Transmitting file data .
Committed revision 6.

> cd branches\release2
> svn merge ^/trunk
--- Merging r5 through r6 into '.':
A    file3
--- Recording mergeinfo for merge of r5 through r6 into '.':
 U   .

Get list of changed files from remote server git

git,svn,github

Use GitHub's email service: Emails sent by the email service are different from regular notifications; they don't show up on the web, and they provide different contextual information. Email services send the following information: The name of the repository where the commit was made. The branch a commit was made...

Checkout a complete Subversion tree excluding tags/ and branches/

bash,svn,version-control,cmd,branch

What you need is SVN sparse directories. You'll want a skeleton structure, and fill in only the trunks when you get to them. Something like (Bourne shell syntax): svn co --depth empty protocol://path/to/repo/root/ for in in some intermediate dirs; do svn up --set-depth empty $i; cd $i; done svn up...

Using git for remote and svn for local

git,svn,tortoisesvn

There are multiple possible answers depending on what you are trying to do. If you want to avoid Git because you don't want to learn a new tool, then I can only advise to reconsider. Git is the most widely used SCM these days, the basics are not that hard...

SVN ignoring.txt does not seem to work in Zend Studio

svn,ignoring

Did some more research and testing. It turns you are right they are no standard for using ignoring.txt. But there is a way to more easily manage files that you want SVN to ignore. Here are two alias's that I created to help me to more quickly manage my ignore...

How to correctly set an external path on SVN?

svn,tortoisesvn,svn-externals

This is the dialog from TortoiseSVN that you're having difficulties with: Here, Local Path refers to the file or folder relative to the folder that has this externals property set on it. So, if I had a folder at ^/trunk/Externals that I wanted to exist here as well, I'd set...

Cannot use Subclipse after installing

eclipse,svn,subclipse

You get that context menu for 'Team' if the current project is not being shared. So right click on the Project and use 'Team > Share Project...' to set up the project in SVN....

SVN commit messages are not getting updated

svn,tortoisesvn

I think that TSVN can use some cache for data fetched from repository. There is no hash or timestamp in SVN API to check if some commits changed so the only option to find out that if recop has changed is to get it from the repo. Try to use...

Oracle QSL Developer -> connected to subversion -> show “quick diff” in Worksheet

oracle,svn,oracle-sqldeveloper

Two things. if you're using our subversion extension, use team > subversion > pending changes. Then you can see the differences specifically in the subversion panels w/o having to mess with the history tab in the SQL Worksheet. or, in the sql worksheet, SPLIT the editor - right-click on the...

one eclipse install not displaying utf8

java,eclipse,svn,utf-8

Workspace-wide encoding is configured here (Windows -> Preferences -> General -> Workspace): If it is not working as expected, the project probably overrides the settings (Right click on project -> Properties -> Resources): ...

How to tell git-svn that files are NOT binary

git,svn,migration,git-svn,gitattributes

The binary attribute "macro" is a shorthand for -diff -merge -text (see gitattributes docs). In opposite to the the text-attribute which influences the line ending conversion of files between the repository and the working copy version, the diff and merge-attributes do not influence how Git stores files. The latter two...

svn - checkout error from Kuali Student

svn,kuali

I think it was a temporary problem. I just ran the command you gave and successfully checked out revision 77743

Migrating from SVN to GIT with tags/trunk/branches/release with a extra folder

git,svn,github,git-svn,tortoisegit

I think the should be also tags. It depends mainly in how you used them. Take a look to the Atlassian tutorial about migrating from Subversion to Git. It's quite straight and clear: https://www.atlassian.com/git/tutorials/migrating-overview. You can experiment, look what you get and if you don't like you can always start...

Apache Subversion pre-commit to restrict files

apache,svn,hook,pre-commit

First - seems you incorrectly use svnlook. It should has parameters: svnlook changed ${REPOS} -t ${TXN} -t means 'read from transaction' and TXN - transaction name itself. Second - not sure if I understand correctly, but hook file should has name pre-commit not pre-commit.tmpl Third - pre-commit should has correct...

Missing information while migrating SVN repo from one server to another

svn,apache2,ubuntu-12.04

Try to access /home/user/svn/trunk locally with file: protocol Something like this: svn ls file:///home/user/svn/trunk Possible it show more clear error message....

In SVN is there a straighforward way to merge back each change individually?

svn,merge

You can use svn mergeinfo --show-revs eligible to find revisions to merge. And then use svn merge -c REV to merge each revision. Also check out the --accept option to merge. This may help you resolve issues with conflicting (binary) files automatically.

how to have svn fetch a file from another directory on updates?

svn

Subversion calls these types of relationships "externals". You just need to set the svn:externals property on the second directory so that SVN will pull down the external file when the second directory is updated. To set this property, run a command similar to this (on Windows): svn propset svn:externals "^/trunk/path/to/build.dll...

How to add a folder of a repository as a submodule to other repository using tortoiseGIT

git,svn,github,tortoisesvn,tortoisegit

It is not possible to add a folder of a repository as a submodule to other repository as GIT considers each state of repository as a checksum of 40 hexadecimal characters. It has no operations to track each folder in the repository as a single part.It treats the repository as...

Reverse Merge and svn:mergeinfo

svn,version-control,merge

I've given this further thought, and the whole premise seems flawed; our original idea was to discard both the original revision and the subsequent reverse-merge revision from the list of eligible revisions returned by mergeinfo but there is no guarantee that the subsequent revision (in which the reverse merge was...

SVN Update not applying. Despite files marked as out of sync

svn

You should: revert all changes and update working copy to revision which you start to modify (not HEAD!) replace modified files in working copy update working copy to HEAD In this case Subversion calculate difference made by colleague and apply them over your changes....

Jenkins job setup automation with SVN credentials

shell,svn,curl,jenkins,credentials

On an existing Jenkins server, create some credentials for your SVN server: These credentials are stored in the $JENKINS_HOME/credentials.xml file. You can copy this file on your VM with your script. Regarding your job, you just have to use the relevant credentials in the SVN section: ...

Team City - Get Revision Number of Last Successful Build

svn,teamcity

I've done this before to automate release notes from TFS by getting the commit comments between two revisions. There's two routes to achieving this, depending on if you use the build.vcs.number as part of your version number - If you do then you'd be able to obtain the build number...

how to commit file without keeping modification history on svn

svn

Is there another way to do it than to just delete file and save it again on svn? This is also doesn't helps. Subversion will keep all deleted versions forever. So, basically answer is - No. You can't manage files in such way. Well, actually onw way present -...

Show Log not showing all revisions

svn,revisions

After a lot of head-scratching while I was preparing this question, I concluded that this had to be a machine-specific issue, because on another machine all revisions were shown irrespective of the folder where I did "Show Log". I found out here that Tortoise caches log messages. Now when I...

searching for some content in a file accross multiple revisions [duplicate]

string,svn,revision-history

Svn has no direct support for this. If it's only one file this will work, albeit slowly. svn log -q <file> | grep '^r' | awk '{print $1;}' | \ xargs -n 1 -i svn cat -r {} <file> | grep '<string>' Fill in <file> and <string> A for loop...

Any way to specify the svn revision of externals in a Jenkins job?

svn,jenkins,svn-externals

The externals mechanism uses it's own specified revision. This is nothing to do with Jenkins. Even without Jenkins (through browser or your SVN client), if you try to checkout from your repository_main with specified revision, it will take the HEAD for repository_ext externals is an SVN property. It specifies 2...

Is there a way to verify a user name exists in SVN?

svn,user-accounts

SVN is version control. User access is performed by wrapper. It could be Apache, subversion server etc. but not SVN itself. We're talking about two different layers of OSI. SVN is application layer, user access is session layer.

After accidentally removing file and adding it back I can't compare anymore

svn,subversive

I solved it the following way: Made a backup copy of the file Reverted the local file in svn Copied the backup over the reverted file Now everything is back to normal. ...

Fix bad commit dates

svn,timestamp

I ended writing a script to fix it : #!/bin/bash LAST_COMMIT=$(svn info svn://XXX/ | grep -i rev | tail -n1 | grep -o -E '[0-9]+') echo "Ultimo commit ${LAST_COMMIT}" for COMMIT in $(seq 12190 $LAST_COMMIT) do FECHA_COM=$(svn propget svn:date --revprop -r $COMMIT svn://desarrollo01/) if [ $? -ne 0 ]; then...

SVN: do not commit specific line in specific file

svn,tortoisesvn,commit

No, this is not possible. Files that contain user/machine dependent settings should not be part of Subversion. Instead have your build instantiate the correct version from a template (that is controlled by Subversion).

Netbeans 7 does not recognize Subversion 1.8 working copy

svn,netbeans-7

Subversion 1.8 working copy won't be recognized by Subversion 1.7 client, that's why svn upgrade or a clean working copy checkout is required after upgrading from the client from Subversion 1.7 to 1.8. Therefore, make sure that your Netbeans instance supports Subversion 1.8

Inconsistent result of SVN diff command

svn,diff

Alas, you fell victim to the "Peg Revision Fallacy". Some time in its history, the file Request.java was replaced by another file of the same name. Therefore, you need to make sure that you also specific the correct peg revision when querying the repository, which is done by appending @revision...

How to change svn:externals from bash file non-interactive

bash,svn,svn-externals

Use svn ps svn:externals svn://hostname/branchname -F extenals.txt http://svnbook.red-bean.com/en/1.8/svn.ref.svn.c.propset.html...

Migrating a Subversion repository to Git and permanently removing part of it

git,svn

this is because you still have a reference on orange files due to remote/trunk reference on your svn repository. After cleaning you can perform a clone to be sure that you no more have pending references git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch orange/* orange" --prune-empty -- --all rm...

How can I skip special kind of files while cloning a remote subversion repository?

svn,svn-checkout

I guess, that mean checkout when say 'clone'? If you have all unwanted files in one directory, you can use sparse checkout (http://svnbook.red-bean.com/en/1.7/svn.advanced.sparsedirs.html). But if unwanted files scattered around repository, then... I don't think it is possible...

Git - xcode - single project multiple developer on LAN

ios,xcode,git,svn,git-svn

What Xcode sets up is a local repository that is specific to you, and your Mac. What you want is a central repository that developers can clone, so they can work in their own local copy of that repository. Each developer can push their committed changes to the central (origin)...

Remove a specific checkin revision from SVN code

svn

As explained in SVN book: Undoing Changes An extremely common use for svn merge is to roll back a change that has already been committed. Suppose you're working away happily on a working copy of /calc/trunk, and you discover that the change made way back in revision 303, which changed...

build.xml can not be found in openfire

eclipse,svn,openfire

To build OPenfire from source you need Apache-Ant. The build.xml is under OpenfireSRC/build. You can use this tutorial Build Openfire from source

Jenkins SVN on slaves

svn,jenkins,tortoisesvn,jenkins-plugins,jenkins-cli

Seems you has 2 installations of SVN. One 1.7 and secodn - 1.6 Execute in job echo %PATH% from jenkins job to see where 1.6 version can be installed. (or use which svn, if you use Linux) Then you can uninstall 1.6 or modify system PATH variable, so svn 1.7...

All libraries are showing error after updating SDK version to 24.3 in Android

android,svn,google-play-services,subclipse,android-sdk-tools

Finally I solved the issue by deleting two apis i.e API 22(Android M) and Tools. Don't know why the issue is coming after installing these APIs. After all I'm able to get R.java classes and recompile the apps. I have attached a image of both packages after deleting. ...

Is it possible to keep history of code moves between files in SVN?

svn

For move piece of code to new file I usually use next approach: copy file to new (svn cp ...) in new file remove all code except moved code in old file remove moved code piece Then (usually) blame for moved code will show correct authors....

Push git repository to remote subversion with history

git,svn,merge,git-svn

Yes, dcommit will preserve the history granted you have rebased (thus have no merge commits to be pushed). Username at svn for all revisions will keep the credentials of the pusher though.

Unable to understand Cruise Control build error

svn,windows-server-2008,cruisecontrol.net

Execute command from error (C:\Program Files\TortoiseSVN\bin\svn.exe log "http://xxx.xxx.....) from server which running CruiseControl and update question with reported error.

Why does the Jenkins SVN plugin give error E170001 when connecting to my VisualSVN server?

svn,jenkins,jenkins-plugins,visualsvn-server

In the user's Subversion folder (%APPDATA%\Subversion for Windows, ~/.subversion for Linux/Mac OS x) add http-auth-types=Basic to the global section of the servers file. Note that the case is different between Basic and basic. For me, VisualSVN reports the following list of authentication options that it supports: Negotiate NTLM Basic realm="VisualSVN...

SVN: Adding a new branch to the “Choose items” list

svn,version-control,tortoisesvn

Don't do "checkout" to add the folder. That is creating a new, nested working copy that is completely separate from your top-level working copy. Instead, use "update to revision..." and there will be another "choose items" button which you can use exactly as before when you first created your working...

How to `git add` non-recursively?

git,svn,recursion

Adding a whole complex directory hierarchy is an unusual thing to do (and certainly not something that happens as part of the usual git development workflow), so git doesn't have a special feature for it. You can always use an external tool to assemble a list of files you want...

How to unversion a folder in SVN?

svn

Look for .svn directories and remove them in the backup. These directories are hidden, so you should configure File Explorer to show hidden items. SVNBook | Creating a Working Copy: What is This .svn Directory? The topmost directory of a working copy—and prior to version 1.7, every versioned subdirectory thereof—contains...

Migrating Codeplex SVN to Git with git svn clone

git,svn,git-svn,codeplex,migrating

Try git svn clone https://mohid.svn.codeplex.com/svn mohid_code without argument -s, because mohid doesn't use standard layout. Also wait some time. First ~10 minutes looks like nothing hapens, because git try fetch revisions from 1 and first revision in mohid repo is 28559...

Using mergeinfo to compare branches with different roots

bash,svn

Just pass the revision range with -r starting from the second branch point. OP Comment: This makes the script look like this: echo "Checking if there are commits beyond the code freeze" svn log --xml --stop-on-copy $UAT|grep msg|cut -d\> -f2|cut -d: -f1|sort -u|while read branch do if [ "$branch" !=...

Changing root of SVN repository

svn

It seems you use wrong arguments to svn switch. The correct one should be simply svn switch http://server/svn/MyProject/trunk assuming your are currently in your local project directory. ...

subversion ignore nestered externals

svn,svn-externals

I am not aware that this is possible with svn. You could look into svn up --ignore-externals and see whether this helps. Alternatively, you can try to svn up --set-depth empty <dir> on those (external) directories you do not wish to update.