diff options
Diffstat (limited to 'repo')
-rwxr-xr-x | repo | 26 |
1 files changed, 23 insertions, 3 deletions
@@ -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 |
26 | VERSION = (1, 23) | 26 | VERSION = (1, 24) |
27 | 27 | ||
28 | # increment this if the MAINTAINER_KEYS block is modified | 28 | # increment this if the MAINTAINER_KEYS block is modified |
29 | KEYRING_VERSION = (1, 2) | 29 | KEYRING_VERSION = (1, 2) |
@@ -120,6 +120,7 @@ GITC_FS_ROOT_DIR = '/gitc/manifest-rw/' | |||
120 | 120 | ||
121 | import errno | 121 | import errno |
122 | import optparse | 122 | import optparse |
123 | import platform | ||
123 | import re | 124 | import re |
124 | import shutil | 125 | import shutil |
125 | import stat | 126 | import stat |
@@ -175,6 +176,9 @@ group.add_option('-b', '--manifest-branch', | |||
175 | group.add_option('-m', '--manifest-name', | 176 | group.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') |
179 | group.add_option('-c', '--current-branch', | ||
180 | dest='current_branch_only', action='store_true', | ||
181 | help='fetch only current manifest branch from server') | ||
178 | group.add_option('--mirror', | 182 | group.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.') |
196 | group.add_option('--submodules', | ||
197 | dest='submodules', action='store_true', | ||
198 | help='sync any submodules associated with the manifest repo') | ||
192 | group.add_option('-g', '--groups', | 199 | group.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', | |||
202 | group.add_option('--no-clone-bundle', | 209 | group.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') |
212 | group.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) |