Rev 3023: Use the info code functions to determine format strings in the blackbox tests, and handle repositories that do not lock like packs. in http://people.ubuntu.com/~robertc/baz2.0/pack.read-locks

Robert Collins robertc at robertcollins.net
Thu Nov 22 02:00:35 GMT 2007


At http://people.ubuntu.com/~robertc/baz2.0/pack.read-locks

------------------------------------------------------------
revno: 3023
revision-id:robertc at robertcollins.net-20071122020018-a30xrdfzxfwi8g2h
parent: robertc at robertcollins.net-20071122003315-ldoyi2mi3nma5qnf
committer: Robert Collins <robertc at robertcollins.net>
branch nick: pack.read-locks
timestamp: Thu 2007-11-22 13:00:18 +1100
message:
  Use the info code functions to determine format strings in the blackbox tests, and handle repositories that do not lock like packs.
modified:
  bzrlib/tests/blackbox/test_info.py test_info.py-20060215045507-bbdd2d34efab9e0a
=== modified file 'bzrlib/tests/blackbox/test_info.py'
--- a/bzrlib/tests/blackbox/test_info.py	2007-10-25 04:57:32 +0000
+++ b/bzrlib/tests/blackbox/test_info.py	2007-11-22 02:00:18 +0000
@@ -24,6 +24,7 @@
 from bzrlib import (
     bzrdir,
     errors,
+    info,
     osutils,
     repository,
     urlutils,
@@ -484,7 +485,7 @@
         repo = branch.repository
         out, err = self.run_bzr('info branch -v')
         self.assertEqualDiff(
-"""Standalone branch (format: dirstate-tags)
+"""Standalone branch (format: %s)
 Location:
   branch root: branch
 
@@ -500,7 +501,8 @@
 Repository:
          0 revisions
          0 KiB
-""" % (format.get_branch_format().get_format_description(),
+""" % (info.describe_format(repo.bzrdir, repo, branch, None),
+       format.get_branch_format().get_format_description(),
        format.repository_format.get_format_description(),
        ), out)
         self.assertEqual('', err)
@@ -1102,7 +1104,7 @@
        ), out)
         self.assertEqual('', err)
 
-    def assertCheckoutStatusOutput(self, 
+    def assertCheckoutStatusOutput(self,
         command_string, lco_tree, shared_repo=None,
         repo_branch=None,
         tree_locked=False,
@@ -1127,6 +1129,10 @@
         :param tree_locked: If true, expect the tree to be locked.
         :param branch_locked: If true, expect the branch to be locked.
         :param repo_locked: If true, expect the repository to be locked.
+            Note that the lco_tree.branch.repository is inspected, and if is not
+            actually locked then this parameter is overridden. This is because
+            pack repositories do not have any public API for obtaining an
+            exclusive repository wide lock.
         :param verbose: If true, expect verbose output
         """
         def friendly_location(url):
@@ -1151,6 +1157,8 @@
             }[(shared_repo is not None, light_checkout)]
         format = {True: 'dirstate or dirstate-tags or knitpack-experimental',
                   False: 'dirstate'}[light_checkout]
+        if repo_locked:
+            repo_locked = lco_tree.branch.repository.get_physical_lock_status()
         if repo_locked or branch_locked or tree_locked:
             def locked_message(a_bool):
                 if a_bool:



More information about the bazaar-commits mailing list