You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Gustavo Niemeyer <ni...@conectiva.com> on 2002/10/19 15:31:48 UTC

diffs & removed directories

While debugging the problem I presented in the last patch I sent, I've
discovered another interesting behavior of "svn diff". In the execution
below, notice that between revisions 12 and 13, "dir" and "dir/file"
were added.

[niemeyer@ibook ~/src/test]% svn diff file:///svnroot/test@12 \
                                      file:///svnroot/test@13
Index: dir/file
===================================================================
--- dir/file
+++ tmp.15136.00001     2002-10-19 12:17:36.000000000 -0300
@@ -0,0 +1 @@
+foo
[niemeyer@ibook ~/src/test]% svn diff file:///svnroot/test@13 \
                                      file:///svnroot/test@12
[niemeyer@ibook ~/src/test]% 

That happens because in libsvn_repos/delta.c:delta_dirs(), delete()
is called for each entry in the source path that doesn't exist in
the target path. OTOH, the editor function
libsvn_client/repos_diff.c:delete_entry() simply checks the path kind,
and forwards the call to the libsvn_client/diff.c:diff_dir_deleted()
diff callback function, which does nothing.

IMO, delete_entry() should be changed to recurse into the directory
and call itself recursivelly for each entry, if recursion is enabled.

Can someone familiar with that code please confirm that, or explain
a better solution to fix that? If so, I can try to provide a patch.

Thanks!

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: diffs & removed directories

Posted by Philip Martin <ph...@codematters.co.uk>.
Gustavo Niemeyer <ni...@conectiva.com> writes:

> That happens because in libsvn_repos/delta.c:delta_dirs(), delete()
> is called for each entry in the source path that doesn't exist in
> the target path. OTOH, the editor function
> libsvn_client/repos_diff.c:delete_entry() simply checks the path kind,
> and forwards the call to the libsvn_client/diff.c:diff_dir_deleted()
> diff callback function, which does nothing.
> 
> IMO, delete_entry() should be changed to recurse into the directory
> and call itself recursivelly for each entry, if recursion is enabled.

I'm not sure that's the right thing to do, it would affect more than
diff, for example it would also affect update.  Look at the function
diff_dir_deleted in libsvn_client/diff.c, I think the plan is to call
RA->get_dir (which didn't exist when the diff editor was written) to
get a separate report for the deleted directory.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org