You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@btopenworld.com> on 2008/10/11 19:16:18 UTC
[PATCH] Tree conflicts - svn info reporting per victim
Patch in progress, for any comments.
(Stefan, you were working on this some time ago, weren't you?)
The attached patch modifies the reporting of tree conflicts by "svn
info" so that "svn info path/to/victim" reports any tree conflict info
about the victim:
[[[
$ svn info path/to/victim
Path: victim
URL: [...]
[...]
Tree conflict:
The update attempted to edit 'pi'.
You have deleted 'pi' locally.
Maybe you renamed it?
]]]
instead of the current "svn info parent/" reporting a list of all tree
conflicts that apply to the target's children.
Problem (noted in the log message): in some cases the victim is not a
versioned object. This can happen legitimately when merging a
modification:
M path/to/victim/child
into a branch in which the victim tree has been deleted. (It can also
happen at present due to a bug in which "update" proceeds to delete the
victim even if it is raising a tree conflict. I'm working on that.)
Also 2 tests fail. Info_tests 1 (seems to be partly due to a bug in the
test) and merge_tests 111 (needs to be updated to run "info" on the
victim).
- Julian
Re: [PATCH] Tree conflicts - svn info reporting per victim
Posted by Julian Foad <ju...@btopenworld.com>.
On Mon, 2008-10-13 at 12:41 +0100, Julian Foad wrote:
> On Mon, 2008-10-13 at 10:40 +0200, Stephen Butler wrote:
> > Quoting Stephen Butler <sb...@elego.de>:
> >
> > > Quoting Stephen Butler <sb...@elego.de>:
> > >
> > >> Quoting Julian Foad <ju...@btopenworld.com>:
> > >>> The attached patch modifies the reporting of tree conflicts by "svn
> > >>> info" so that "svn info path/to/victim" reports any tree conflict info
> > >>> about the victim:
> > >
> > >> I took the liberty of extending your diff (version 3, attached). It now
> > >> prints minimal info (just the path and a tree conflict explanation) for
> > >> nonexistent tree conflict victims.
>
> Excellent. Thanks, Stephen.
>
> I like what you've made it do, and think it's the right way.
Committed revision 33620.
> There's one bit of the implementation I don't like:
> (svn_wc_get_tree_conflict): Add a boolean arg for new
> parent-dir option.
> Passing a flag feels yucky. The adm_access baton already says what
> directory it's for. I'll see if I can change the function to avoid the
> need for the flag.
>
> If I can't do that easily I'll commit this anyway.
I haven't changed that.
> - Julian
>
>
> > [[[
> > Make "svn info" report a tree conflict on the victim, rather than on the
> > parent directory.
> >
> > ### "svn info" won't work on an unversioned item. A tree conflict can
> > ### presently exist on an unversioned item. For "update", this should not
> > ### happen: a WC item must be schedule-del/mod/add for a tree conflict to
> > ### be raised, and the update should not proceed and make the item
> > ### unversioned. For "merge", it is legitimate to have a conflict on an
> > ### item that is not in the WC. For that, we need either to allow "svn info"
> > ### on an unversioned item, or ensure "merge" always makes a tree conflict
> > ### victim into some kind of versioned item (with schedule=missing or
> > ### something like that) if that's feasible.
> >
> > ### Steve Butler: I extended the diff so that "svn info" now works on
> > ### unversioned items. There's a new error-callback for gathering info in
> > ### the working copy. If the info-target does not exist, and is a tree
> > ### conflict victim, a minimal set of info is printed. I finished
> > ### adjusting the tests to act on victims directly.
> >
> > * subversion/libsvn_wc/tree_conflicts.c
> > (svn_wc_get_tree_conflict): Support getting the conflict info from the
> > parent dir of the victim.
> >
> > * subversion/include/svn_wc.h
> > (svn_wc_get_tree_conflict): Add a boolean arg for new parent-dir option.
> >
> > * subversion/libsvn_wc/status.c
> > (assemble_status): track changed svn_wc_get_tree_conflict declaration.
> >
> > * subversion/include/svn_client.h
> > (svn_info_t): Replace the 'tree_conflicts' array with a single
> > 'tree_conflict' pointer.
> >
> > * subversion/libsvn_client/info.c
> > (build_info_from_dirent): Initialize 'tree_conflict' instead of
> > 'tree_conflicts'.
> > (found_entry_baton): Add an 'adm_access' field.
> > (build_info_from_entry): Don't fill in the tree conflict info here, because
> > we don't have the required adm_access baton...
> > (info_found_entry_callback): ... but fill it in here instead,
> > (crawl_entries): Store the adm_access of the root directory of the crawl.
> > (info_error_handler): New function.
> > (entry_walk_callbacks): Use the new handler function.
> > (build_info_for_unversioned): New helper function.
> >
> > * subversion/svn/info-cmd.c
> > (print_info_xml, print_info): Print just the one tree conflict that is now
> > in the info structure, rather than an array of conflicts. In
> > print_info_xml, remove restriction that revnum must be valid.
> >
> > * subversion/svn/schema/info.rnc
> > Remove the 'tree-conflicts' wrapper element, as there can now be only one
> > tree conflict reported per node.
> >
> > * subversion/tests/cmdline/info_tests.py
> > (info_with_tree_conflicts): Adjust accordingly.
> >
> > * subversion/tests/cmdline/merge_tests.py
> > (tree_conflicts_and_obstructions): Adjust accordingly.
> > ]]]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Tree conflicts - svn info reporting per victim
Posted by Julian Foad <ju...@btopenworld.com>.
On Mon, 2008-10-13 at 10:40 +0200, Stephen Butler wrote:
> Quoting Stephen Butler <sb...@elego.de>:
>
> > Quoting Stephen Butler <sb...@elego.de>:
> >
> >> Quoting Julian Foad <ju...@btopenworld.com>:
> >>> The attached patch modifies the reporting of tree conflicts by "svn
> >>> info" so that "svn info path/to/victim" reports any tree conflict info
> >>> about the victim:
> >
> >> I took the liberty of extending your diff (version 3, attached). It now
> >> prints minimal info (just the path and a tree conflict explanation) for
> >> nonexistent tree conflict victims.
Excellent. Thanks, Stephen.
I like what you've made it do, and think it's the right way.
There's one bit of the implementation I don't like:
(svn_wc_get_tree_conflict): Add a boolean arg for new
parent-dir option.
Passing a flag feels yucky. The adm_access baton already says what
directory it's for. I'll see if I can change the function to avoid the
need for the flag.
If I can't do that easily I'll commit this anyway.
- Julian
> [[[
> Make "svn info" report a tree conflict on the victim, rather than on the
> parent directory.
>
> ### "svn info" won't work on an unversioned item. A tree conflict can
> ### presently exist on an unversioned item. For "update", this should not
> ### happen: a WC item must be schedule-del/mod/add for a tree conflict to
> ### be raised, and the update should not proceed and make the item
> ### unversioned. For "merge", it is legitimate to have a conflict on an
> ### item that is not in the WC. For that, we need either to allow "svn info"
> ### on an unversioned item, or ensure "merge" always makes a tree conflict
> ### victim into some kind of versioned item (with schedule=missing or
> ### something like that) if that's feasible.
>
> ### Steve Butler: I extended the diff so that "svn info" now works on
> ### unversioned items. There's a new error-callback for gathering info in
> ### the working copy. If the info-target does not exist, and is a tree
> ### conflict victim, a minimal set of info is printed. I finished
> ### adjusting the tests to act on victims directly.
>
> * subversion/libsvn_wc/tree_conflicts.c
> (svn_wc_get_tree_conflict): Support getting the conflict info from the
> parent dir of the victim.
>
> * subversion/include/svn_wc.h
> (svn_wc_get_tree_conflict): Add a boolean arg for new parent-dir option.
>
> * subversion/libsvn_wc/status.c
> (assemble_status): track changed svn_wc_get_tree_conflict declaration.
>
> * subversion/include/svn_client.h
> (svn_info_t): Replace the 'tree_conflicts' array with a single
> 'tree_conflict' pointer.
>
> * subversion/libsvn_client/info.c
> (build_info_from_dirent): Initialize 'tree_conflict' instead of
> 'tree_conflicts'.
> (found_entry_baton): Add an 'adm_access' field.
> (build_info_from_entry): Don't fill in the tree conflict info here, because
> we don't have the required adm_access baton...
> (info_found_entry_callback): ... but fill it in here instead,
> (crawl_entries): Store the adm_access of the root directory of the crawl.
> (info_error_handler): New function.
> (entry_walk_callbacks): Use the new handler function.
> (build_info_for_unversioned): New helper function.
>
> * subversion/svn/info-cmd.c
> (print_info_xml, print_info): Print just the one tree conflict that is now
> in the info structure, rather than an array of conflicts. In
> print_info_xml, remove restriction that revnum must be valid.
>
> * subversion/svn/schema/info.rnc
> Remove the 'tree-conflicts' wrapper element, as there can now be only one
> tree conflict reported per node.
>
> * subversion/tests/cmdline/info_tests.py
> (info_with_tree_conflicts): Adjust accordingly.
>
> * subversion/tests/cmdline/merge_tests.py
> (tree_conflicts_and_obstructions): Adjust accordingly.
> ]]]
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Tree conflicts - svn info reporting per victim
Posted by Stephen Butler <sb...@elego.de>.
Quoting Stephen Butler <sb...@elego.de>:
> Quoting Stephen Butler <sb...@elego.de>:
>
>> Quoting Julian Foad <ju...@btopenworld.com>:
>>
>>> Patch in progress, for any comments.
>>>
>>> (Stefan, you were working on this some time ago, weren't you?)
>>>
>>> The attached patch modifies the reporting of tree conflicts by "svn
>>> info" so that "svn info path/to/victim" reports any tree conflict info
>>> about the victim:
>
>> Hi Julian,
>>
>> I took the liberty of extending your diff (version 3, attached). It now
>> prints minimal info (just the path and a tree conflict explanation) for
>> nonexistent tree conflict victims.
>
> Whoops, by the clear light of day, I see the segfault when I run the tests.
> New patch removes an unnecessary check for a valid revnum in print_info_xml
> (only), and allows the new info_error_handler to ignore SVN_NO_ERROR. Also
> a fix to expected_str1 in the test (it expected too much).
>
Now with attachment. Doh!
And here's the commit message.
[[[
Make "svn info" report a tree conflict on the victim, rather than on the
parent directory.
### "svn info" won't work on an unversioned item. A tree conflict can
### presently exist on an unversioned item. For "update", this should not
### happen: a WC item must be schedule-del/mod/add for a tree conflict to
### be raised, and the update should not proceed and make the item
### unversioned. For "merge", it is legitimate to have a conflict on an
### item that is not in the WC. For that, we need either to allow "svn info"
### on an unversioned item, or ensure "merge" always makes a tree conflict
### victim into some kind of versioned item (with schedule=missing or
### something like that) if that's feasible.
### Steve Butler: I extended the diff so that "svn info" now works on
### unversioned items. There's a new error-callback for gathering info in
### the working copy. If the info-target does not exist, and is a tree
### conflict victim, a minimal set of info is printed. I finished
### adjusting the tests to act on victims directly.
* subversion/libsvn_wc/tree_conflicts.c
(svn_wc_get_tree_conflict): Support getting the conflict info from the
parent dir of the victim.
* subversion/include/svn_wc.h
(svn_wc_get_tree_conflict): Add a boolean arg for new parent-dir option.
* subversion/libsvn_wc/status.c
(assemble_status): track changed svn_wc_get_tree_conflict declaration.
* subversion/include/svn_client.h
(svn_info_t): Replace the 'tree_conflicts' array with a single
'tree_conflict' pointer.
* subversion/libsvn_client/info.c
(build_info_from_dirent): Initialize 'tree_conflict' instead of
'tree_conflicts'.
(found_entry_baton): Add an 'adm_access' field.
(build_info_from_entry): Don't fill in the tree conflict info here, because
we don't have the required adm_access baton...
(info_found_entry_callback): ... but fill it in here instead,
(crawl_entries): Store the adm_access of the root directory of the crawl.
(info_error_handler): New function.
(entry_walk_callbacks): Use the new handler function.
(build_info_for_unversioned): New helper function.
* subversion/svn/info-cmd.c
(print_info_xml, print_info): Print just the one tree conflict that is now
in the info structure, rather than an array of conflicts. In
print_info_xml, remove restriction that revnum must be valid.
* subversion/svn/schema/info.rnc
Remove the 'tree-conflicts' wrapper element, as there can now be only one
tree conflict reported per node.
* subversion/tests/cmdline/info_tests.py
(info_with_tree_conflicts): Adjust accordingly.
* subversion/tests/cmdline/merge_tests.py
(tree_conflicts_and_obstructions): Adjust accordingly.
]]]
Regards,
Steve
--
Stephen Butler | Software Developer
elego Software Solutions GmbH
Gustav-Meyer-Allee 25 | 13355 Berlin | Germany
fon: +49 30 2345 8696 | mobile: +49 163 25 45 015
fax: +49 30 2345 8695 | http://www.elegosoft.com
Geschäftsführer: Olaf Wagner | Sitz der Gesellschaft: Berlin
Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194
Re: [PATCH] Tree conflicts - svn info reporting per victim
Posted by Stephen Butler <sb...@elego.de>.
Quoting Stephen Butler <sb...@elego.de>:
> Quoting Julian Foad <ju...@btopenworld.com>:
>
>> Patch in progress, for any comments.
>>
>> (Stefan, you were working on this some time ago, weren't you?)
>>
>> The attached patch modifies the reporting of tree conflicts by "svn
>> info" so that "svn info path/to/victim" reports any tree conflict info
>> about the victim:
> Hi Julian,
>
> I took the liberty of extending your diff (version 3, attached). It now
> prints minimal info (just the path and a tree conflict explanation) for
> nonexistent tree conflict victims.
Whoops, by the clear light of day, I see the segfault when I run the tests.
New patch removes an unnecessary check for a valid revnum in print_info_xml
(only), and allows the new info_error_handler to ignore SVN_NO_ERROR. Also
a fix to expected_str1 in the test (it expected too much).
Steve
--
Stephen Butler | Software Developer
elego Software Solutions GmbH
Gustav-Meyer-Allee 25 | 13355 Berlin | Germany
fon: +49 30 2345 8696 | mobile: +49 163 25 45 015
fax: +49 30 2345 8695 | http://www.elegosoft.com
Geschäftsführer: Olaf Wagner | Sitz der Gesellschaft: Berlin
Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Tree conflicts - svn info reporting per victim
Posted by Stephen Butler <sb...@elego.de>.
Quoting Julian Foad <ju...@btopenworld.com>:
> Patch in progress, for any comments.
>
> (Stefan, you were working on this some time ago, weren't you?)
>
> The attached patch modifies the reporting of tree conflicts by "svn
> info" so that "svn info path/to/victim" reports any tree conflict info
> about the victim:
>
> [[[
> $ svn info path/to/victim
> Path: victim
> URL: [...]
> [...]
> Tree conflict:
> The update attempted to edit 'pi'.
> You have deleted 'pi' locally.
> Maybe you renamed it?
> ]]]
>
> instead of the current "svn info parent/" reporting a list of all tree
> conflicts that apply to the target's children.
>
> Problem (noted in the log message): in some cases the victim is not a
> versioned object. This can happen legitimately when merging a
> modification:
>
> M path/to/victim/child
>
> into a branch in which the victim tree has been deleted. (It can also
> happen at present due to a bug in which "update" proceeds to delete the
> victim even if it is raising a tree conflict. I'm working on that.)
Hi Julian,
I took the liberty of extending your diff (version 3, attached). It now
prints minimal info (just the path and a tree conflict explanation) for
nonexistent tree conflict victims.
There was an error handler in the info call chain that did nothing, so
I replaced it with one that checks the parent dir's tc-data if the
info target doesn't exist. I tweaked svn_wc_get_tree_conflict() to
allow querying the adm_access of the parent dir directly.
I suppose we could include more info fields by looking things up in the
parent dir's entry. The info struct really isn't designed to be so
minimalistic.
> Also 2 tests fail. Info_tests 1 (seems to be partly due to a bug in the
> test) and merge_tests 111 (needs to be updated to run "info" on the
> victim).
I fixed the info and merge tests so that they "fail properly". Of
course, now they pass.
I suppose we should extend the info tests to include merge as well as
update actions, because with your next fix to the update command, only
merge-induced tree conflicts will be able to create these nonexistent
victims.
Regards,
Steve
--
Stephen Butler | Software Developer
elego Software Solutions GmbH
Gustav-Meyer-Allee 25 | 13355 Berlin | Germany
fon: +49 30 2345 8696 | mobile: +49 163 25 45 015
fax: +49 30 2345 8695 | http://www.elegosoft.com
Geschäftsführer: Olaf Wagner | Sitz der Gesellschaft: Berlin
Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194
Re: [PATCH] Tree conflicts - svn info reporting per victim
Posted by Julian Foad <ju...@btopenworld.com>.
On Sun, 2008-10-12 at 00:24 +0200, Neels J Hofmeyr wrote:
> Julian Foad wrote:
> > Patch in progress, for any comments.
> >
> > (Stefan, you were working on this some time ago, weren't you?)
> >
> > The attached patch modifies the reporting of tree conflicts by "svn
> > info" so that "svn info path/to/victim" reports any tree conflict info
> > about the victim:
> >
> > [[[
> > $ svn info path/to/victim
> > Path: victim
> > URL: [...]
> > [...]
> > Tree conflict:
> > The update attempted to edit 'pi'.
> > You have deleted 'pi' locally.
> > Maybe you renamed it?
> > ]]]
>
> You mean:
> The update attempted to edit 'victim'.
> You have deleted 'victim' locally.
Yes, that's what I meant. Sorry for the sloppy cut-and-paste.
- Julian
> (Sorry, haven't had the time to test it yet)
> ~Neels
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Tree conflicts - svn info reporting per victim
Posted by Neels J Hofmeyr <ne...@elego.de>.
Julian Foad wrote:
> Patch in progress, for any comments.
>
> (Stefan, you were working on this some time ago, weren't you?)
>
> The attached patch modifies the reporting of tree conflicts by "svn
> info" so that "svn info path/to/victim" reports any tree conflict info
> about the victim:
>
> [[[
> $ svn info path/to/victim
> Path: victim
> URL: [...]
> [...]
> Tree conflict:
> The update attempted to edit 'pi'.
> You have deleted 'pi' locally.
> Maybe you renamed it?
> ]]]
You mean:
The update attempted to edit 'victim'.
You have deleted 'victim' locally.
(Sorry, haven't had the time to test it yet)
~Neels
--
Neels Hofmeyr -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23458696 mobile: +49 177 2345869 fax: +49 30 23458695
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelsreg: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194