You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Martin Hauner <ma...@gmx.net> on 2008/04/27 11:52:30 UTC

Re: Issue #2873, diff for a single added file

Hi,

Julian Foad wrote:
> Martin Hauner wrote (on 9th Feb):
>> i am looking at issue 2873
>> (http://subversion.tigris.org/issues/show_bug.cgi?id=2873 ).
>> It is about creating a diff for a single added file. This currently
>> fails with a file doesn't exist in revision error.
>
> Thanks for looking at this, Martin.

Thanks for your comments. Took me a while to work on it again..  I have created 
a new patch for discussion on trunk including a new test case.

Initially there were two diff test failing:

12 diff_nonextant_urls
16 diff_targets

I got the first working by adding an additional condition to the path checks in 
diff_prepare_repos_repos instead of completly removing the checks.

The second check looks for the error i'm trying to remove by running diff on two 
unrelated path, so it should fail now..

Ideally the diff code should somehow recognize that it is running a diff on an 
added file and just allow that. But the interesting part happens in the common 
svn_client__repos_locations function and i have no better idea than faking the 
missing path to skip the error checking to get it working.

Possibly a cleaner solution would be an svn_client__repos_locations_diff??

> Does the test suite pass with this patch?
>
> If so, this might be quite close to being ready.
>
> Thanks.
>
> - Julian

[[[
Fix Issue #2873. Allow diff on a single added file.

* subversion/libsvn_client/client.h
   (svn_client__repos_locations): added new parameter to allow missing
   repository locations.

* subversion/libsvn_client/ra.c
   (svn_client__ra_session_from_path): adjusted
   svn_client__repos_locations call.
   (svn_client__repos_locations): added new parameter to allow missing
   repository locations. Fake missing path if allowed.

* subversion/libsvn_client/diff.c
   (diff_prepare_repos_repos): error on missing node only if both paths
   are unrelated.

* subversion/libsvn_client/copy.c
   (repos_to_wc_copy): adjusted svn_client__repos_locations call.

* subversion/libsvn_client/info.c
   (same_resource_in_head): adjusted svn_client__repos_locations call.

* subversion/libsvn_client/merge.c
   (filter_self_referential_mergeinfo,calculate_remaining_ranges,
   get_full_mergeinfo,get_mergeinfo_walk_cb, normalize_merge_sources):
   adjusted svn_client__repos_locations calls.

* subversion/tests/cmdline/diff_tests.py
   (repo_diff_file): new helper function.
   (diff_a_single_added_file): new test.
   added diff_a_single_added_file test.
]]]

-- 
Martin

Subcommander 2.0.0 Beta 2, 1.2.4 - http://subcommander.tigris.org
a Win32/Unix/MacOSX subversion GUI client & diff/merge tool.