You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Rui, Guo" <ti...@mail.ustc.edu.cn> on 2008/07/19 15:04:15 UTC

svn diff with explicit --depth in sparse directory?

Hi all,
I find that svn_wc_get_diff_editor5() will only wrap the diff_editor with
an ambient_depth_filter_editor when there is no explicit depth requested. This
implies that, in a sparse wc a 'repos vs. wc' diff will produce a lot of
missing-local-file diff when, say, --depth=infinity is specified.

I curious whether this behavior is designed in this way intentionally, or just
a bug? In the latter case, I can provide a patch.

Rui

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

Re: svn diff with explicit --depth in sparse directory?

Posted by "C. Michael Pilato" <cm...@collab.net>.
I think this is to be expected, as we have no notion of ambient depth for 
repository locations, and our behavior for specifying depths > ambinent 
depth for working copy locations is well-defined.

So, this might be an annoyance or an oddity, but I don't think we'll see 
much of this situation in practice, the behavior is trivially explainable, 
and depending on what the user really intended, there's probably a workaround.

Rui, Guo wrote:
> What I'm talking about is the 'repos vs. wc' diff. And you are testing the 'wc
> vs. wc' situation. Try replacing your diff command with this:
> 
> ${SVN} diff --depth=infinity --old=. --new=${URL}/trunk
> 
> Rui
> 
> On Mon, Jul 21, 2008 at 07:38:01PM -0400, Karl Fogel wrote:
>> "Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
>>> I find that svn_wc_get_diff_editor5() will only wrap the diff_editor
>>> with an ambient_depth_filter_editor when there is no explicit depth
>>> requested. This implies that, in a sparse wc a 'repos vs. wc' diff
>>> will produce a lot of missing-local-file diff when, say,
>>> --depth=infinity is specified.
>>>
>>> I curious whether this behavior is designed in this way intentionally,
>>> or just a bug? In the latter case, I can provide a patch.
>> This would be a bug; but, I can't reproduce it.  Can you supply a
>> script?  Mine below does not show the bug.  Instead it shows this
>> output:
>>
>>    ### Making a Greek Tree for import...
>>    ### Done.
>>    
>>    ### Importing it...
>>    ### Done.
>>    
>>    A    A/D
>>    A    A/D/gamma
>>    A    A/D/G
>>    A    A/D/H
>>    Updated to revision 1.
>>    A    A/D/G/pi
>>    A    A/D/G/rho
>>    A    A/D/G/tau
>>    Updated to revision 1.
>>    At revision 1.
>>    
>> Here's the script:
>>
>> #!/bin/sh
>>
>> # The next line is the only line you should need to adjust.
>> SVNDIR=/home/kfogel/src/subversion
>>
>> SVN=${SVNDIR}/subversion/svn/svn
>> SVNSERVE=${SVNDIR}/subversion/svnserve/svnserve
>> SVNADMIN=${SVNDIR}/subversion/svnadmin/svnadmin
>>
>> # Select an access method.  If svn://, the svnserve setup is
>> # handled automagically by this script; but if http://, then
>> # you'll have to configure it yourself first.
>> # 
>> # URL=http://localhost/SOMETHING/repos
>> # URL=svn://localhost/repos
>> URL=file:///`pwd`/repos
>>
>> rm -rf repos wc import-me
>>
>> ${SVNADMIN} create repos
>>
>> # These are for svnserve only.
>> echo "[general]" > repos/conf/svnserve.conf
>> echo "anon-access = write" >> repos/conf/svnserve.conf
>> echo "auth-access = write" >> repos/conf/svnserve.conf
>>
>> # The server will only be contacted if $URL is svn://foo, of course.
>> ${SVNSERVE} --pid-file svnserve-pid -d -r `pwd`
>> # And put the kill command in a file, in case need to run it manually.
>> echo "kill -9 `cat svnserve-pid`" > k
>> chmod a+rwx k
>>
>> echo "### Making a Greek Tree for import..."
>> mkdir import-me
>> mkdir import-me/trunk
>> mkdir import-me/tags
>> mkdir import-me/branches
>> mkdir import-me/trunk/A
>> mkdir import-me/trunk/A/B/
>> mkdir import-me/trunk/A/C/
>> mkdir import-me/trunk/A/D/
>> mkdir import-me/trunk/A/B/E/
>> mkdir import-me/trunk/A/B/F/
>> mkdir import-me/trunk/A/D/G/
>> mkdir import-me/trunk/A/D/H/
>> echo "This is the file 'iota'."        > import-me/trunk/iota
>> echo "This is the file 'A/mu'."        > import-me/trunk/A/mu
>> echo "This is the file 'A/B/lambda'."  > import-me/trunk/A/B/lambda
>> echo "This is the file 'A/B/E/alpha'." > import-me/trunk/A/B/E/alpha
>> echo "This is the file 'A/B/E/beta'."  > import-me/trunk/A/B/E/beta
>> echo "This is the file 'A/D/gamma'."   > import-me/trunk/A/D/gamma
>> echo "This is the file 'A/D/G/pi'."    > import-me/trunk/A/D/G/pi
>> echo "This is the file 'A/D/G/rho'."   > import-me/trunk/A/D/G/rho
>> echo "This is the file 'A/D/G/tau'."   > import-me/trunk/A/D/G/tau
>> echo "This is the file 'A/D/H/chi'."   > import-me/trunk/A/D/H/chi
>> echo "This is the file 'A/D/H/omega'." > import-me/trunk/A/D/H/omega
>> echo "This is the file 'A/D/H/psi'."   > import-me/trunk/A/D/H/psi
>> echo "### Done."
>> echo ""
>> echo "### Importing it..."
>> (cd import-me; ${SVN} import -q -m "Initial import." ${URL})
>> echo "### Done."
>> echo ""
>>
>> ${SVN} co -q --depth=immediates ${URL}/trunk wc
>>
>> cd wc
>> ${SVN} up --set-depth=immediates A/D
>> ${SVN} up --set-depth=infinity A/D/G
>> ${SVN} up
>> ${SVN} diff --depth=infinity
>> cd ..
>>
>> # Put kill command in a file, in case need to run it manually.
>> echo "kill -9 `cat svnserve-pid`" > k
>> chmod a+rwx k
>> ./k
>>
>> ---------------------------------------------------------------------
>> 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
> 


