summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChe-Liang Chiou <clchiou@google.com>2012-10-25 13:44:11 -0700
committerChe-Liang Chiou <clchiou@google.com>2012-10-25 13:55:49 -0700
commitab8f911a6721424ddc7cda7ebd2a07270a5909b1 (patch)
treecf4b0cfab756dc78747894189ef918a262811d48
parent608aff7f624e35348ff9fab74bad1d6921944238 (diff)
downloadgit-repo-ab8f911a6721424ddc7cda7ebd2a07270a5909b1.tar.gz
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
-rw-r--r--project.py9
-rw-r--r--subcmds/sync.py4
2 files changed, 6 insertions, 7 deletions
diff --git a/project.py b/project.py
index a0889b3f..c3452aef 100644
--- a/project.py
+++ b/project.py
@@ -1421,7 +1421,7 @@ class Project(object):
1421 # because the working tree might not exist yet, and it cannot be used 1421 # because the working tree might not exist yet, and it cannot be used
1422 # without a working tree in its current implementation. 1422 # without a working tree in its current implementation.
1423 1423
1424 def get_submodules(gitdir, rev, path): 1424 def get_submodules(gitdir, rev):
1425 # Parse .gitmodules for submodule sub_paths and sub_urls 1425 # Parse .gitmodules for submodule sub_paths and sub_urls
1426 sub_paths, sub_urls = parse_gitmodules(gitdir, rev) 1426 sub_paths, sub_urls = parse_gitmodules(gitdir, rev)
1427 if not sub_paths: 1427 if not sub_paths:
@@ -1436,7 +1436,6 @@ class Project(object):
1436 except KeyError: 1436 except KeyError:
1437 # Ignore non-exist submodules 1437 # Ignore non-exist submodules
1438 continue 1438 continue
1439 sub_gitdir = self.manifest.GetSubprojectPaths(self, sub_path)[2]
1440 submodules.append((sub_rev, sub_path, sub_url)) 1439 submodules.append((sub_rev, sub_path, sub_url))
1441 return submodules 1440 return submodules
1442 1441
@@ -1447,7 +1446,7 @@ class Project(object):
1447 try: 1446 try:
1448 p = GitCommand(None, cmd, capture_stdout = True, capture_stderr = True, 1447 p = GitCommand(None, cmd, capture_stdout = True, capture_stderr = True,
1449 bare = True, gitdir = gitdir) 1448 bare = True, gitdir = gitdir)
1450 except GitError as e: 1449 except GitError:
1451 return [], [] 1450 return [], []
1452 if p.Wait() != 0: 1451 if p.Wait() != 0:
1453 return [], [] 1452 return [], []
@@ -1463,7 +1462,7 @@ class Project(object):
1463 if p.Wait() != 0: 1462 if p.Wait() != 0:
1464 return [], [] 1463 return [], []
1465 gitmodules_lines = p.stdout.split('\n') 1464 gitmodules_lines = p.stdout.split('\n')
1466 except GitError as e: 1465 except GitError:
1467 return [], [] 1466 return [], []
1468 finally: 1467 finally:
1469 os.remove(temp_gitmodules_path) 1468 os.remove(temp_gitmodules_path)
@@ -1510,7 +1509,7 @@ class Project(object):
1510 rev = self.GetRevisionId() 1509 rev = self.GetRevisionId()
1511 except GitError: 1510 except GitError:
1512 return [] 1511 return []
1513 return get_submodules(self.gitdir, rev, '') 1512 return get_submodules(self.gitdir, rev)
1514 1513
1515 def GetDerivedSubprojects(self): 1514 def GetDerivedSubprojects(self):
1516 result = [] 1515 result = []
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 28c154a0..64ed38e7 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -513,9 +513,9 @@ uncommitted changes are present' % project.relpath
513 previously_missing_set = set() 513 previously_missing_set = set()
514 while True: 514 while True:
515 self.manifest._Unload() 515 self.manifest._Unload()
516 all = self.GetProjects(args, missing_ok=True) 516 all_projects = self.GetProjects(args, missing_ok=True)
517 missing = [] 517 missing = []
518 for project in all: 518 for project in all_projects:
519 if project.gitdir not in fetched: 519 if project.gitdir not in fetched:
520 missing.append(project) 520 missing.append(project)
521 if not missing: 521 if not missing: