summaryrefslogtreecommitdiff
path: root/morphlib/workspace.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-08-01 11:57:15 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-08-06 16:28:16 +0100
commitddb490714f43119441aabdd492d09520c73e3448 (patch)
treeaf4167d82e9217e3ca046d78493ca87ba998eea9 /morphlib/workspace.py
parent2dcda95c15ca788f47bd49f85618364635088b0d (diff)
downloadmorph-ddb490714f43119441aabdd492d09520c73e3448.tar.gz
Add Workspace.create_system_branch_directory method
Diffstat (limited to 'morphlib/workspace.py')
-rw-r--r--morphlib/workspace.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/morphlib/workspace.py b/morphlib/workspace.py
index e21581c6..93f699e6 100644
--- a/morphlib/workspace.py
+++ b/morphlib/workspace.py
@@ -68,6 +68,25 @@ class Workspace(object):
return os.path.join(self.root, system_branch_name)
+ def create_system_branch_directory(self,
+ root_repository_url, system_branch_name):
+ '''Create a directory for a system branch.
+
+ Return a SystemBranchDirectory object that represents the
+ directory. The directory must not already exist. The directory
+ gets created and initialised (the .morph-system-branch/config
+ file gets created and populated). The root repository of the
+ system branch does NOT get checked out, the caller needs to
+ do that.
+
+ '''
+
+ dirname = self.get_default_system_branch_directory_name(
+ system_branch_name)
+ sb = morphlib.sysbranchdir.create(
+ dirname, root_repository_url, system_branch_name)
+ return sb
+
def open(dirname):
'''Open an existing workspace.