-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: svn diff with explicit --depth in sparse directory?

Posted by "Rui, Guo" <ti...@mail.ustc.edu.cn>.
What I'm talking about is the 'repos vs. wc' diff. And you are testing the 'wc
vs. wc' situation. Try replacing your diff command with this:

${SVN} diff --depth=infinity --old=. --new=${URL}/trunk

Rui

On Mon, Jul 21, 2008 at 07:38:01PM -0400, Karl Fogel wrote:
> "Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
> > I find that svn_wc_get_diff_editor5() will only wrap the diff_editor
> > with an ambient_depth_filter_editor when there is no explicit depth
> > requested. This implies that, in a sparse wc a 'repos vs. wc' diff
> > will produce a lot of missing-local-file diff when, say,
> > --depth=infinity is specified.
> >
> > I curious whether this behavior is designed in this way intentionally,
> > or just a bug? In the latter case, I can provide a patch.
> 
> This would be a bug; but, I can't reproduce it.  Can you supply a
> script?  Mine below does not show the bug.  Instead it shows this
> output:
> 
>    ### Making a Greek Tree for import...
>    ### Done.
>    
>    ### Importing it...
>    ### Done.
>    
>    A    A/D
>    A    A/D/gamma
>    A    A/D/G
>    A    A/D/H
>    Updated to revision 1.
>    A    A/D/G/pi
>    A    A/D/G/rho
>    A    A/D/G/tau
>    Updated to revision 1.
>    At revision 1.
>    
> Here's the script:
> 
> #!/bin/sh
> 
> # The next line is the only line you should need to adjust.
> SVNDIR=/home/kfogel/src/subversion
> 
> SVN=${SVNDIR}/subversion/svn/svn
> SVNSERVE=${SVNDIR}/subversion/svnserve/svnserve
> SVNADMIN=${SVNDIR}/subversion/svnadmin/svnadmin
> 
> # Select an access method.  If svn://, the svnserve setup is
> # handled automagically by this script; but if http://, then
> # you'll have to configure it yourself first.
> # 
> # URL=http://localhost/SOMETHING/repos
> # URL=svn://localhost/repos
> URL=file:///`pwd`/repos
> 
> rm -rf repos wc import-me
> 
> ${SVNADMIN} create repos
> 
> # These are for svnserve only.
> echo "[general]" > repos/conf/svnserve.conf
> echo "anon-access = write" >> repos/conf/svnserve.conf
> echo "auth-access = write" >> repos/conf/svnserve.conf
> 
> # The server will only be contacted if $URL is svn://foo, of course.
> ${SVNSERVE} --pid-file svnserve-pid -d -r `pwd`
> # And put the kill command in a file, in case need to run it manually.
> echo "kill -9 `cat svnserve-pid`" > k
> chmod a+rwx k
> 
> echo "### Making a Greek Tree for import..."
> mkdir import-me
> mkdir import-me/trunk
> mkdir import-me/tags
> mkdir import-me/branches
> mkdir import-me/trunk/A
> mkdir import-me/trunk/A/B/
> mkdir import-me/trunk/A/C/
> mkdir import-me/trunk/A/D/
> mkdir import-me/trunk/A/B/E/
> mkdir import-me/trunk/A/B/F/
> mkdir import-me/trunk/A/D/G/
> mkdir import-me/trunk/A/D/H/
> echo "This is the file 'iota'."        > import-me/trunk/iota
> echo "This is the file 'A/mu'."        > import-me/trunk/A/mu
> echo "This is the file 'A/B/lambda'."  > import-me/trunk/A/B/lambda
> echo "This is the file 'A/B/E/alpha'." > import-me/trunk/A/B/E/alpha
> echo "This is the file 'A/B/E/beta'."  > import-me/trunk/A/B/E/beta
> echo "This is the file 'A/D/gamma'."   > import-me/trunk/A/D/gamma
> echo "This is the file 'A/D/G/pi'."    > import-me/trunk/A/D/G/pi
> echo "This is the file 'A/D/G/rho'."   > import-me/trunk/A/D/G/rho
> echo "This is the file 'A/D/G/tau'."   > import-me/trunk/A/D/G/tau
> echo "This is the file 'A/D/H/chi'."   > import-me/trunk/A/D/H/chi
> echo "This is the file 'A/D/H/omega'." > import-me/trunk/A/D/H/omega
> echo "This is the file 'A/D/H/psi'."   > import-me/trunk/A/D/H/psi
> echo "### Done."
> echo ""
> echo "### Importing it..."
> (cd import-me; ${SVN} import -q -m "Initial import." ${URL})
> echo "### Done."
> echo ""
> 
> ${SVN} co -q --depth=immediates ${URL}/trunk wc
> 
> cd wc
> ${SVN} up --set-depth=immediates A/D
> ${SVN} up --set-depth=infinity A/D/G
> ${SVN} up
> ${SVN} diff --depth=infinity
> cd ..
> 
> # Put kill command in a file, in case need to run it manually.
> echo "kill -9 `cat svnserve-pid`" > k
> chmod a+rwx k
> ./k
> 
> ---------------------------------------------------------------------
> 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: svn diff with explicit --depth in sparse directory?

