# HG changeset patch # User Patrick Mezard # Date 1228928599 21600 # Node ID 24a64fb0e74b5b6b42350de503f95c56a6708369 # Parent c35f59aa200e94dce25d8a70a795a2bc8f70e572 run.py: register and develop test_fetch_symlinks diff --git a/tests/fixtures/symlinks.sh b/tests/fixtures/symlinks.sh --- a/tests/fixtures/symlinks.sh +++ b/tests/fixtures/symlinks.sh @@ -35,6 +35,12 @@ ln -s b linkaa rm d2/linka ln -s b d2/linka svn ci -m "update symlinks" +# Replace a symlink with a regular file +rm linkaa +echo data > linkaa +svn propdel svn:special linkaa +svn rm d2/linka +svn ci -m "undo link" cd ../.. svnadmin dump testrepo > ../symlinks.svndump diff --git a/tests/fixtures/symlinks.svndump b/tests/fixtures/symlinks.svndump --- a/tests/fixtures/symlinks.svndump +++ b/tests/fixtures/symlinks.svndump @@ -1,6 +1,6 @@ SVN-fs-dump-format-version: 2 -UUID: 0155d33a-8628-44e5-a968-540cca8db82a +UUID: f4b30fa8-841e-4d12-8994-eb41ecdeab2e Revision-number: 0 Prop-content-length: 56 @@ -9,7 +9,7 @@ Content-length: 56 K 8 svn:date V 27 -2008-11-16T15:00:25.793049Z +2008-12-07T12:10:46.975375Z PROPS-END Revision-number: 1 @@ -27,7 +27,7 @@ pmezard K 8 svn:date V 27 -2008-11-16T15:00:25.873999Z +2008-12-07T12:10:47.047283Z PROPS-END Node-path: branches @@ -63,7 +63,7 @@ pmezard K 8 svn:date V 27 -2008-11-16T15:00:26.214702Z +2008-12-07T12:10:48.218632Z PROPS-END Node-path: trunk/a @@ -132,7 +132,7 @@ pmezard K 8 svn:date V 27 -2008-11-16T15:00:29.163300Z +2008-12-07T12:10:51.153329Z PROPS-END Node-path: trunk/d2 @@ -193,7 +193,7 @@ pmezard K 8 svn:date V 27 -2008-11-16T15:00:30.171883Z +2008-12-07T12:10:52.174562Z PROPS-END Node-path: trunk/d2/linka @@ -214,3 +214,41 @@ Content-length: 6 link b +Revision-number: 5 +Prop-content-length: 110 +Content-length: 110 + +K 7 +svn:log +V 9 +undo link +K 10 +svn:author +V 7 +pmezard +K 8 +svn:date +V 27 +2008-12-07T12:10:53.200258Z +PROPS-END + +Node-path: trunk/d2/linka +Node-action: delete + + +Node-path: trunk/linkaa +Node-kind: file +Node-action: change +Prop-content-length: 34 +Text-content-length: 5 +Text-content-md5: 6137cde4893c59f76f005a8123d8e8e6 +Content-length: 39 + +K 13 +svn:mergeinfo +V 0 + +PROPS-END +data + + diff --git a/tests/run.py b/tests/run.py --- a/tests/run.py +++ b/tests/run.py @@ -9,6 +9,7 @@ import test_fetch_command import test_fetch_command_regexes import test_fetch_exec import test_fetch_renames +import test_fetch_symlinks import test_fetch_truncated import test_push_command import test_push_renames @@ -22,6 +23,7 @@ def suite(): test_fetch_command_regexes.suite(), test_fetch_exec.suite(), test_fetch_renames.suite(), + test_fetch_symlinks.suite(), test_fetch_truncated.suite(), test_push_command.suite(), test_push_renames.suite(), diff --git a/tests/test_fetch_symlinks.py b/tests/test_fetch_symlinks.py --- a/tests/test_fetch_symlinks.py +++ b/tests/test_fetch_symlinks.py @@ -18,15 +18,31 @@ class TestFetchSymlinks(test_util.TestBa continue self.assertFalse(r[f].data().startswith('link ')) # Check symlinks in tip - tip = repo['tip'] links = { - 'linkaa': 'b', - 'd2/linka': 'b', + 0: { + 'linka': 'a', + 'd/linka': 'a', + }, + 1: { + 'linkaa': 'a', + 'd2/linka': 'a', + }, + 2: { + 'linkaa': 'b', + 'd2/linka': 'b', + }, + 3: { + }, } - for f in tip.manifest(): - self.assertEqual(f in links, 'l' in tip[f].flags()) - if f in links: - self.assertEqual(links[f], tip[f].data()) + + for rev in repo: + ctx = repo[rev] + for f in ctx.manifest(): + self.assertEqual(f in links[rev], 'l' in ctx[f].flags()) + if f in links[rev]: + self.assertEqual(links[rev][f], ctx[f].data()) + for f in links[rev]: + self.assertTrue(f in ctx) def test_symlinks_stupid(self): self.test_symlinks(True)