Rev 518: Merge tets fixes. in file:///data/jelmer/bzr-svn/0.4/

Jelmer Vernooij jelmer at samba.org
Thu Jul 12 09:28:39 BST 2007


At file:///data/jelmer/bzr-svn/0.4/

------------------------------------------------------------
revno: 518
revision-id: jelmer at samba.org-20070710032434-q4a4hkcymd1i0ox3
parent: jelmer at samba.org-20070709164826-v6kgvuded2zl16qx
parent: jelmer at samba.org-20070705162811-spxhzl1p7xwcfyvj
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Tue 2007-07-10 04:24:34 +0100
message:
  Merge tets fixes.
modified:
  logwalker.py                   logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
  tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
  tests/test_upgrade.py          test_upgrade.py-20070106170128-64zt3eqggg4tng1c-1
    ------------------------------------------------------------
    revno: 515.1.1
    revision-id: jelmer at samba.org-20070705162811-spxhzl1p7xwcfyvj
    parent: jelmer at samba.org-20070705103229-tiahwcgwm7lokboq
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Thu 2007-07-05 18:28:11 +0200
    message:
      Fix some tests.
=== modified file 'logwalker.py'
--- a/logwalker.py	2007-07-03 00:31:08 +0000
+++ b/logwalker.py	2007-07-05 16:28:11 +0000
@@ -252,8 +252,11 @@
     def find_children(self, path, revnum):
         """Find all children of path in revnum."""
         path = path.strip("/")
-        if self.transport.check_path(path, revnum) == svn.core.svn_node_file:
+        ft = self.transport.check_path(path, revnum)
+        if ft == svn.core.svn_node_file:
             return []
+        assert ft == svn.core.svn_node_dir
+
         class TreeLister(svn.delta.Editor):
             def __init__(self, base):
                 self.files = []
@@ -296,12 +299,16 @@
         pool = Pool()
         editor = TreeLister(path)
         edit, baton = svn.delta.make_editor(editor, pool)
-        root_repos = self.transport.get_repos_root()
-        self.transport.reparent(os.path.join(root_repos, path))
-        reporter = self.transport.do_update(
-                        revnum, "", True, edit, baton, pool)
-        reporter.set_path("", revnum, True, None, pool)
-        reporter.finish_report(pool)
+        old_base = self.transport.base
+        try:
+            root_repos = self.transport.get_repos_root()
+            self.transport.reparent(os.path.join(root_repos, path))
+            reporter = self.transport.do_update(
+                            revnum, "", True, edit, baton, pool)
+            reporter.set_path("", revnum, True, None, pool)
+            reporter.finish_report(pool)
+        finally:
+            self.transport.reparent(old_base)
         return editor.files
 
     def get_previous(self, path, revnum):

=== modified file 'repository.py'
--- a/repository.py	2007-07-04 21:33:40 +0000
+++ b/repository.py	2007-07-05 16:28:11 +0000
@@ -291,11 +291,18 @@
             return True
 
         try:
-            self.lookup_revision_id(revision_id)
-            return True
+            (path, revnum, scheme) = self.lookup_revision_id(revision_id)
         except NoSuchRevision:
             return False
 
+        try:
+            return (svn.core.svn_node_dir == self.transport.check_path(path, revnum))
+        except SubversionException, (_, num):
+            if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION:
+                return False
+            raise
+
+
     def revision_trees(self, revids):
         """See Repository.revision_trees()."""
         for revid in revids:

=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py	2007-07-03 16:42:54 +0000
+++ b/tests/test_repos.py	2007-07-05 16:28:11 +0000
@@ -369,6 +369,12 @@
         repository = bzrdir.find_repository()
         self.assertTrue(repository.has_revision(None))
 
+    def test_has_revision_future(self):
+        bzrdir = self.make_client_and_bzrdir('d', 'dc')
+        repository = bzrdir.find_repository()
+        self.assertFalse(repository.has_revision(
+            generate_svn_revision_id(repository.uuid, 5, "", "none")))
+
     def test_revision_parents(self):
         repos_url = self.make_client('d', 'dc')
         self.build_tree({'dc/foo': "data"})

=== modified file 'tests/test_upgrade.py'
--- a/tests/test_upgrade.py	2007-07-04 21:23:52 +0000
+++ b/tests/test_upgrade.py	2007-07-05 16:28:11 +0000
@@ -250,7 +250,7 @@
         file("f/a", 'w').write("blackfield")
         wt.commit(message='fix it again', rev_id="anotherrev")
 
-        upgrade_branch(b, oldrepos, allow_change=True)
+        upgrade_branch(b, oldrepos, allow_changes=True)
         self.assertEqual([oldrepos.generate_revision_id(0, "", "none"),
                           oldrepos.generate_revision_id(1, "", "none"),
                           "customrev-svn%d-upgrade" % MAPPING_VERSION,




More information about the bazaar-commits mailing list