Add some assertions.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 8 Jul 2008 16:22:50 +0000 (18:22 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 8 Jul 2008 16:22:50 +0000 (18:22 +0200)
fetch.py

index c68c3051466455b94c5ba914452409c691b7ae4a..5093217ea53d364fc7d2fc443e0525580340c8b2 100644 (file)
--- a/fetch.py
+++ b/fetch.py
@@ -539,6 +539,7 @@ class InterFromSvnRepository(InterRepository):
                 if pb:
                     pb.update("determining revisions to fetch", revnum-revmeta.revnum, revnum)
                 revid = revmeta.get_revision_id(mapping)
+                assert prev != revid
                 lhs_parent[prev] = revid
                 meta_map[revid] = revmeta
                 if revid in checked:
@@ -601,7 +602,7 @@ class InterFromSvnRepository(InterRepository):
             for (revid, parent_revid, revmeta) in revids:
                 pb.update('copying revision', num, len(revids))
 
-                assert parent_revid is not None
+                assert parent_revid is not None and parent_revid != revid
 
                 if parent_revid == NULL_REVISION:
                     parent_inv = Inventory(root_id=None)
@@ -626,6 +627,8 @@ class InterFromSvnRepository(InterRepository):
                     try:
                         conn = self.source.transport.connections.get(urlutils.join(repos_root, parent_branch))
 
+                        assert editor.revnum > parent_revnum or start_empty
+
                         if parent_branch != editor.branch_path:
                             reporter = conn.do_switch(editor.revnum, "", True, 
                                 urlutils.join(repos_root, editor.branch_path),