@@ -49,26 +49,32 @@ def get_branch_name(self) -> str:
4949class LocalRepo (Repo ):
5050 """Concrete implementation of the `Repo` class using local path backend."""
5151
52- def __init__ (self , local_path : str , path : str ) -> None :
52+ def __init__ (self , path : str , realisation_path : str ) -> None :
5353 """_summary_.
5454
5555 Parameters
5656 ----------
57- local_path : str
57+ realisation_path : str
5858 Path for local checkout of CABLE
5959 path : str
60- Directory where CABLE is symlinked
60+ Directory where CABLE is symlinked from
6161
6262 """
63- self .name = Path (local_path ).name
64- self .local_path = local_path
65- self .path = path / self .name if path .is_dir () else path
63+ self .name = Path (path ).name
64+ self .local_path = path
65+ self .realisation_path = (
66+ realisation_path / self .name
67+ if realisation_path .is_dir ()
68+ else realisation_path
69+ )
6670 self .logger = get_logger ()
6771
6872 def checkout (self ):
6973 """Checkout the source code."""
70- self .path .symlink_to (self .local_path )
71- self .logger .info (f"Created symlink from to { self .path } named { self .name } " )
74+ self .realisation_path .symlink_to (self .local_path )
75+ self .logger .info (
76+ f"Created symlink from to { self .realisation_path } named { self .name } "
77+ )
7278
7379 def get_revision (self ) -> str :
7480 """Return the latest revision of the source code.
@@ -79,7 +85,7 @@ def get_revision(self) -> str:
7985 Human readable string describing the latest revision.
8086
8187 """
82- return f"Using local CABLE branch : { self .name } "
88+ return f"Local CABLE build : { self .name } "
8389
8490 def get_branch_name (self ) -> str :
8591 """Return the branch name of the source code.
@@ -90,7 +96,7 @@ def get_branch_name(self) -> str:
9096 Branch name of the source code.
9197
9298 """
93- return Path (self .path ).absolute ()
99+ return Path (self .realisation_path ).absolute (). as_posix ()
94100
95101
96102class GitRepo (Repo ):
@@ -106,7 +112,11 @@ class GitRepo(Repo):
106112 subprocess_handler = SubprocessWrapper ()
107113
108114 def __init__ (
109- self , url : str , branch : str , path : Path , commit : Optional [str ] = None
115+ self ,
116+ url : str ,
117+ branch : str ,
118+ realisation_path : Path ,
119+ commit : Optional [str ] = None ,
110120 ) -> None :
111121 """Return a `GitRepo` instance.
112122
@@ -116,7 +126,7 @@ def __init__(
116126 URL pointing to the GitHub repository.
117127 branch: str
118128 Name of a branch on the GitHub repository.
119- path : Path
129+ realisation_path : Path
120130 Path to a directory in which the repository is cloned into. If
121131 `path` points to an existing directory, the repository will be
122132 cloned into `path / branch`.
@@ -127,7 +137,9 @@ def __init__(
127137 """
128138 self .url = url
129139 self .branch = branch
130- self .path = path / branch if path .is_dir () else path
140+ self .path = (
141+ realisation_path / branch if realisation_path .is_dir () else realisation_path
142+ )
131143 self .commit = commit
132144 self .logger = get_logger ()
133145
@@ -187,7 +199,7 @@ def __init__(
187199 self ,
188200 svn_root : str ,
189201 branch_path : str ,
190- path : Path ,
202+ realisation_path : Path ,
191203 revision : Optional [int ] = None ,
192204 ) -> None :
193205 """Return an `SVNRepo` instance.
@@ -198,7 +210,7 @@ def __init__(
198210 URL pointing to the root of the SVN repository.
199211 branch_path: str
200212 Path to a branch relative to `svn_root`.
201- path : Path
213+ realisation_path : Path
202214 Path to a directory in which the branch is checked out into. If
203215 `path` points to an existing directory, the repository will be
204216 cloned into `path / <branch_name>` where `<branch_name>` is the
@@ -211,7 +223,11 @@ def __init__(
211223 self .svn_root = svn_root
212224 self .branch_path = branch_path
213225 self .revision = revision
214- self .path = path / Path (branch_path ).name if path .is_dir () else path
226+ self .path = (
227+ realisation_path / Path (branch_path ).name
228+ if realisation_path .is_dir ()
229+ else realisation_path
230+ )
215231 self .logger = get_logger ()
216232
217233 def checkout (self ):
@@ -280,9 +296,11 @@ def create_repo(spec: dict, path: Path) -> Repo:
280296 if "git" in spec :
281297 if "url" not in spec ["git" ]:
282298 spec ["git" ]["url" ] = internal .CABLE_GIT_URL
283- return GitRepo (path = path , ** spec ["git" ])
299+ return GitRepo (realisation_path = path , ** spec ["git" ])
284300 if "svn" in spec :
285- return SVNRepo (svn_root = internal .CABLE_SVN_ROOT , path = path , ** spec ["svn" ])
301+ return SVNRepo (
302+ svn_root = internal .CABLE_SVN_ROOT , realisation_path = path , ** spec ["svn" ]
303+ )
286304 if "local" in spec :
287- return LocalRepo (path = path , ** spec ["local" ])
305+ return LocalRepo (realisation_path = path , ** spec ["local" ])
288306 raise RepoSpecError
0 commit comments