aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-11-17 11:41:55 +0100
committerLiang Qi <liang.qi@qt.io>2016-11-17 11:41:55 +0100
commitacd40269d395d8dacc050cf6401fec2785188158 (patch)
treef1da64393e0f68f352b83d1170bcd6f4676310bc
parentf8e075a67932714c35764b098045c276c26c0c2e (diff)
parent98c92cc95f82a0998eed4d36f8b3ed6277be8ca2 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
-rw-r--r--.gitmodules6
-rwxr-xr-xinit-repository27
2 files changed, 23 insertions, 10 deletions
diff --git a/.gitmodules b/.gitmodules
index b24ddfc7..74081669 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -11,7 +11,7 @@
status = addon
[submodule "qtdeclarative"]
depends = qtbase
- recommends = qtsvg qtxmlpatterns
+ recommends = qtxmlpatterns
path = qtdeclarative
url = ../qtdeclarative.git
branch = 5.7
@@ -100,7 +100,7 @@
status = addon
[submodule "qtsensors"]
depends = qtbase
- recommends = qtdeclarative
+ recommends = qtdeclarative qtsvg
path = qtsensors
url = ../qtsensors.git
branch = 5.7
@@ -160,7 +160,7 @@
status = addon
[submodule "qtquick1"]
depends = qtscript
- recommends = qtsvg qtxmlpatterns
+ recommends = qtxmlpatterns
path = qtquick1
url = ../qtquick1.git
branch = 5.7
diff --git a/init-repository b/init-repository
index 954237d0..52efb201 100755
--- a/init-repository
+++ b/init-repository
@@ -82,6 +82,9 @@ Options:
--no-update
Skip the `git submodule update' command.
+ --no-fetch
+ Skip the `git fetch' commands. Implied by --no-update.
+
--branch
Instead of checking out specific SHA1s, check out the submodule
branches that correspond with the current supermodule commit. By
@@ -213,6 +216,7 @@ sub parse_arguments
'ignore-submodules' => 0 ,
'mirror-url' => "",
'update' => 1 ,
+ 'fetch' => 1 ,
'module-subset' => "default",
);
@@ -227,6 +231,7 @@ sub parse_arguments
'mirror=s' => \$self->{qw{ mirror-url }},
'quiet' => \$self->{qw{ quiet }},
'update!' => \$self->{qw{ update }},
+ 'fetch!' => \$self->{qw{ fetch }},
'module-subset=s' => \$self->{qw{ module-subset }},
'help|?' => sub { printUsage(1); },
@@ -245,6 +250,8 @@ sub parse_arguments
$self->{'module-subset'} =~ s/\bdefault\b/preview,essential,addon,deprecated/;
$self->{'module-subset'} = [ split(/,/, $self->{'module-subset'}) ];
+ $self->{'fetch'} = 0 if (!$self->{'update'});
+
return;
}
@@ -389,7 +396,8 @@ sub git_clone_all_submodules
}
foreach my $module (@modules) {
- $self->git_clone_one_submodule($subdirs{$module}, $subbases{$module}, $subbranches{$module});
+ $self->git_clone_one_submodule($subdirs{$module}, $subbases{$module},
+ $co_branch && $subbranches{$module});
}
if ($co_branch) {
@@ -465,9 +473,11 @@ sub git_clone_one_submodule
}
}
+ my $do_clone = (! -e "$submodule/.git");
+
my $url = $self->{'base-url'}.$repo_basename;
my $mirror;
- if ($mirror_url) {
+ if ($mirror_url && ($do_clone || $self->{fetch})) {
$mirror = $mirror_url.$repo_basename;
}
@@ -480,9 +490,12 @@ sub git_clone_one_submodule
}
}
- my $do_clone = (! -e "$submodule/.git");
if ($do_clone) {
- push @reference_args, '--branch', $branch if ($branch);
+ if ($branch) {
+ push @reference_args, '--branch', $branch;
+ } else {
+ push @reference_args, '--no-checkout';
+ }
$self->exe('git', 'clone', @reference_args,
($mirror ? $mirror : $url), $submodule);
}
@@ -496,20 +509,20 @@ sub git_clone_one_submodule
$self->exe('git', 'config', 'remote.mirror.fetch', '+refs/heads/*:refs/remotes/mirror/*');
}
- if (!$do_clone && $self->{update}) {
+ if (!$do_clone && $self->{fetch}) {
# If we didn't clone, fetch from the right location. We always update
# the origin remote, so that submodule update --remote works.
$self->exe('git', 'config', 'remote.origin.url', ($mirror ? $mirror : $url));
$self->exe('git', 'fetch', 'origin');
}
- if (!($do_clone || $self->{update}) || $mirror) {
+ if (!($do_clone || $self->{fetch}) || $mirror) {
# Leave the origin configured to the canonical URL. It's already correct
# if we cloned/fetched without a mirror; otherwise it may be anything.
$self->exe('git', 'config', 'remote.origin.url', $url);
}
- my $template = getcwd()."/../.commit-template";
+ my $template = $orig_cwd."/.commit-template";
if (-e $template) {
$self->exe('git', 'config', 'commit.template', $template);
}