Rev 2469: Create bzrlib.branchbuilder. in file:///home/robertc/source/baz/build-branch/

Robert Collins robertc at robertcollins.net
Fri Apr 27 03:20:17 BST 2007


At file:///home/robertc/source/baz/build-branch/

------------------------------------------------------------
revno: 2469
revision-id: robertc at robertcollins.net-20070427022014-gw8g0qi639fquuba
parent: robertc at robertcollins.net-20070427003620-6fjf8dbiblgt5am7
committer: Robert Collins <robertc at robertcollins.net>
branch nick: build-branch
timestamp: Fri 2007-04-27 12:20:14 +1000
message:
  Create bzrlib.branchbuilder.
added:
  bzrlib/branchbuilder.py        branchbuilder.py-20070427022007-zlxpqz2lannhk6y8-1
  bzrlib/tests/test_branchbuilder.py test_branchbuilder.p-20070427022007-zlxpqz2lannhk6y8-2
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
=== added file 'bzrlib/branchbuilder.py'
--- a/bzrlib/branchbuilder.py	1970-01-01 00:00:00 +0000
+++ b/bzrlib/branchbuilder.py	2007-04-27 02:20:14 +0000
@@ -0,0 +1,26 @@
+# Copyright (C) 2007 Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+"""Utility for create branches with particular contents."""
+
+from bzrlib import errors
+
+
+class BranchBuilder(object):
+    """A BranchBuilder aids creating Branches with particular shapes."""
+
+    def __init__(self, transport):
+        """Construct a BranchBuilder on transport."""

=== added file 'bzrlib/tests/test_branchbuilder.py'
--- a/bzrlib/tests/test_branchbuilder.py	1970-01-01 00:00:00 +0000
+++ b/bzrlib/tests/test_branchbuilder.py	2007-04-27 02:20:14 +0000
@@ -0,0 +1,28 @@
+# Copyright (C) 2007 Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+"""Tests for the BranchBuilder class."""
+
+from bzrlib import tests
+from bzrlib.branchbuilder import BranchBuilder
+
+
+class TestBranchBuilder(tests.TestCaseWithMemoryTransport):
+    
+    def test_create(self):
+        """Test the constructor api."""
+        builder = BranchBuilder(self.get_transport().clone('foo'))
+        # we dont care if the branch has been built or not at this point.

=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2007-04-26 09:07:38 +0000
+++ b/bzrlib/tests/__init__.py	2007-04-27 02:20:14 +0000
@@ -2272,6 +2272,7 @@
                    'bzrlib.tests.test_atomicfile',
                    'bzrlib.tests.test_bad_files',
                    'bzrlib.tests.test_branch',
+                   'bzrlib.tests.test_branchbuilder',
                    'bzrlib.tests.test_bugtracker',
                    'bzrlib.tests.test_bundle',
                    'bzrlib.tests.test_bzrdir',



More information about the bazaar-commits mailing list