Posted by Karl Fogel <kf...@red-bean.com>.
"Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
> I find that svn_wc_get_diff_editor5() will only wrap the diff_editor
> with an ambient_depth_filter_editor when there is no explicit depth
> requested. This implies that, in a sparse wc a 'repos vs. wc' diff
> will produce a lot of missing-local-file diff when, say,
> --depth=infinity is specified.
>
> I curious whether this behavior is designed in this way intentionally,
> or just a bug? In the latter case, I can provide a patch.

This would be a bug; but, I can't reproduce it.  Can you supply a
script?  Mine below does not show the bug.  Instead it shows this
output:

   ### Making a Greek Tree for import...
   ### Done.
   
   ### Importing it...
   ### Done.
   
   A    A/D
   A    A/D/gamma
   A    A/D/G
   A    A/D/H
   Updated to revision 1.
   A    A/D/G/pi
   A    A/D/G/rho
   A    A/D/G/tau
   Updated to revision 1.
   At revision 1.
   
Here's the script:

#!/bin/sh

# The next line is the only line you should need to adjust.
SVNDIR=/home/kfogel/src/subversion

SVN=${SVNDIR}/subversion/svn/svn
SVNSERVE=${SVNDIR}/subversion/svnserve/svnserve
SVNADMIN=${SVNDIR}/subversion/svnadmin/svnadmin

# Select an access method.  If svn://, the svnserve setup is
# handled automagically by this script; but if http://, then
# you'll have to configure it yourself first.
# 
# URL=http://localhost/SOMETHING/repos
# URL=svn://localhost/repos
URL=file:///`pwd`/repos

rm -rf repos wc import-me

${SVNADMIN} create repos

# These are for svnserve only.
echo "[general]" > repos/conf/svnserve.conf
echo "anon-access = write" >> repos/conf/svnserve.conf
echo "auth-access = write" >> repos/conf/svnserve.conf

# The server will only be contacted if $URL is svn://foo, of course.
${SVNSERVE} --pid-file svnserve-pid -d -r `pwd`
# And put the kill command in a file, in case need to run it manually.
echo "kill -9 `cat svnserve-pid`" > k
chmod a+rwx k

echo "### Making a Greek Tree for import..."
mkdir import-me
mkdir import-me/trunk
mkdir import-me/tags
mkdir import-me/branches
mkdir import-me/trunk/A
mkdir import-me/trunk/A/B/
mkdir import-me/trunk/A/C/
mkdir import-me/trunk/A/D/
mkdir import-me/trunk/A/B/E/
mkdir import-me/trunk/A/B/F/
mkdir import-me/trunk/A/D/G/
mkdir import-me/trunk/A/D/H/
echo "This is the file 'iota'."        > import-me/trunk/iota
echo "This is the file 'A/mu'."        > import-me/trunk/A/mu
echo "This is the file 'A/B/lambda'."  > import-me/trunk/A/B/lambda
echo "This is the file 'A/B/E/alpha'." > import-me/trunk/A/B/E/alpha
echo "This is the file 'A/B/E/beta'."  > import-me/trunk/A/B/E/beta
echo "This is the file 'A/D/gamma'."   > import-me/trunk/A/D/gamma
echo "This is the file 'A/D/G/pi'."    > import-me/trunk/A/D/G/pi
echo "This is the file 'A/D/G/rho'."   > import-me/trunk/A/D/G/rho
echo "This is the file 'A/D/G/tau'."   > import-me/trunk/A/D/G/tau
echo "This is the file 'A/D/H/chi'."   > import-me/trunk/A/D/H/chi
echo "This is the file 'A/D/H/omega'." > import-me/trunk/A/D/H/omega
echo "This is the file 'A/D/H/psi'."   > import-me/trunk/A/D/H/psi
echo "### Done."
echo ""
echo "### Importing it..."
(cd import-me; ${SVN} import -q -m "Initial import." ${URL})
echo "### Done."
echo ""

${SVN} co -q --depth=immediates ${URL}/trunk wc

cd wc
${SVN} up --set-depth=immediates A/D
${SVN} up --set-depth=infinity A/D/G
${SVN} up
${SVN} diff --depth=infinity
cd ..

# Put kill command in a file, in case need to run it manually.
echo "kill -9 `cat svnserve-pid`" > k
chmod a+rwx k
./k

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