Fix pylint warnings introduced by the submodule patch

"69998b0 Represent git-submodule as nested projects" has introduced a
few pylint warnings.

W0612:1439,8:Project._GetSubmodules.get_submodules: Unused variable 'sub_gitdir'
W0613:1424,36:Project._GetSubmodules.get_submodules: Unused argument 'path'
W0612:1450,25:Project._GetSubmodules.parse_gitmodules: Unused variable 'e'
W0622:516,8:Sync.Execute: Redefining built-in 'all'

Change-Id: I84378e2832ed1b5ab023e394d53b22dcea799ba4
This commit is contained in:
Che-Liang Chiou 2012-10-25 13:44:11 -07:00
parent 608aff7f62
commit ab8f911a67
2 changed files with 6 additions and 7 deletions

View File

@ -1421,7 +1421,7 @@ class Project(object):
# because the working tree might not exist yet, and it cannot be used # because the working tree might not exist yet, and it cannot be used
# without a working tree in its current implementation. # without a working tree in its current implementation.
def get_submodules(gitdir, rev, path): def get_submodules(gitdir, rev):
# Parse .gitmodules for submodule sub_paths and sub_urls # Parse .gitmodules for submodule sub_paths and sub_urls
sub_paths, sub_urls = parse_gitmodules(gitdir, rev) sub_paths, sub_urls = parse_gitmodules(gitdir, rev)
if not sub_paths: if not sub_paths:
@ -1436,7 +1436,6 @@ class Project(object):
except KeyError: except KeyError:
# Ignore non-exist submodules # Ignore non-exist submodules
continue continue
sub_gitdir = self.manifest.GetSubprojectPaths(self, sub_path)[2]
submodules.append((sub_rev, sub_path, sub_url)) submodules.append((sub_rev, sub_path, sub_url))
return submodules return submodules
@ -1447,7 +1446,7 @@ class Project(object):
try: try:
p = GitCommand(None, cmd, capture_stdout = True, capture_stderr = True, p = GitCommand(None, cmd, capture_stdout = True, capture_stderr = True,
bare = True, gitdir = gitdir) bare = True, gitdir = gitdir)
except GitError as e: except GitError:
return [], [] return [], []
if p.Wait() != 0: if p.Wait() != 0:
return [], [] return [], []
@ -1463,7 +1462,7 @@ class Project(object):
if p.Wait() != 0: if p.Wait() != 0:
return [], [] return [], []
gitmodules_lines = p.stdout.split('\n') gitmodules_lines = p.stdout.split('\n')
except GitError as e: except GitError:
return [], [] return [], []
finally: finally:
os.remove(temp_gitmodules_path) os.remove(temp_gitmodules_path)
@ -1510,7 +1509,7 @@ class Project(object):
rev = self.GetRevisionId() rev = self.GetRevisionId()
except GitError: except GitError:
return [] return []
return get_submodules(self.gitdir, rev, '') return get_submodules(self.gitdir, rev)
def GetDerivedSubprojects(self): def GetDerivedSubprojects(self):
result = [] result = []

View File

@ -513,9 +513,9 @@ uncommitted changes are present' % project.relpath
previously_missing_set = set() previously_missing_set = set()
while True: while True:
self.manifest._Unload() self.manifest._Unload()
all = self.GetProjects(args, missing_ok=True) all_projects = self.GetProjects(args, missing_ok=True)
missing = [] missing = []
for project in all: for project in all_projects:
if project.gitdir not in fetched: if project.gitdir not in fetched:
missing.append(project) missing.append(project)
if not missing: if not missing: