diff options
-rw-r--r-- | git_command.py | 13 | ||||
-rwxr-xr-x | repo | 7 | ||||
-rw-r--r-- | subcmds/init.py | 9 |
3 files changed, 24 insertions, 5 deletions
diff --git a/git_command.py b/git_command.py index 5017ea9b..4868ccdf 100644 --- a/git_command.py +++ b/git_command.py | |||
@@ -28,8 +28,17 @@ from repo_trace import REPO_TRACE, IsTrace, Trace | |||
28 | from wrapper import Wrapper | 28 | from wrapper import Wrapper |
29 | 29 | ||
30 | GIT = 'git' | 30 | GIT = 'git' |
31 | # Should keep in sync with the "repo" launcher file. | 31 | # NB: These do not need to be kept in sync with the repo launcher script. |
32 | MIN_GIT_VERSION = (2, 10, 2) | 32 | # These may be much newer as it allows the repo launcher to roll between |
33 | # different repo releases while source versions might require a newer git. | ||
34 | # | ||
35 | # The soft version is when we start warning users that the version is old and | ||
36 | # we'll be dropping support for it. We'll refuse to work with versions older | ||
37 | # than the hard version. | ||
38 | # | ||
39 | # git-1.7 is in (EOL) Ubuntu Precise. git-1.9 is in Ubuntu Trusty. | ||
40 | MIN_GIT_VERSION_SOFT = (1, 9, 1) | ||
41 | MIN_GIT_VERSION_HARD = (1, 7, 2) | ||
33 | GIT_DIR = 'GIT_DIR' | 42 | GIT_DIR = 'GIT_DIR' |
34 | 43 | ||
35 | LAST_GITDIR = None | 44 | LAST_GITDIR = None |
@@ -166,7 +166,12 @@ TACbBS+Up3RpfYVfd63c1cDdlru13pQAn3NQy/SN858MkxN+zym86UBgOad2 | |||
166 | """ | 166 | """ |
167 | 167 | ||
168 | GIT = 'git' # our git command | 168 | GIT = 'git' # our git command |
169 | MIN_GIT_VERSION = (2, 10, 2) # minimum supported git version | 169 | # NB: The version of git that the repo launcher requires may be much older than |
170 | # the version of git that the main repo source tree requires. Keeping this at | ||
171 | # an older version also makes it easier for users to upgrade/rollback as needed. | ||
172 | # | ||
173 | # git-1.7 is in (EOL) Ubuntu Precise. | ||
174 | MIN_GIT_VERSION = (1, 7, 2) # minimum supported git version | ||
170 | repodir = '.repo' # name of repo's private directory | 175 | repodir = '.repo' # name of repo's private directory |
171 | S_repo = 'repo' # special repo repository | 176 | S_repo = 'repo' # special repo repository |
172 | S_manifests = 'manifests' # special manifest repository | 177 | S_manifests = 'manifests' # special manifest repository |
diff --git a/subcmds/init.py b/subcmds/init.py index 6594a602..a7950069 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
@@ -34,7 +34,7 @@ from command import InteractiveCommand, MirrorSafeCommand | |||
34 | from error import ManifestParseError | 34 | from error import ManifestParseError |
35 | from project import SyncBuffer | 35 | from project import SyncBuffer |
36 | from git_config import GitConfig | 36 | from git_config import GitConfig |
37 | from git_command import git_require, MIN_GIT_VERSION | 37 | from git_command import git_require, MIN_GIT_VERSION_SOFT, MIN_GIT_VERSION_HARD |
38 | import platform_utils | 38 | import platform_utils |
39 | 39 | ||
40 | class Init(InteractiveCommand, MirrorSafeCommand): | 40 | class Init(InteractiveCommand, MirrorSafeCommand): |
@@ -451,7 +451,12 @@ to update the working directory files. | |||
451 | self.OptionParser.error('--mirror and --archive cannot be used together.') | 451 | self.OptionParser.error('--mirror and --archive cannot be used together.') |
452 | 452 | ||
453 | def Execute(self, opt, args): | 453 | def Execute(self, opt, args): |
454 | git_require(MIN_GIT_VERSION, fail=True) | 454 | git_require(MIN_GIT_VERSION_HARD, fail=True) |
455 | if not git_require(MIN_GIT_VERSION_SOFT): | ||
456 | print('repo: warning: git-%s+ will soon be required; please upgrade your ' | ||
457 | 'version of git to maintain support.' | ||
458 | % ('.'.join(str(x) for x in MIN_GIT_VERSION_SOFT),), | ||
459 | file=sys.stderr) | ||
455 | 460 | ||
456 | self._SyncManifest(opt) | 461 | self._SyncManifest(opt) |
457 | self._LinkManifest(opt.manifest_name) | 462 | self._LinkManifest(opt.manifest_name) |