git-multirepo 1.0.0.beta25 → 1.0.0.beta27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -2
- data/lib/info.rb +1 -1
- data/lib/multirepo/commands/add-command.rb +1 -1
- data/lib/multirepo/commands/branch-command.rb +10 -3
- data/lib/multirepo/commands/checkout-command.rb +5 -5
- data/lib/multirepo/commands/clone-command.rb +3 -3
- data/lib/multirepo/commands/command.rb +6 -2
- data/lib/multirepo/commands/fetch-command.rb +1 -1
- data/lib/multirepo/commands/install-command.rb +1 -1
- data/lib/multirepo/commands/open-command.rb +1 -1
- data/lib/multirepo/commands/remove-command.rb +1 -1
- data/lib/multirepo/commands/uninit-command.rb +0 -1
- data/lib/multirepo/commands/update-command.rb +1 -1
- data/lib/multirepo/utility/console.rb +1 -1
- data/lib/multirepo/utility/utils.rb +5 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bb3f5f11d1a761f838c22310b15316f20fa36a5
|
4
|
+
data.tar.gz: 6e1328bda9bd15b3d53209165baf7df8a407abb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d15869a01d986fd658f4316a5bcb8d69feb9f3871022a7f7c5c14ceaf15e60cb4cfdce47d40e865ab5c656abad52a324e690abdf7dbe6bd67519e057d3a04254
|
7
|
+
data.tar.gz: 452bfdeee8784b80aa982d5e7f9f7e5313e643c3842616fa5427136645db1c4f0c36de3dbf38fec6a71bb32da539e04b487bbeb777d9b58642ba1ce70897f6b7
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
git-multirepo (0.0.
|
4
|
+
git-multirepo (1.0.0.beta25)
|
5
5
|
claide (~> 0.8, >= 0.8.0)
|
6
6
|
colored (~> 1.2)
|
7
7
|
os (~> 0.9.6)
|
@@ -9,7 +9,7 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
claide (0.8.
|
12
|
+
claide (0.8.1)
|
13
13
|
colored (1.2)
|
14
14
|
diff-lcs (1.2.5)
|
15
15
|
os (0.9.6)
|
@@ -29,6 +29,7 @@ GEM
|
|
29
29
|
|
30
30
|
PLATFORMS
|
31
31
|
ruby
|
32
|
+
x64-mingw32
|
32
33
|
|
33
34
|
DEPENDENCIES
|
34
35
|
bundler (~> 1.7)
|
data/lib/info.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "multirepo/utility/console"
|
2
2
|
require "multirepo/files/config-file"
|
3
|
+
require "multirepo/files/lock-file"
|
3
4
|
|
4
5
|
module MultiRepo
|
5
6
|
class BranchCommand < Command
|
@@ -28,10 +29,10 @@ module MultiRepo
|
|
28
29
|
|
29
30
|
def run
|
30
31
|
validate_in_work_tree
|
31
|
-
|
32
|
-
|
33
|
-
Console.log_step("Branching and checking out #{@branch_name}...")
|
32
|
+
ensure_multirepo_enabled
|
34
33
|
|
34
|
+
Console.log_step("Branching...")
|
35
|
+
|
35
36
|
main_repo = main_repo = Repo.new(".")
|
36
37
|
repos = ConfigFile.load.map{ |entry| entry.repo }.push(main_repo)
|
37
38
|
|
@@ -40,11 +41,17 @@ module MultiRepo
|
|
40
41
|
end
|
41
42
|
|
42
43
|
repos.each do |repo|
|
44
|
+
Console.log_substep("Branching and checking out #{repo.path} #{@branch_name} ...")
|
45
|
+
|
43
46
|
branch = repo.branch(@branch_name)
|
44
47
|
branch.create(@remote_tracking) unless branch.exists?
|
45
48
|
branch.checkout
|
46
49
|
end
|
47
50
|
|
51
|
+
Console.log_substep("Updating and committing lock file")
|
52
|
+
LockFile.update
|
53
|
+
LockFile.commit("[multirepo] Post-branch lock file update")
|
54
|
+
|
48
55
|
Console.log_step("Done!")
|
49
56
|
rescue MultiRepoException => e
|
50
57
|
Console.log_error(e.message)
|
@@ -34,7 +34,7 @@ module MultiRepo
|
|
34
34
|
|
35
35
|
def run
|
36
36
|
validate_in_work_tree
|
37
|
-
|
37
|
+
ensure_multirepo_enabled
|
38
38
|
|
39
39
|
Console.log_step("Checking out #{@ref} and its dependencies...")
|
40
40
|
|
@@ -51,7 +51,7 @@ module MultiRepo
|
|
51
51
|
initial_revision = main_repo.current_branch || main_repo.head_hash
|
52
52
|
|
53
53
|
main_repo_checkout_step(main_repo, initial_revision, @ref)
|
54
|
-
ensure_dependencies_clean_step(initial_revision)
|
54
|
+
ensure_dependencies_clean_step(main_repo, initial_revision)
|
55
55
|
dependencies_checkout_step(mode, @ref)
|
56
56
|
|
57
57
|
Console.log_step("Done!")
|
@@ -73,13 +73,13 @@ module MultiRepo
|
|
73
73
|
Console.log_substep("Checked out main repo #{ref}")
|
74
74
|
|
75
75
|
# After checkout, make sure we're working with a multirepo-enabled ref
|
76
|
-
unless Utils.
|
76
|
+
unless Utils.is_multirepo_tracked(".")
|
77
77
|
main_repo.checkout(initial_revision)
|
78
|
-
raise MultiRepoException, "This revision is not
|
78
|
+
raise MultiRepoException, "This revision is not tracked by multirepo. Checkout reverted."
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
-
def ensure_dependencies_clean_step(initial_revision)
|
82
|
+
def ensure_dependencies_clean_step(main_repo, initial_revision)
|
83
83
|
unless Utils.ensure_dependencies_clean(ConfigFile.load)
|
84
84
|
main_repo.checkout(initial_revision)
|
85
85
|
raise MultiRepoException, "Checkout reverted."
|
@@ -50,9 +50,9 @@ module MultiRepo
|
|
50
50
|
|
51
51
|
Console.log_substep("Checked out main repo #{@ref}")
|
52
52
|
|
53
|
-
# Make sure the ref we just checked out is multirepo
|
54
|
-
unless Utils.
|
55
|
-
raise MultiRepoException, "Ref #{@ref} is not multirepo
|
53
|
+
# Make sure the ref we just checked out is tracked by multirepo
|
54
|
+
unless Utils.is_multirepo_tracked(main_repo_path)
|
55
|
+
raise MultiRepoException, "Ref #{@ref} is not tracked by multirepo"
|
56
56
|
end
|
57
57
|
|
58
58
|
# Install
|
@@ -30,7 +30,7 @@ module MultiRepo
|
|
30
30
|
|
31
31
|
def install_hooks_in_multirepo_enabled_dependencies
|
32
32
|
# Install the local git hooks in dependency repos
|
33
|
-
# if they are themselves
|
33
|
+
# if they are themselves multirepo-enabled
|
34
34
|
ConfigFile.load.each do |entry|
|
35
35
|
if Utils.is_multirepo_enabled(entry.repo.path)
|
36
36
|
install_hooks(entry.repo.path)
|
@@ -52,8 +52,12 @@ module MultiRepo
|
|
52
52
|
File.delete(".git/hooks/post-merge")
|
53
53
|
end
|
54
54
|
|
55
|
-
def
|
55
|
+
def ensure_multirepo_enabled
|
56
56
|
raise MultiRepoException, "multirepo is not initialized in this repository." unless Utils.is_multirepo_enabled(".")
|
57
57
|
end
|
58
|
+
|
59
|
+
def ensure_multirepo_tracked
|
60
|
+
raise MultiRepoException, "This revision is not tracked by multirepo." unless Utils.is_multirepo_tracked(".")
|
61
|
+
end
|
58
62
|
end
|
59
63
|
end
|
@@ -8,8 +8,11 @@ module MultiRepo
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def self.is_multirepo_enabled(path)
|
11
|
-
File.exists?(File.join(path, ".multirepo"))
|
12
|
-
|
11
|
+
File.exists?(File.join(path, ".multirepo"))
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.is_multirepo_tracked(path)
|
15
|
+
is_multirepo_enabled(path) && File.exists?(File.join(path, ".multirepo.lock"))
|
13
16
|
end
|
14
17
|
|
15
18
|
def self.install_hook(name, path)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-multirepo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michaël Fortin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|