You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Mattias Engdegård <ma...@bredband.net> on 2013/04/14 12:57:27 UTC
Bug in conflict summary after partial resolution
If a file has both text and property conflicts, only resolving one of
them leads to an incorrect conflict summary message. Example:
$ svnadmin create repo
$ svn co file://$PWD/repo d1
$ svn co file://$PWD/repo d2
$ cd d1
$ echo a > f; svn add f; svn ps p x f
$ svn ci -m m
$ cd ../d2
$ echo b > f; svn add f; svn ps p y f
$ svn up
Updating '.':
CC f
Updated to revision 1.
Conflict for property 'p' discovered on 'f'.
Trying to add new property 'p'
but the property already exists.
<<<<<<< (local property value)
y=======
x>>>>>>> (incoming property value)
Select: (p) postpone, (mf) mine-full, (tf) theirs-full, (q) quit,
(h) help: p
Conflict discovered in file 'f'.
Select: (p) postpone, (df) diff-full, (e) edit, (m) merge,
(mc) mine-conflict, (tc) theirs-conflict, (s) show all
options: mc
Resolved conflicted state of 'f'
Summary of conflicts:
Text conflicts: 0 remaining (and 1 already resolved)
Property conflicts: 0 remaining (and 1 already resolved)
$ svn st
MC f
? f.prej
Summary of conflicts:
Property conflicts: 1
Resolve individual prop conflicts [was: Bug in conflict summary after partial resolution]
Posted by Julian Foad <ju...@btopenworld.com>.
I (Julian Foad) wrote on 2013-04-25:
> I (Julian Foad) wrote:
>> There is a second bug, closely related. If there are multiple prop
>> conflicts on the same node, they all get marked as resolved as soon
>> as you request any one of them to be marked as resolved. There is
>> incomplete API support for marking individual properties as resolved
>> so that may be hard to fix.
>
> How hard can it be to add full support for marking individual properties
> as resolved? I see two distinct levels to "full support".
>
> Firstly, to fix the bug in interactive resolution, support is needed in
> libsvn_wc to ensure that when a conflict resolver callback (called from
> libsvn_wc/conflicts.c) returns any kind of 'resolved' result for a
> property conflict, the WC should mark only that specific property as
> resolved. That would be enough to fix the interactive conflict resolution.
> I'm looking at how feasible this might be.
The answer is, it requires changes within libsvn_wc, but AFAICT it doesn't require any public or inter-library API changes.
The attached patch shows roughly what is needed, but is not finished and does not yet work properly.
Because it looks like it can be done within libsvn_wc, I am inclined not to rush to get this into 1.8.0, but to aim for 1.8.1 instead.
- Julian
> Secondly, we might want to enhance the 'svn resolve' UI to allow
> specifying a particular property. I see that as being a comparatively minor
> enhancement. (We could also add such an option to the svn_client_resolve() API,
> but the API can always be given a callback function that only resolves conflicts
> on a specific property so there is no need for the API to expose such an option
> explicitly.)
>
> The best idea I have *short of* getting "full" support by fixing
> libsvn_wc is to make 'svn' track how many of the propery conflicts you
> resolved, and if you resolved some but not all of them then print a warning that
> all of the properties were marked as resolved. That's not great but would
> be simple to implement and would improve the user experience a bit.
>
> It might be possible to leave all of the property conflicts on that node
> *unresolved* if they're not all resolved, which is probably a better user
> experience, but I'm not sure how we'd do that purely in the client.
> Once the callback has returned any kind of "resolved" result for one
> property, libsvn_wc currently marks all prop conflicts on the node as resolved
> before calling the callback for the next property, and I don't know of any
> good way to avoid that.
Re: Bug in conflict summary after partial resolution
Posted by Julian Foad <ju...@btopenworld.com>.
I (Julian Foad) wrote:
> I (Julian Foad) wrote on 2013-04-15:
>> Mattias Engdegård wrote:
>>> If a file has both text and property conflicts, only resolving one of
>>> them leads to an incorrect conflict summary message.
[...]
> The solution I'm implementing is to make the conflict resolver callback
> decrease the counters when it resolves a conflict, rather than using the
> 'resolved' notification to do that. The resolver callback knows what
> kind of conflict it is resolving.
>
> Fixed in r1471490.
And I nominated it for back-port.
> There is a second bug, closely related. If there are multiple prop conflicts on
> the same node, they all get marked as resolved as soon as you request any one of
> them to be marked as resolved. There is incomplete API support for marking
> individual properties as resolved so that may be hard to fix.
How hard can it be to add full support for marking individual properties as resolved? I see two distinct levels to "full support".
Firstly, to fix the bug in interactive resolution, support is needed in libsvn_wc to ensure that when a conflict resolver callback (called from libsvn_wc/conflicts.c) returns any kind of 'resolved' result for a property conflict, the WC should mark only that specific property as resolved. That would be enough to fix the interactive conflict resolution. I'm looking at how feasible this might be.
Secondly, we might want to enhance the 'svn resolve' UI to allow specifying a particular property. I see that as being a comparatively minor enhancement. (We could also add such an option to the svn_client_resolve() API, but the API can always be given a callback function that only resolves conflicts on a specific property so there is no need for the API to expose such an option explicitly.)
The best idea I have *short of* getting "full" support by fixing libsvn_wc is to make 'svn' track how many of the propery conflicts you resolved, and if you resolved some but not all of them then print a warning that all of the properties were marked as resolved. That's not great but would be simple to implement and would improve the user experience a bit.
It might be possible to leave all of the property conflicts on that node *unresolved* if they're not all resolved, which is probably a better user experience, but I'm not sure how we'd do that purely in the client. Once the callback has returned any kind of "resolved" result for one property, libsvn_wc currently marks all prop conflicts on the node as resolved before calling the callback for the next property, and I don't know of any good way to avoid that.
> As an enhancement, the Summary of Conflicts could usefully be printed *before*
> we start interactive resolution, to give the user an idea of how much work is
> involved. This is pretty much the subject of issue #3497 "auto merge as
> much as can; then print summary, then go into conflict resolution",
> <http://subversion.tigris.org/issues/show_bug.cgi?id=3497>. If we do
> that, I think we should still print a summary afterwards as well.
r1471759 on trunk prints a summary of conflicts before interactive resolving.
I haven't proposed this for back-port. We could do if folks want it.
> Another minor observation. I wonder if some people will find the conflict
> summary wording to be a little bit unclear or misleading: "Property
> conficts: 1" means property conflicts in one node, although there could be
> 3 different properties in conflict on that node. And some people might even
> think "Text conflicts: 2" means two hunks, whereas it means two files
> and there might be several hunks in conflict in each file. I regard this as a
> rather minor UI usability issue, but it's not exactly hard for us to make it
> a bit clearer.
I'm not planning to tweak the wording at the moment.
- Julian
Re: Bug in conflict summary after partial resolution
Posted by Julian Foad <ju...@btopenworld.com>.
I (Julian Foad) wrote on 2013-04-15:
> Mattias Engdegård wrote:
>> If a file has both text and property conflicts, only resolving one of them
>> leads to an incorrect conflict summary message.
>
> I'll take this one. There's a bunch of stuff to sort out, here; marking
> both conflicts as resolved at the same time is only one of the bugs.
The Summary of Conflicts says both the text and prop conflicts on this node were resolved, when really only the text conflict was resolved. What's happening is an svn_wc_notify_resolved notification causes us to assume (in svn/notify.c) that all conflicts on that path are resolved.
We can fix this in a number of ways. We could tell the 'notify' handler when we're resolving a prop or text conflict, so that it knows exactly what each 'resolved' notification refers to. Or the notification handler could query the resolved node to see if any conflicts on that node still remain. Or we could change the notification system to be more specific -- but that's too deep a change to make now for 1.8.
The solution I'm implementing is to make the conflict resolver callback decrease the counters when it resolves a conflict, rather than using the 'resolved' notification to do that. The resolver callback knows what kind of conflict it is resolving.
Fixed in r1471490.
There is a second bug, closely related. If there are multiple prop conflicts on the same node, they all get marked as resolved as soon as you request any one of them to be marked as resolved. There is incomplete API support for marking individual properties as resolved so that may be hard to fix.
As an enhancement, the Summary of Conflicts could usefully be printed *before* we start interactive resolution, to give the user an idea of how much work is involved. This is pretty much the subject of issue #3497 "auto merge as much as can; then print summary, then go into conflict resolution", <http://subversion.tigris.org/issues/show_bug.cgi?id=3497>. If we do that, I think we should still print a summary afterwards as well.
Another minor observation. I wonder if some people will find the conflict summary wording to be a little bit unclear or misleading: "Property conficts: 1" means property conflicts in one node, although there could be 3 different properties in conflict on that node. And some people might even think "Text conflicts: 2" means two hunks, whereas it means two files and there might be several hunks in conflict in each file. I regard this as a rather minor UI usability issue, but it's not exactly hard for us to make it a bit clearer.
- Julian
>> Example:
>>
>> $ svnadmin create repo
>> $ svn co file://$PWD/repo d1
>> $ svn co file://$PWD/repo d2
>> $ cd d1
>> $ echo a > f; svn add f; svn ps p x f
>> $ svn ci -m m
>> $ cd ../d2
>> $ echo b > f; svn add f; svn ps p y f
>> $ svn up
>> Updating '.':
>> CC f
>> Updated to revision 1.
>> Conflict for property 'p' discovered on 'f'.
>> Trying to add new property 'p'
>> but the property already exists.
>> <<<<<<< (local property value)
>> y=======
>> x>>>>>>> (incoming property value)
>>
>> Select: (p) postpone, (mf) mine-full, (tf) theirs-full, (q) quit,
>> (h) help: p
>> Conflict discovered in file 'f'.
>> Select: (p) postpone, (df) diff-full, (e) edit, (m) merge,
>> (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: mc
>> Resolved conflicted state of 'f'
>> Summary of conflicts:
>> Text conflicts: 0 remaining (and 1 already resolved)
>> Property conflicts: 0 remaining (and 1 already resolved)
>> $ svn st
>> MC f
>> ? f.prej
>> Summary of conflicts:
>> Property conflicts: 1
>>
>
Re: Bug in conflict summary after partial resolution
Posted by Julian Foad <ju...@btopenworld.com>.
Mattias Engdegård wrote:
> If a file has both text and property conflicts, only resolving one of them leads
> to an incorrect conflict summary message.
I'll take this one. There's a bunch of stuff to sort out, here; marking both conflicts as resolved at the same time is only one of the bugs.
- Julian
> Example:
>
> $ svnadmin create repo
> $ svn co file://$PWD/repo d1
> $ svn co file://$PWD/repo d2
> $ cd d1
> $ echo a > f; svn add f; svn ps p x f
> $ svn ci -m m
> $ cd ../d2
> $ echo b > f; svn add f; svn ps p y f
> $ svn up
> Updating '.':
> CC f
> Updated to revision 1.
> Conflict for property 'p' discovered on 'f'.
> Trying to add new property 'p'
> but the property already exists.
> <<<<<<< (local property value)
> y=======
> x>>>>>>> (incoming property value)
>
> Select: (p) postpone, (mf) mine-full, (tf) theirs-full, (q) quit,
> (h) help: p
> Conflict discovered in file 'f'.
> Select: (p) postpone, (df) diff-full, (e) edit, (m) merge,
> (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: mc
> Resolved conflicted state of 'f'
> Summary of conflicts:
> Text conflicts: 0 remaining (and 1 already resolved)
> Property conflicts: 0 remaining (and 1 already resolved)
> $ svn st
> MC f
> ? f.prej
> Summary of conflicts:
> Property conflicts: 1
>