tags:

views:

31

answers:

3

Hello,

svn 1.6.9

I have my development (dev) machine and a target testing machine (test)

However, If I make some changes on my dev machine, that should cause a conflict on the test machine when I update, as I have modified the same line code in the same file.

example

(dev)

main.c
void get_device(int device_id);

(test)

main.c
void get_device(int device_id);

Both have exactly the same. Now when I change the prototype of dev to this:

char* get_device(int device_id);

Then commit that change.

When I update on the test machine. Shouldn't it not cause a conflict as I have modified the same line of code? All I get when I update is the following:

U    main.c

Should it not show me that there is a line of code which is in conflict? Instead of just updating the line of code?

However, if I make some minor changes to the test machine, then I try and commit. Then it fails to commit. Then when I try and update it will then show me the conflict for changing void to char* in that line.

It seems to me if I change the same line of code, I want to be notified of any conflicts when I try and update.

Many thanks for any suggestions,

+1  A: 

This is expected (no conflicts, just update) if the main.c on the test machine is the same as the BASE. When you do 'svn update' on test, svn first checks if there is any local changes to main.c by comparing it against the BASE -- conflicts only occur when the local copy and HEAD make changes to the same part of the file (when comparing against the BASE).

Hope this helps.

Dasvid
+2  A: 

If SVN is able to merge changes, it won't cause a conflict. Conflicts usually arise when SVN does not have a good way of merging changes during an update, especially multiple changes to the same code at the same time.

In your case, a change was made in one place, and then updated in the other. This is not a conflict scenario.

Bernard
what would be a conflict scenario?
robUK
Here is a simple conflict scenario: Person A changes a line of code in a file and commits it. Person B does not update this file and is unaware of Person A's change. Person B changes the same line of code in this file. When Person B goes to commit their change, SVN creates a conflict since their change will overwrite the change Person A made. Now Person B is aware of Person A's change and can attempt to resolve this conflict.
Bernard
Almost correct, when Person B goes to commit his change, SVN notifies him that it can't commit, and that you should update. When updating the conflict is created.
Sander Rijken
@Sander: You are correct sir.
Bernard
+2  A: 

You can check for changes in the repository with

svn status --show-updates

The command does not alter your working copy.

You may have a look at the svn documentation regarding file states. A conflict only occurs if svn is not able to merge changes.

zellus