[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Conflict when merge tries to add

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2006-07-13 23:06:28 CEST

As was recently pointed out by Andrew Reedick on the users list,
currently, if 'svn merge' tries to add a file and that results in a
conflict (say there was a different file with the same name added on
both a branch and the trunk, and then you try and merge the branch
into the trunk) we print out an A, not a C. There's a trivial change
to fix that, but it causes some test failures, so I figured I should
bring it up here to make sure that we really should print C. I mean
it makes sense to me, but clearly someone at some point decided that
printing A was correct, otherwise they wouldn't have wrote the tests
that confirmed it...

Just an oversight?

Here's the diff to fix the problem (minus fixes to merge tests, those
are trivial enough though):

When a merge of an added file results in a conflict display a C,
not an A.

* subversion/svn/notify.c
  (notify): Check for conflicts when a merge results in an add, and
   alter output accordingly.

Index: subversion/svn/notify.c
--- subversion/svn/notify.c (revision 20646)
+++ subversion/svn/notify.c (working copy)
@@ -86,8 +86,16 @@

     case svn_wc_notify_update_add:
       nb->received_some_change = TRUE;
- if ((err = svn_cmdline_printf(pool, "A %s\n", path_local)))
- goto print_error;
+ if (n->content_state == svn_wc_notify_state_conflicted)
+ {
+ if ((err = svn_cmdline_printf(pool, "C %s\n", path_local)))
+ goto print_error;
+ }
+ else
+ {
+ if ((err = svn_cmdline_printf(pool, "A %s\n", path_local)))
+ goto print_error;
+ }

     case svn_wc_notify_restore:


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jul 13 23:07:03 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.