SVN patch deletes all my parent folders when directory structure empty

26 Views Asked by At

I am trying to use sparse checkout mechanism instead of fetching all trunk. I have seen an issue when applying patch in svn.Where I did svn move operation. Where my project named ProjectK has lot folder in the trunk, I would pull only folder AAA from inside trunk

Folder structure ProjectK:

AAA/BBB/CCC/DDD/abc.txt
AAA/child1/child2/text12.txt
AAA/child1/child2/text123.txt
AAA/child111/child222/text123.txt
KKK/JJJ/name.txt

Here I want move a file abc.txt from current folder to new folder EEE

  1. Created workspace where I pulled latest code from SVN master

    AAA/BBB/CCC/DDD/abc.txt

STEP1:

svn co --depth empty svn+ssh://svn@url/ProjectK/trunk workspace123

STEP2:

svn up --parents AAA/BBB/CCC/DDD
A    AAA
A    AAA/BBB
A    AAA/BBB/CCC
Updating 'AAA/BBB/CCC/DDD':
A    AAA/BBB/CCC/DDD
A    AAA/BBB/CCC/DDD/abc.txt

STEP3: Did SVN move operation

svn mv abc.txt EEE
A         EEE/abc.txt
D         abc.txt

STEP4: Created patch file

svn diff --patch-compatible > new_patch.patch

STEP5: Pulled latest SVN master before applying patch

svn checkout --depth empty svn+ssh://url/ProjectK//trunk .

svn up --parents AAA/BBB/CCC/DDD

STEP6: Applying patch for latest code

svn patch new_patch.patch

D         AAA/BBB/CCC/DDD/abc.txt
D         AAA/BBB/CCC/DDD
D         AAA/BBB/CCC
D         AAA/BBB
D         AAA
A         AAA
A         AAA/BBB
A         AAA/BBB/CCC
A         AAA/BBB/CCC/DDD
A         AAA/BBB/CCC/DDD/EEE
A         AAA/BBB/CCC/DDD/EEE/abc.txt

After applying patch all folders inside my folder AAA got deleted instead of AAA/BBB/CCC/DDD, what I am doing wrong here?

Replacing      AAA
Adding         AAA/BBB
Adding         AAA/BBB/CCC
Adding         AAA/BBB/CCC/DDD
Adding         AAA/BBB/CCC/DDD/EEE
Adding         AAA/BBB/CCC/DDD/EEE/abc.txt
Transmitting file data .done
0

There are 0 best solutions below