diff options
-rw-r--r-- | git_command.py | 4 | ||||
-rw-r--r-- | git_config.py | 4 | ||||
-rwxr-xr-x | main.py | 7 | ||||
-rw-r--r-- | project.py | 2 |
4 files changed, 8 insertions, 9 deletions
diff --git a/git_command.py b/git_command.py index 39f795ff..e5e28f3c 100644 --- a/git_command.py +++ b/git_command.py | |||
@@ -88,7 +88,7 @@ class _GitCall(object): | |||
88 | ver_str = git.version() | 88 | ver_str = git.version() |
89 | if ver_str.startswith('git version '): | 89 | if ver_str.startswith('git version '): |
90 | _git_version = tuple( | 90 | _git_version = tuple( |
91 | map(lambda x: int(x), | 91 | map(int, |
92 | ver_str[len('git version '):].strip().split('-')[0].split('.')[0:3] | 92 | ver_str[len('git version '):].strip().split('-')[0].split('.')[0:3] |
93 | )) | 93 | )) |
94 | else: | 94 | else: |
@@ -110,7 +110,7 @@ def git_require(min_version, fail=False): | |||
110 | if min_version <= git_version: | 110 | if min_version <= git_version: |
111 | return True | 111 | return True |
112 | if fail: | 112 | if fail: |
113 | need = '.'.join(map(lambda x: str(x), min_version)) | 113 | need = '.'.join(map(str, min_version)) |
114 | print >>sys.stderr, 'fatal: git %s or later required' % need | 114 | print >>sys.stderr, 'fatal: git %s or later required' % need |
115 | sys.exit(1) | 115 | sys.exit(1) |
116 | return False | 116 | return False |
diff --git a/git_config.py b/git_config.py index 6589b193..ea782a11 100644 --- a/git_config.py +++ b/git_config.py | |||
@@ -537,7 +537,7 @@ class Remote(object): | |||
537 | self.url = self._Get('url') | 537 | self.url = self._Get('url') |
538 | self.review = self._Get('review') | 538 | self.review = self._Get('review') |
539 | self.projectname = self._Get('projectname') | 539 | self.projectname = self._Get('projectname') |
540 | self.fetch = map(lambda x: RefSpec.FromString(x), | 540 | self.fetch = map(RefSpec.FromString, |
541 | self._Get('fetch', all_keys=True)) | 541 | self._Get('fetch', all_keys=True)) |
542 | self._review_url = None | 542 | self._review_url = None |
543 | 543 | ||
@@ -657,7 +657,7 @@ class Remote(object): | |||
657 | self._Set('url', self.url) | 657 | self._Set('url', self.url) |
658 | self._Set('review', self.review) | 658 | self._Set('review', self.review) |
659 | self._Set('projectname', self.projectname) | 659 | self._Set('projectname', self.projectname) |
660 | self._Set('fetch', map(lambda x: str(x), self.fetch)) | 660 | self._Set('fetch', map(str, self.fetch)) |
661 | 661 | ||
662 | def _Set(self, key, value): | 662 | def _Set(self, key, value): |
663 | key = 'remote.%s.%s' % (self.name, key) | 663 | key = 'remote.%s.%s' % (self.name, key) |
@@ -195,12 +195,12 @@ def _CheckWrapperVersion(ver, repo_path): | |||
195 | sys.exit(1) | 195 | sys.exit(1) |
196 | 196 | ||
197 | exp = _CurrentWrapperVersion() | 197 | exp = _CurrentWrapperVersion() |
198 | ver = tuple(map(lambda x: int(x), ver.split('.'))) | 198 | ver = tuple(map(int, ver.split('.'))) |
199 | if len(ver) == 1: | 199 | if len(ver) == 1: |
200 | ver = (0, ver[0]) | 200 | ver = (0, ver[0]) |
201 | 201 | ||
202 | exp_str = '.'.join(map(str, exp)) | ||
202 | if exp[0] > ver[0] or ver < (0, 4): | 203 | if exp[0] > ver[0] or ver < (0, 4): |
203 | exp_str = '.'.join(map(lambda x: str(x), exp)) | ||
204 | print >>sys.stderr, """ | 204 | print >>sys.stderr, """ |
205 | !!! A new repo command (%5s) is available. !!! | 205 | !!! A new repo command (%5s) is available. !!! |
206 | !!! You must upgrade before you can continue: !!! | 206 | !!! You must upgrade before you can continue: !!! |
@@ -210,7 +210,6 @@ def _CheckWrapperVersion(ver, repo_path): | |||
210 | sys.exit(1) | 210 | sys.exit(1) |
211 | 211 | ||
212 | if exp > ver: | 212 | if exp > ver: |
213 | exp_str = '.'.join(map(lambda x: str(x), exp)) | ||
214 | print >>sys.stderr, """ | 213 | print >>sys.stderr, """ |
215 | ... A new repo command (%5s) is available. | 214 | ... A new repo command (%5s) is available. |
216 | ... You should upgrade soon: | 215 | ... You should upgrade soon: |
@@ -272,7 +271,7 @@ def _UserAgent(): | |||
272 | _user_agent = 'git-repo/%s (%s) git/%s Python/%d.%d.%d' % ( | 271 | _user_agent = 'git-repo/%s (%s) git/%s Python/%d.%d.%d' % ( |
273 | repo_version, | 272 | repo_version, |
274 | os_name, | 273 | os_name, |
275 | '.'.join(map(lambda d: str(d), git.version_tuple())), | 274 | '.'.join(map(str, git.version_tuple())), |
276 | py_version[0], py_version[1], py_version[2]) | 275 | py_version[0], py_version[1], py_version[2]) |
277 | return _user_agent | 276 | return _user_agent |
278 | 277 | ||
@@ -1175,7 +1175,7 @@ class Project(object): | |||
1175 | cmd = ['fetch', remote.name] | 1175 | cmd = ['fetch', remote.name] |
1176 | cmd.append('refs/changes/%2.2d/%d/%d' \ | 1176 | cmd.append('refs/changes/%2.2d/%d/%d' \ |
1177 | % (change_id % 100, change_id, patch_id)) | 1177 | % (change_id % 100, change_id, patch_id)) |
1178 | cmd.extend(map(lambda x: str(x), remote.fetch)) | 1178 | cmd.extend(map(str, remote.fetch)) |
1179 | if GitCommand(self, cmd, bare=True).Wait() != 0: | 1179 | if GitCommand(self, cmd, bare=True).Wait() != 0: |
1180 | return None | 1180 | return None |
1181 | return DownloadedChange(self, | 1181 | return DownloadedChange(self, |