[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Re: "svn diff" doesn't work correctly if a file is replaced with a symlink locally

From: Dmitry Pavlenko <pavlenko_at_tmatesoft.com>
Date: Thu, 19 Jul 2018 19:03:30 +0200

Hello again,
I'm attaching a reproducing test.

I'm not 100% sure that

[
    'Index: %s\n' % sbox.path('iota'),
    '===================================================================\n',
    '--- %s\t(revision 1)\n' % sbox.path('iota'),
    '+++ %s\t(working copy)\n' % sbox.path('iota'),
    '@@ -1 +1 @@\n',
    '-This is the file \'iota\'.\n',
    '+link iota\n',
    '\ No newline at end of file\n',
    '\n',
    'Property changes on: iota\n',
    '___________________________________________________________________\n',
    'Added: svn:special\n',
    '## -0,0 +1 ##\n',
    '+*\n',
    '\ No newline at end of property\n',
  ]

is the expected output but definitely the diff command shouldn't fail with
exit code 1 as it does now.

-- 
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge
On среда, 11 июля 2018 г. 16:13:06 CEST Dmitry Pavlenko wrote:
> Hello.
> The following scenario fails for me: delete a file, create a symlink with
> the same name, run "svn diff". Instead of displaying the diff, SVN tries to
> read the link content. If "NOWHERE" variable is set to the file name, the
> symlink refers to itself, showing another error.
> 
> Instead I would expect something with "-" and "+" markers. If you uncomment
> #echo "link $NOWHERE" > $WC_PATH/trunk/file
> 
> and comment out "ln -s" call, the script will display approximately what I
> would expect (but without svn:special).
> 
> I'm not sure if this is a known bug, sorry for reporting something known if
> it is.
> 
> Locally I also have similar scenario failing in another way: before reading
> the symlink it displays deletion of "trunk/trunk/symlink" (yes, unexpectedly
> double "trunk", in my local test the file is called "symlink"). But I think
> it's the same issue. If it will still fail after this one is fixed, I'll
> analyze why.
> 
> 
> 
> #!/bin/sh
> 
> SVN=svn
> 
> #1. Create an empty SVN repository.
> 
> REPOSITORY_PATH="$PWD/svn.repo"
> 
> svnadmin create "$REPOSITORY_PATH"
> 
> # 2. Add a file to the repository.
> 
> WC_PATH="/tmp/wc"
> REPOSITORY_URL="file://$REPOSITORY_PATH"
> 
> $SVN co $REPOSITORY_URL $WC_PATH
> $SVN mkdir $WC_PATH/trunk
> 
> echo "content" > $WC_PATH/trunk/file
> 
> $SVN add $WC_PATH/trunk/file
> $SVN commit -m "A file added." $WC_PATH
> 
> # 3. Replace the file with a symlink pointing to nowhere (or to itself ---
> for another kind of error)
> 
> NOWHERE="changed/path"
> #NOWHERE="file"
> 
> rm $WC_PATH/trunk/file
> 
> ln -s $NOWHERE $WC_PATH/trunk/file
> 
> # By the way: uncomment the following line and comment out the previous one
> for comparison
> #echo "link $NOWHERE" > $WC_PATH/trunk/file
> 
> # 4. Create diff between repository HEAD and working copy:
> 
> $SVN diff --git $REPOSITORY_URL $WC_PATH
> 
> echo ""
> echo ""
> echo "-----------------------------------------"
> echo "If you see something like"
> echo "-content"
> echo "+link $NOWHERE"
> echo "And svn:special property set to '*'"
> echo "Then consider test passed"
> echo "-----------------------------------------"

Received on 2018-07-19 19:03:52 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.