comparison tests/fixtures/renames_with_prefix.sh @ 1234:d3c79072bc6a

editor: correctly import symlink copy+modify with non-empty prefix We alwasy fail editing for symlinks, since we strip the leading 'link ' subversion includes when storing in mercurial, and then let svn attempt to apply deltas against the stripped version. This unsurprisingly fails, and we write the resulting empty-string to the Filestore for the current revision, and add the symlink in question to the missing list to handle stupidly later. Unfortunately, this would break down because editing adds files to the store using their absolute path whereas missing files are added relative to our subdir. the absolut path file appears to win, which results in us getting a symlink whose target is the empty string. This fixes the problem by adding missing files to the fileStore using their absolute path.
author David Schleimer <dschleimer@fb.com>
date Mon, 07 Apr 2014 18:28:35 -0700
parents tests/fixtures/renames.sh@0d0132cba155
children
comparison
equal deleted inserted replaced
1233:0d0132cba155 1234:d3c79072bc6a
1 #!/bin/sh
2 #
3 # Generate renames_with_prefix.svndump
4 #
5
6 set -e
7
8 rm -rf temp
9
10 mkdir temp
11 cd temp
12
13 mkdir -p project-orig/prefix
14 cd project-orig/prefix
15 mkdir trunk
16 mkdir branches
17 cd ../..
18
19 svnadmin create testrepo
20 svnurl=file://`pwd`/testrepo
21 svn import project-orig $svnurl -m "init project"
22 svnurl=$svnurl/prefix
23
24 svn co $svnurl project
25 cd project/trunk
26 # Entries for regular tests
27 echo a > a
28 echo b > b
29 ln -s a linka
30 ln -s b linkb
31 mkdir -p da/db
32 echo c > da/daf
33 ln -s daf da/dalink
34 echo d > da/db/dbf
35 ln -s ../daf da/db/dblink
36 # Entries to test delete + copy
37 echo deleted > deletedfile
38 ln -s b deletedlink
39 mkdir deleteddir
40 echo deleteddir > deleteddir/f
41 ln -s f deleteddir/link
42 # Entries to test copy before change
43 echo changed > changed
44 ln -s changed changedlink
45 mkdir changeddir
46 echo changed2 > changeddir/f
47 ln -s f changeddir/link
48 # Entries unchanged in the rest of history
49 echo unchanged > unchanged
50 ln -s unchanged unchangedlink
51 mkdir unchangeddir
52 echo unchanged2 > unchangeddir/f
53 ln -s f unchangeddir/link
54 # One of the files will be changed afterwards, to test
55 # group copies detection
56 mkdir groupdir
57 echo a > groupdir/a
58 echo b > groupdir/b
59 ln -s a groupdir/linka
60 ln -s b groupdir/linkb
61 svn add a b linka linkb da deleted* changed* unchanged* groupdir
62 svn ci -m "add everything"
63 # Remove files to be copied later
64 svn rm deletedfile
65 svn rm deleteddir
66 svn rm deletedlink
67 # Update files to be copied before this change
68 echo changed >> changed
69 echo changed2 >> changeddir/f
70 ln -sfn changeddir/f changedlink
71 ln -sfn ../changed changeddir/link
72 # Update one of the groupdir files
73 echo a >> groupdir/a
74 ln -sfn ../a groupdir/linka
75 svn ci -m "delete files and dirs"
76 cd ../branches
77 svn cp ../trunk branch1
78 svn ci -m "create branch1"
79 cd branch1
80 echo c > c
81 ln -s c linkc
82 svn add c linkc
83 svn ci -m "add c and linkc"
84 cd ../../trunk
85 # Regular copy and rename
86 svn cp a a1
87 svn cp linka linka1
88 svn mv a a2
89 svn mv linka linka2
90 # Copy and update of source and dest
91 svn cp b b1
92 svn cp linkb linkb1
93 echo b >> b
94 echo c >> b1
95 ln -sfn bb linkb
96 ln -sfn bc linkb1
97 # Directory copy and renaming
98 svn cp da da1
99 svn mv da da2
100 # Test one copy operation in branch
101 cd ../branches/branch1
102 svn cp c c1
103 svn cp linkc linkc1
104 echo c >> c1
105 ln -sfn cc linkc1
106 cd ../..
107 svn ci -m "rename and copy a, b, c and da, plus their links"
108 cd trunk
109 # Copy across branch
110 svn cp ../branches/branch1/c c
111 svn cp ../branches/branch1/linkc linkc
112 svn ci -m "copy c from branch1"
113 # Copy deleted stuff from the past
114 svn cp $svnurl/trunk/deletedfile@2 deletedfile
115 svn cp $svnurl/trunk/deleteddir@2 deleteddir
116 svn cp $svnurl/trunk/deletedlink@2 deletedlink
117 svn ci -m "copy stuff from the past"
118 # Copy data from the past before it was changed
119 svn cp $svnurl/trunk/changed@2 changed2
120 svn cp $svnurl/trunk/changeddir@2 changeddir2
121 svn cp $svnurl/trunk/changedlink@2 changedlink2
122 # Harder, copy from the past before change and change it again
123 # This confused the stupid diff path
124 svn cp $svnurl/trunk/changed@2 changed3
125 svn cp $svnurl/trunk/changedlink@2 changedlink3
126 echo changed3 >> changed3
127 ln -sfn changed3 changedlink3
128 svn ci -m "copy stuff from the past before change"
129 # Copy unchanged stuff from the past. Since no changed occured in these files
130 # between the source and parent revision, we record them as copy from parent
131 # instead of source rev.
132 svn cp $svnurl/trunk/unchanged@2 unchanged2
133 svn cp $svnurl/trunk/unchangeddir@2 unchangeddir2
134 svn cp $svnurl/trunk/unchangedlink@2 unchangedlink2
135 svn ci -m "copy unchanged stuff from the past"
136 # Copy groupdir, unfortunately one file was changed after r2 so the
137 # copy should not be recorded at all
138 svn cp $svnurl/trunk/groupdir@2 groupdir2
139 svn ci -m "copy groupdir from the past"
140 cd ../..
141
142 svnadmin dump testrepo > ../renames_with_prefix.svndump