The Linux Page

local delete, incoming edit upon update

Today I tried to move an SVN folder to another.

In my first attempt, I tried to copy the folder to a sub-folder that was not in SVN. The result is that the move failed, but nothing seemed to change in the SVN environment.

So I tried again, this time making sure that the destination folder would be an SVN folder.

The second time, however, it failed. The move instruction reported a conflict... Then the svn commit would not work. The SVN system was thinking that I changed something with the first svn mv as the failure did not clear the conflict.

svn mv a tmp/a-1.x        # fails saying tmp/ is not part of SVN
svn mv a branches/a-1.x   # error about some conflicts...
svn branches/a-1.x        # works fine
svn commit a              # conflicts, need resolution
svn resolve --accept=working a
svn commit a              # accepted, it was fixed!

The svn resolve is generally the way to go to resolve all conflicts, although at times you may want to emit some other commands first (including a backup of your SVN environment if you think it can be that bad.) In my case here, I had a copy of the data that was just checked in successfully, so I wasn't too worried.

The help page for the resolve instruction:

svn help resolve
resolve: Resolve conflicts on working copy files or directories.
usage: resolve --accept=ARG [PATH...]

  Note:  the --accept option is currently required.

Valid options:
  --targets ARG            : pass contents of file ARG as additional args
  -R [--recursive]         : descend recursively, same as --depth=infinity
  --depth ARG              : limit operation by depth ARG ('empty', 'files',
                            'immediates', or 'infinity')
  -q [--quiet]             : print nothing, or only summary information
  --accept ARG             : specify automatic conflict resolution source
                            ('base', 'working', 'mine-conflict',
                             'theirs-conflict', 'mine-full', 'theirs-full')

Global options:
  --username ARG           : specify a username ARG
  --password ARG           : specify a password ARG
  --no-auth-cache          : do not cache authentication tokens
  --non-interactive        : do no interactive prompting
  --trust-server-cert      : accept unknown SSL server certificates without
                             prompting (but only with '--non-interactive')
  --config-dir ARG         : read user configuration files from directory ARG
  --config-option ARG      : set user configuration option in the format:
                                 FILE:SECTION:OPTION=[VALUE]
                             For example:
                                 servers:global:http-library=serf

In case of a folder conflict, the only --accept option that works is 'working'.

More info: Turtoise SVN.

Reply to comment | The Linux Page

There's certainly a great deal to find out about this subject. I love all of the points you have made.