Commits

Patrick Mézard committed 1c46ad3

test_externals: test branch copy, use absolute externals

Comments (0)

Files changed (3)

tests/fixtures/externals.sh

 echo a > a
 svn add a
 cat > externals <<EOF
-../externals/project1 deps/project1
+^/externals/project1 deps/project1
 EOF
 svn propset -F externals svn:externals .
 svn ci -m "set externals on ."
 # Add another one
 cat > externals <<EOF
-../externals/project1 deps/project1
-../externals/project2 deps/project2
+^/externals/project1 deps/project1
+^/externals/project2 deps/project2
 EOF
 svn propset -F externals svn:externals .
 svn ci -m "update externals on ."
 # Suppress an external and add one on a subdir
 cat > externals <<EOF
-../externals/project2 deps/project2
+^/externals/project2 deps/project2
 EOF
 svn propset -F externals svn:externals .
 mkdir subdir
 mkdir subdir2
 svn add subdir subdir2
 cat > externals <<EOF
-../externals/project1 deps/project1
+^/externals/project1 deps/project1
 EOF
 svn propset -F externals svn:externals subdir subdir2
 svn ci -m "add on subdir"
+# Test branch with externals
+svn up
+cd ../branches
+svn copy ../trunk branch1
+svn propdel svn:externals branch1/subdir2
+svn ci -m 'externals in subtree'
+cd ../trunk
 # Suppress the subdirectory
-svn rm subdir
+svn rm --force subdir
 svn ci -m 'remove externals subdir'
 # Remove the property on subdir2
 svn propdel svn:externals subdir2

tests/fixtures/externals.svndump

 SVN-fs-dump-format-version: 2
 
-UUID: a5e66397-f826-4e1c-bc26-5123bb064477
+UUID: b0dd1dbb-3e41-4ee0-8194-38c44cae026b
 
 Revision-number: 0
 Prop-content-length: 56
 K 8
 svn:date
 V 27
-2008-12-27T12:49:06.601814Z
+2009-01-12T22:58:18.300869Z
 PROPS-END
 
 Revision-number: 1
 K 8
 svn:date
 V 27
-2008-12-27T12:49:06.652695Z
+2009-01-12T22:58:18.364893Z
 PROPS-END
 
 Node-path: branches
 K 8
 svn:date
 V 27
-2008-12-27T12:49:07.236694Z
+2009-01-12T22:58:19.228564Z
 PROPS-END
 
 Node-path: externals/project1
 K 8
 svn:date
 V 27
-2008-12-27T12:49:08.250996Z
+2009-01-12T22:58:20.213824Z
 PROPS-END
 
 Node-path: trunk
 Node-kind: dir
 Node-action: change
-Prop-content-length: 71
-Content-length: 71
+Prop-content-length: 70
+Content-length: 70
 
 K 13
 svn:externals
-V 36
-../externals/project1 deps/project1
+V 35
+^/externals/project1 deps/project1
 
 PROPS-END
 
 K 8
 svn:date
 V 27
-2008-12-27T12:49:09.190834Z
+2009-01-12T22:58:21.179341Z
 PROPS-END
 
 Node-path: trunk
 Node-kind: dir
 Node-action: change
-Prop-content-length: 107
-Content-length: 107
+Prop-content-length: 105
+Content-length: 105
 
 K 13
 svn:externals
-V 72
-../externals/project1 deps/project1
-../externals/project2 deps/project2
+V 70
+^/externals/project1 deps/project1
+^/externals/project2 deps/project2
 
 PROPS-END
 
 K 8
 svn:date
 V 27
-2008-12-27T12:49:10.289216Z
+2009-01-12T22:58:22.266419Z
 PROPS-END
 
 Node-path: trunk
 Node-kind: dir
 Node-action: change
-Prop-content-length: 71
-Content-length: 71
+Prop-content-length: 70
+Content-length: 70
 
 K 13
 svn:externals
