for line in out.split('\n'):
if line.startswith("Repository Root:"):
root = line.split()[2].strip()
for line in out.split('\n'):
if line.startswith("Repository Root:"):
root = line.split()[2].strip()
@classmethod
def checkout(cls, remote, local, options, recursive=False):
@classmethod
def checkout(cls, remote, local, options, recursive=False):
def gitweb(self):
c = Command("git show | grep commit | awk '{print $2;}'", self.options)
out = self.__run_in_repo(c.output_of).strip()
def gitweb(self):
c = Command("git show | grep commit | awk '{print $2;}'", self.options)
out = self.__run_in_repo(c.output_of).strip()
- self.name, branch_or_tagname, module_type = self.parse_module_spec(module_spec)
+ self.pathname, branch_or_tagname, module_type = self.parse_module_spec(module_spec)
+ self.name = os.path.basename(self.pathname)
def friendly_name (self):
if hasattr(self,'branch'):
def friendly_name (self):
if hasattr(self,'branch'):
print 'Checking for',self.module_dir
if not os.path.isdir (self.module_dir):
print 'Checking for',self.module_dir
if not os.path.isdir (self.module_dir):
- if Repository.has_moved_to_git(self.name, Module.config):
- self.repository = GitRepository.checkout(self.git_remote_dir(self.name),
+ if Repository.has_moved_to_git(self.pathname, Module.config):
+ self.repository = GitRepository.checkout(self.git_remote_dir(self.pathname),
self.repository = Repository(self.module_dir, self.options)
if self.repository.type == "svn":
# check if module has moved to git
self.repository = Repository(self.module_dir, self.options)
if self.repository.type == "svn":
# check if module has moved to git
Command("rm -rf %s" % self.module_dir, self.options).run_silent()
self.init_module_dir()
# check if we have the required branch/tag
Command("rm -rf %s" % self.module_dir, self.options).run_silent()
self.init_module_dir()
# check if we have the required branch/tag
- raise Exception, 'Cannot guess specfile for module %s -- patterns were %s or %s'%(self.name,pattern1,pattern2)
+ raise Exception, 'Cannot guess specfile for module %s -- patterns were %s or %s'%(self.pathname,pattern1,pattern2)
- print 'Searching for -SVNPATH or -GITPATH lines referring to /%s/\n\tin %s .. '%(self.name,tagsfile),
+ print 'Searching for -SVNPATH or -GITPATH lines referring to /%s/\n\tin %s .. '%(self.pathname,tagsfile),
pattern="\A\s*%s-(SVNPATH|GITPATH)\s*(=|:=)\s*(?P<url_main>[^\s]+)/%s[^\s]+"\
%(self.name,self.name)
matcher_module=re.compile(pattern)
pattern="\A\s*%s-(SVNPATH|GITPATH)\s*(=|:=)\s*(?P<url_main>[^\s]+)/%s[^\s]+"\
%(self.name,self.name)
matcher_module=re.compile(pattern)
- replacement = "%-32s:= %s/%s.git@%s\n"%(modulepath,attempt.group('url_main'),self.name,newname)
+ replacement = "%-32s:= %s/%s.git@%s\n"%(modulepath,attempt.group('url_main'),self.pathname,newname)
else:
modulepath = "%s-SVNPATH"%self.name
replacement = "%-32s:= %s/%s/tags/%s\n"%(modulepath,attempt.group('url_main'),self.name,newname)
else:
modulepath = "%s-SVNPATH"%self.name
replacement = "%-32s:= %s/%s/tags/%s\n"%(modulepath,attempt.group('url_main'),self.name,newname)