diff options
author | David Pursehouse <david.pursehouse@sonymobile.com> | 2012-09-24 12:15:13 +0900 |
---|---|---|
committer | Gustaf Lundh <gustaf.lundh@sonymobile.com> | 2012-10-09 12:45:30 +0200 |
commit | 8a68ff96057ec58e524a3e41a2d8dca7b5d016bc (patch) | |
tree | 22f6971e8d3c4a90d11d3704602d073a852328b4 /subcmds/sync.py | |
parent | e3b1c45aebed329cbc9ad172b1d8e812cf208117 (diff) | |
download | git-repo-8a68ff96057ec58e524a3e41a2d8dca7b5d016bc.tar.gz |
Coding style cleanup
Fix the following issues reported by pylint:
C0321: More than one statement on a single line
W0622: Redefining built-in 'name'
W0612: Unused variable 'name'
W0613: Unused argument 'name'
W0102: Dangerous default value 'value' as argument
W0105: String statement has no effect
Also fixed a few cases of inconsistent indentation.
Change-Id: Ie0db839e7c57d576cff12d8c055fe87030d00744
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index b84d169f..1b716351 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -316,8 +316,7 @@ later is required to fix a server side protocol bug. | |||
316 | if not path: | 316 | if not path: |
317 | continue | 317 | continue |
318 | if path not in new_project_paths: | 318 | if path not in new_project_paths: |
319 | """If the path has already been deleted, we don't need to do it | 319 | # If the path has already been deleted, we don't need to do it |
320 | """ | ||
321 | if os.path.exists(self.manifest.topdir + '/' + path): | 320 | if os.path.exists(self.manifest.topdir + '/' + path): |
322 | project = Project( | 321 | project = Project( |
323 | manifest = self.manifest, | 322 | manifest = self.manifest, |
@@ -495,16 +494,16 @@ uncommitted changes are present' % project.relpath | |||
495 | self.manifest._Unload() | 494 | self.manifest._Unload() |
496 | if opt.jobs is None: | 495 | if opt.jobs is None: |
497 | self.jobs = self.manifest.default.sync_j | 496 | self.jobs = self.manifest.default.sync_j |
498 | all = self.GetProjects(args, missing_ok=True) | 497 | all_projects = self.GetProjects(args, missing_ok=True) |
499 | 498 | ||
500 | if not opt.local_only: | 499 | if not opt.local_only: |
501 | to_fetch = [] | 500 | to_fetch = [] |
502 | now = time.time() | 501 | now = time.time() |
503 | if (24 * 60 * 60) <= (now - rp.LastFetch): | 502 | if (24 * 60 * 60) <= (now - rp.LastFetch): |
504 | to_fetch.append(rp) | 503 | to_fetch.append(rp) |
505 | to_fetch.extend(all) | 504 | to_fetch.extend(all_projects) |
506 | 505 | ||
507 | fetched = self._Fetch(to_fetch, opt) | 506 | self._Fetch(to_fetch, opt) |
508 | _PostRepoFetch(rp, opt.no_repo_verify) | 507 | _PostRepoFetch(rp, opt.no_repo_verify) |
509 | if opt.network_only: | 508 | if opt.network_only: |
510 | # bail out now; the rest touches the working tree | 509 | # bail out now; the rest touches the working tree |
@@ -519,8 +518,8 @@ uncommitted changes are present' % project.relpath | |||
519 | 518 | ||
520 | syncbuf = SyncBuffer(mp.config, | 519 | syncbuf = SyncBuffer(mp.config, |
521 | detach_head = opt.detach_head) | 520 | detach_head = opt.detach_head) |
522 | pm = Progress('Syncing work tree', len(all)) | 521 | pm = Progress('Syncing work tree', len(all_projects)) |
523 | for project in all: | 522 | for project in all_projects: |
524 | pm.update() | 523 | pm.update() |
525 | if project.worktree: | 524 | if project.worktree: |
526 | project.Sync_LocalHalf(syncbuf) | 525 | project.Sync_LocalHalf(syncbuf) |