-V 36
-../externals/project2 deps/project2
+V 35
+^/externals/project2 deps/project2
 
 PROPS-END
 
 Node-path: trunk/subdir
 Node-kind: dir
 Node-action: add
-Prop-content-length: 71
-Content-length: 71
+Prop-content-length: 70
+Content-length: 70
 
 K 13
 svn:externals
-V 36
-../externals/project1 deps/project1
+V 35
+^/externals/project1 deps/project1
 
 PROPS-END
 
 Node-path: trunk/subdir2
 Node-kind: dir
 Node-action: add
-Prop-content-length: 71
-Content-length: 71
+Prop-content-length: 70
+Content-length: 70
 
 K 13
 svn:externals
-V 36
-../externals/project1 deps/project1
+V 35
+^/externals/project1 deps/project1
 
 PROPS-END
 
 
 Revision-number: 6
+Prop-content-length: 122
+Content-length: 122
+
+K 7
+svn:log
+V 20
+externals in subtree
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2009-01-12T22:58:25.185874Z
+PROPS-END
+
+Node-path: branches/branch1
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 5
+Node-copyfrom-path: trunk
+Prop-content-length: 94
+Content-length: 94
+
+K 13
+svn:externals
+V 35
+^/externals/project2 deps/project2
+
+K 13
+svn:mergeinfo
+V 0
+
+PROPS-END
+
+
+Node-path: branches/branch1/subdir2
+Node-kind: dir
+Node-action: change
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Revision-number: 7
 Prop-content-length: 125
 Content-length: 125
 
 K 8
 svn:date
 V 27
-2008-12-27T12:49:11.184732Z
+2009-01-12T22:58:26.188417Z
 PROPS-END
 
 Node-path: trunk/subdir
 Node-action: delete
 
 
-Revision-number: 7
+Revision-number: 8
 Prop-content-length: 126
 Content-length: 126
 
 K 8
 svn:date
 V 27
-2008-12-27T12:49:12.194114Z
+2009-01-12T22:58:27.183612Z
 PROPS-END
 
 Node-path: trunk/subdir2

tests/test_externals.py

 
         ref0 = """\
 [.]
- ../externals/project1 deps/project1
+ ^/externals/project1 deps/project1
 """
         self.assertEqual(ref0, repo[0]['.hgsvnexternals'].data())
         ref1 = """\
 [.]
- ../externals/project1 deps/project1
- ../externals/project2 deps/project2
+ ^/externals/project1 deps/project1
+ ^/externals/project2 deps/project2
 """
         self.assertEqual(ref1, repo[1]['.hgsvnexternals'].data())
 
         ref2 = """\
 [.]
- ../externals/project2 deps/project2
+ ^/externals/project2 deps/project2
 [subdir]
- ../externals/project1 deps/project1
+ ^/externals/project1 deps/project1
 [subdir2]
- ../externals/project1 deps/project1
+ ^/externals/project1 deps/project1
 """
         self.assertEqual(ref2, repo[2]['.hgsvnexternals'].data())
 
         ref3 = """\
 [.]
- ../externals/project2 deps/project2
-[subdir2]
- ../externals/project1 deps/project1
+ ^/externals/project2 deps/project2
+[subdir]
+ ^/externals/project1 deps/project1
 """
         self.assertEqual(ref3, repo[3]['.hgsvnexternals'].data())
 
         ref4 = """\
 [.]
- ../externals/project2 deps/project2
+ ^/externals/project2 deps/project2
+[subdir2]
+ ^/externals/project1 deps/project1
 """
         self.assertEqual(ref4, repo[4]['.hgsvnexternals'].data())
 
+        ref5 = """\
+[.]
+ ^/externals/project2 deps/project2
+"""
+        self.assertEqual(ref5, repo[5]['.hgsvnexternals'].data())
+
     def test_externals_stupid(self):
         self.test_externals(True)