@@ -275,7 +275,7 @@ def add(cls, repo, name, path, url=None, branch=None, no_checkout=False):
275
275
branch_is_default = branch is None
276
276
if has_module and url is not None :
277
277
if url not in [r .url for r in sm .module ().remotes ]:
278
- raise ValueError ("Specified URL '%s' does not match any remote url of the repository at '%s'" % (url , sm .module_path () ))
278
+ raise ValueError ("Specified URL '%s' does not match any remote url of the repository at '%s'" % (url , sm .abspath ))
279
279
# END check url
280
280
# END verify urls match
281
281
@@ -287,7 +287,7 @@ def add(cls, repo, name, path, url=None, branch=None, no_checkout=False):
287
287
mrepo = sm .module ()
288
288
urls = [r .url for r in mrepo .remotes ]
289
289
if not urls :
290
- raise ValueError ("Didn't find any remote url in repository at %s" % sm .module_path () )
290
+ raise ValueError ("Didn't find any remote url in repository at %s" % sm .abspath )
291
291
# END verify we have url
292
292
url = urls [0 ]
293
293
else :
@@ -493,7 +493,7 @@ def move(self, module_path):
493
493
#END handle existance
494
494
495
495
# move the module into place if possible
496
- cur_path = self .module_path ()
496
+ cur_path = self .abspath
497
497
if os .path .exists (cur_path ):
498
498
os .renames (cur_path , dest_path )
499
499
#END move physical module
@@ -522,8 +522,6 @@ def move(self, module_path):
522
522
523
523
return self
524
524
525
-
526
-
527
525
@unbare_repo
528
526
def remove (self , module = True , force = False , configuration = True , dry_run = False ):
529
527
"""Remove this submodule from the repository. This will remove our entry
@@ -559,7 +557,7 @@ def remove(self, module=True, force=False, configuration=True, dry_run=False):
559
557
# take the fast lane and just delete everything in our module path
560
558
# TODO: If we run into permission problems, we have a highly inconsistent
561
559
# state. Delete the .git folders last, start with the submodules first
562
- mp = self .module_path ()
560
+ mp = self .abspath
563
561
method = None
564
562
if os .path .islink (mp ):
565
563
method = os .remove
@@ -691,7 +689,7 @@ def module(self):
691
689
:raise InvalidGitRepositoryError: if a repository was not available. This could
692
690
also mean that it was not yet initialized"""
693
691
# late import to workaround circular dependencies
694
- module_path = self .module_path ()
692
+ module_path = self .abspath
695
693
try :
696
694
repo = git .Repo (module_path )
697
695
if repo != self .repo :
@@ -703,10 +701,6 @@ def module(self):
703
701
raise InvalidGitRepositoryError ("Repository at %r was not yet checked out" % module_path )
704
702
# END handle exceptions
705
703
706
- def module_path (self ):
707
- """:return: full path to the root of our module. It is relative to the filesystem root"""
708
- return join_path_native (self .repo .working_tree_dir , self .path )
709
-
710
704
def module_exists (self ):
711
705
""":return: True if our module exists and is a valid git repository. See module() method"""
712
706
try :
0 commit comments