summaryrefslogtreecommitdiffstats
path: root/repo
diff options
context:
space:
mode:
Diffstat (limited to 'repo')
-rwxr-xr-xrepo26
1 files changed, 23 insertions, 3 deletions
diff --git a/repo b/repo
index acaa9c4c..13ccd2ba 100755
--- a/repo
+++ b/repo
@@ -23,7 +23,7 @@ REPO_REV = 'stable'
23# limitations under the License. 23# limitations under the License.
24 24
25# increment this whenever we make important changes to this script 25# increment this whenever we make important changes to this script
26VERSION = (1, 23) 26VERSION = (1, 24)
27 27
28# increment this if the MAINTAINER_KEYS block is modified 28# increment this if the MAINTAINER_KEYS block is modified
29KEYRING_VERSION = (1, 2) 29KEYRING_VERSION = (1, 2)
@@ -120,6 +120,7 @@ GITC_FS_ROOT_DIR = '/gitc/manifest-rw/'
120 120
121import errno 121import errno
122import optparse 122import optparse
123import platform
123import re 124import re
124import shutil 125import shutil
125import stat 126import stat
@@ -175,6 +176,9 @@ group.add_option('-b', '--manifest-branch',
175group.add_option('-m', '--manifest-name', 176group.add_option('-m', '--manifest-name',
176 dest='manifest_name', 177 dest='manifest_name',
177 help='initial manifest file', metavar='NAME.xml') 178 help='initial manifest file', metavar='NAME.xml')
179group.add_option('-c', '--current-branch',
180 dest='current_branch_only', action='store_true',
181 help='fetch only current manifest branch from server')
178group.add_option('--mirror', 182group.add_option('--mirror',
179 dest='mirror', action='store_true', 183 dest='mirror', action='store_true',
180 help='create a replica of the remote repositories ' 184 help='create a replica of the remote repositories '
@@ -189,6 +193,9 @@ group.add_option('--archive',
189 dest='archive', action='store_true', 193 dest='archive', action='store_true',
190 help='checkout an archive instead of a git repository for ' 194 help='checkout an archive instead of a git repository for '
191 'each project. See git archive.') 195 'each project. See git archive.')
196group.add_option('--submodules',
197 dest='submodules', action='store_true',
198 help='sync any submodules associated with the manifest repo')
192group.add_option('-g', '--groups', 199group.add_option('-g', '--groups',
193 dest='groups', default='default', 200 dest='groups', default='default',
194 help='restrict manifest projects to ones with specified ' 201 help='restrict manifest projects to ones with specified '
@@ -202,6 +209,9 @@ group.add_option('-p', '--platform',
202group.add_option('--no-clone-bundle', 209group.add_option('--no-clone-bundle',
203 dest='no_clone_bundle', action='store_true', 210 dest='no_clone_bundle', action='store_true',
204 help='disable use of /clone.bundle on HTTP/HTTPS') 211 help='disable use of /clone.bundle on HTTP/HTTPS')
212group.add_option('--no-tags',
213 dest='no_tags', action='store_true',
214 help="don't fetch tags in the manifest")
205 215
206 216
207# Tool 217# Tool
@@ -347,6 +357,10 @@ def _Init(args, gitc_init=False):
347 dst = os.path.abspath(os.path.join(repodir, S_repo)) 357 dst = os.path.abspath(os.path.join(repodir, S_repo))
348 _Clone(url, dst, opt.quiet, not opt.no_clone_bundle) 358 _Clone(url, dst, opt.quiet, not opt.no_clone_bundle)
349 359
360 if not os.path.isfile('%s/repo' % dst):
361 _print("warning: '%s' does not look like a git-repo repository, is "
362 "REPO_URL set correctly?" % url, file=sys.stderr)
363
350 if can_verify and not opt.no_repo_verify: 364 if can_verify and not opt.no_repo_verify:
351 rev = _Verify(dst, branch, opt.quiet) 365 rev = _Verify(dst, branch, opt.quiet)
352 else: 366 else:
@@ -853,7 +867,10 @@ def main(orig_args):
853 try: 867 try:
854 _Init(args, gitc_init=(cmd == 'gitc-init')) 868 _Init(args, gitc_init=(cmd == 'gitc-init'))
855 except CloneFailure: 869 except CloneFailure:
856 shutil.rmtree(os.path.join(repodir, S_repo), ignore_errors=True) 870 path = os.path.join(repodir, S_repo)
871 _print("fatal: cloning the git-repo repository failed, will remove "
872 "'%s' " % path, file=sys.stderr)
873 shutil.rmtree(path, ignore_errors=True)
857 sys.exit(1) 874 sys.exit(1)
858 repo_main, rel_repo_dir = _FindRepo() 875 repo_main, rel_repo_dir = _FindRepo()
859 else: 876 else:
@@ -871,7 +888,10 @@ def main(orig_args):
871 me.extend(orig_args) 888 me.extend(orig_args)
872 me.extend(extra_args) 889 me.extend(extra_args)
873 try: 890 try:
874 os.execv(sys.executable, me) 891 if platform.system() == "Windows":
892 sys.exit(subprocess.call(me))
893 else:
894 os.execv(sys.executable, me)
875 except OSError as e: 895 except OSError as e:
876 _print("fatal: unable to start %s" % repo_main, file=sys.stderr) 896 _print("fatal: unable to start %s" % repo_main, file=sys.stderr)
877 _print("fatal: %s" % e, file=sys.stderr) 897 _print("fatal: %s" % e, file=sys.stderr)