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

Re: [patch] applying patch can fail with dry_run

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Thu, 12 Jan 2012 21:48:37 +0100

On 12.01.2012 21:13, Philip Martin wrote:
> Stefan Küng<tortoisesvn_at_gmail.com> writes:
>
>> Question is: do we need the notifications for deleting empty dirs in a
>> dry-run? If yes, then this get's complicated:
>> the error is thrown from svn_wc_walk_status() called in
>> check_dir_empty. I could just not call that function in case of a
>> dry-run, or catch that specific error and go on. But then the
>> notifications wouldn't be completely accurate anymore.
>>
>> So assuming we don't want to extend svn_wc_walk_status to take a
>> dry-run param, the notifications for deleting empty dirs wouldn't be
>> accurate.
>>
>> Should I just change delete_empty_dirs() to not use the dry_run param
>> and not get the notifications for those in a dry-run?
>> I think no notifications is better than inaccurate ones (at least in a
>> dry-run).
>
> I'm not clear what problem the patch is triggering. I assume the patch
> deletes one or more files but then what happens?
>
> At present a --dry-run patch that deletes a file will track the
> deletions and notify about a directory that would be empty and deleted,
> we don't want to lose that feature.

I'm not sure how this is triggered exactly. If you check the mailing
list thread on the TSVN mailing list:
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2899409
you can see that both the working copy and the patch to reproduce the
issue are quite big.

 From what I could find out I think the problem is when the patch
removes all versioned files in a folder, but adds new files in that same
folder.
In a real run, the file is added to the working copy and the folder is
not empty anymore. In a dry-run however, the folder is marked as
removed, but then the still unversioned file is still there and that's
when the error
The Node ..../newDirectory was not found
is thrown.

To reproduce:
download the file
http://tortoisesvn.tigris.org/ds/getDSMessageAttachment.do/Updating_PBEM_system.patch?dsForumId=4061&dsMessageId=2899409&dsAttachmentId=3443155&dsAttachmentMime=application/octet-stream
(save as test.patch)

$ svn co https://triplea.svn.sourceforge.net/svnroot/triplea/trunk wc -r3375
$ svn patch test.patch wc --dry-run

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
Received on 2012-01-12 21:49:33 CET

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