Rev 296: Add more tests demonstrating weird behaviour in the subversion libraries. in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev
Jelmer Vernooij
jelmer at samba.org
Tue Dec 26 00:13:25 GMT 2006
------------------------------------------------------------
revno: 296
revision-id: jelmer at samba.org-20061226001231-vfnun5usqacz9wqy
parent: jelmer at samba.org-20061225233146-vjrnml25vfrv5o3w
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Tue 2006-12-26 01:12:31 +0100
message:
Add more tests demonstrating weird behaviour in the subversion libraries.
modified:
mapping.txt mapping.txt-20060625151311-9ghaqrm71ajq593n-1
tests/test_repos.py test_repos.py-20060508151940-ddc49a59257ca712
=== modified file 'mapping.txt'
--- a/mapping.txt 2006-10-16 13:34:57 +0000
+++ b/mapping.txt 2006-12-26 00:12:31 +0000
@@ -77,6 +77,12 @@
Since / is forbidden in revision ids, the '/', '-', '%' and all whitespace
characters are urlencoded.
+File id mappings can only change if something about the metadata of a file changed: it
+is in no way related to the contents of that file.
+
+If a file is being replaced by a copy of itself in an older revision it will
+receive a new file id.
+
NEXT VERSION: Special rules are applied to make sure that renames are tracked.
== Properties ==
=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py 2006-12-25 23:09:33 +0000
+++ b/tests/test_repos.py 2006-12-26 00:12:31 +0000
@@ -555,6 +555,325 @@
"svn-v%d:3@%s-" % (MAPPING_VERSION, oldrepos.uuid))
self.assertNotEqual(inv1.path2id("bla"), inv2.path2id("bla"))
+ def test_fetch_replace_backup(self):
+ filename = os.path.join(self.test_dir, "dumpfile")
+ open(filename, 'w').write("""SVN-fs-dump-format-version: 2
+
+UUID: 6dcc86fc-ac21-4df7-a3a3-87616123c853
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2006-12-25T04:27:54.633666Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 108
+Content-length: 108
+
+K 7
+svn:log
+V 8
+Add dir
+
+K 10
+svn:author
+V 6
+jelmer
+K 8
+svn:date
+V 27
+2006-12-25T04:28:17.503039Z
+PROPS-END
+
+Node-path: bla
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Revision-number: 2
+Prop-content-length: 117
+Content-length: 117
+
+K 7
+svn:log
+V 16
+Add another dir
+
+K 10
+svn:author
+V 6
+jelmer
+K 8
+svn:date
+V 27
+2006-12-25T04:28:30.160663Z
+PROPS-END
+
+Node-path: blie
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Revision-number: 3
+Prop-content-length: 105
+Content-length: 105
+
+K 7
+svn:log
+V 5
+Copy
+
+K 10
+svn:author
+V 6
+jelmer
+K 8
+svn:date
+V 27
+2006-12-25T04:28:44.996894Z
+PROPS-END
+
+Node-path: bloe
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 1
+Node-copyfrom-path: bla
+
+
+Revision-number: 4
+Prop-content-length: 112
+Content-length: 112
+
+K 7
+svn:log
+V 11
+Change bla
+
+K 10
+svn:author
+V 6
+jelmer
+K 8
+svn:date
+V 27
+2006-12-25T23:51:09.678679Z
+PROPS-END
+
+Node-path: bla
+Node-kind: dir
+Node-action: change
+Prop-content-length: 28
+Content-length: 28
+
+K 3
+foo
+V 5
+bloe
+
+PROPS-END
+
+
+Revision-number: 5
+Prop-content-length: 108
+Content-length: 108
+
+K 7
+svn:log
+V 8
+Replace
+
+K 10
+svn:author
+V 6
+jelmer
+K 8
+svn:date
+V 27
+2006-12-25T04:30:06.383777Z
+PROPS-END
+
+Node-path: bla
+Node-action: delete
+
+
+Node-path: bla
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 1
+Node-copyfrom-path: bla
+
+
+""")
+ os.mkdir("old")
+
+ load_dumpfile("dumpfile", "old")
+ oldrepos = Repository.open("old")
+ dir = BzrDir.create("f")
+ newrepos = dir.create_repository()
+ oldrepos.copy_content_into(newrepos)
+ self.assertTrue(newrepos.has_revision(
+ "svn-v%d:1@%s-" % (MAPPING_VERSION, oldrepos.uuid)))
+ self.assertTrue(newrepos.has_revision(
+ "svn-v%d:3@%s-" % (MAPPING_VERSION, oldrepos.uuid)))
+ inv1 = newrepos.get_inventory(
+ "svn-v%d:1@%s-" % (MAPPING_VERSION, oldrepos.uuid))
+ inv2 = newrepos.get_inventory(
+ "svn-v%d:3@%s-" % (MAPPING_VERSION, oldrepos.uuid))
+ self.assertNotEqual(inv1.path2id("bla"), inv2.path2id("bla"))
+
+ def test_fetch_replace_unrelated(self):
+ filename = os.path.join(self.test_dir, "dumpfile")
+ open(filename, 'w').write("""SVN-fs-dump-format-version: 2
+
+UUID: 606c7b1f-987c-4826-b37d-eb456ceb87e1
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2006-12-26T00:04:55.850520Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 103
+Content-length: 103
+
+K 7
+svn:log
+V 3
+add
+K 10
+svn:author
+V 6
+jelmer
+K 8
+svn:date
+V 27
+2006-12-26T00:05:15.504335Z
+PROPS-END
+
+Node-path: x
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Revision-number: 2
+Prop-content-length: 102
+Content-length: 102
+
+K 7
+svn:log
+V 2
+rm
+K 10
+svn:author
+V 6
+jelmer
+K 8
+svn:date
+V 27
+2006-12-26T00:05:30.775369Z
+PROPS-END
+
+Node-path: x
+Node-action: delete
+
+
+Revision-number: 3
+Prop-content-length: 105
+Content-length: 105
+
+K 7
+svn:log
+V 5
+readd
+K 10
+svn:author
+V 6
+jelmer
+K 8
+svn:date
+V 27
+2006-12-26T00:05:43.584249Z
+PROPS-END
+
+Node-path: x
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Revision-number: 4
+Prop-content-length: 108
+Content-length: 108
+
+K 7
+svn:log
+V 8
+Replace
+
+K 10
+svn:author
+V 6
+jelmer
+K 8
+svn:date
+V 27
+2006-12-25T04:30:06.383777Z
+PROPS-END
+
+Node-path: x
+Node-action: delete
+
+
+Node-path: x
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 1
+Node-copyfrom-path: x
+
+
+""")
+ os.mkdir("old")
+
+ load_dumpfile("dumpfile", "old")
+ oldrepos = Repository.open("old")
+ dir = BzrDir.create("f")
+ newrepos = dir.create_repository()
+ oldrepos.copy_content_into(newrepos)
+ self.assertTrue(newrepos.has_revision(
+ "svn-v%d:1@%s-" % (MAPPING_VERSION, oldrepos.uuid)))
+ self.assertTrue(newrepos.has_revision(
+ "svn-v%d:4@%s-" % (MAPPING_VERSION, oldrepos.uuid)))
+ inv1 = newrepos.get_inventory(
+ "svn-v%d:1@%s-" % (MAPPING_VERSION, oldrepos.uuid))
+ inv2 = newrepos.get_inventory(
+ "svn-v%d:4@%s-" % (MAPPING_VERSION, oldrepos.uuid))
+ self.assertNotEqual(inv1.path2id("x"), inv2.path2id("x"))
+
# FIXME
def notest_fetch_all(self):
repos_url = self.make_client('d', 'dc')
More information about the bazaar-commits
mailing list