vlad-git 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ === 2.1.0 / 2009-10-14
2
+
3
+ * Added git submodule support. [Balazs Nagy]
4
+
1
5
  === 2.0.0 / 2009-08-19
2
6
 
3
7
  * Birthday!
data/lib/vlad/git.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  class Vlad::Git
2
2
 
3
- VERSION = "2.0.0"
3
+ # Duh.
4
+ VERSION = "2.1.0"
4
5
 
5
- set :source, Vlad::Git.new
6
+ set :source, Vlad::Git.new
6
7
  set :git_cmd, "git"
7
8
 
8
9
  ##
@@ -17,6 +18,7 @@ class Vlad::Git
17
18
  [ "rm -rf #{destination}",
18
19
  "#{git_cmd} clone #{repository} #{destination}",
19
20
  "cd #{destination}",
21
+ "#{git_cmd} submodule update --init",
20
22
  "#{git_cmd} checkout -f -b deployed-#{revision} #{revision}",
21
23
  "cd -"
22
24
  ].join(" && ")
@@ -34,6 +36,7 @@ class Vlad::Git
34
36
  [ "mkdir -p #{destination}",
35
37
  "cd repo",
36
38
  "#{git_cmd} archive --format=tar #{revision} | (cd #{destination} && tar xf -)",
39
+ "#{git_cmd} submodule foreach '#{git_cmd} archive --format=tar $sha1 | (cd #{destination}/$path && tar xf -)'",
37
40
  "cd -",
38
41
  "cd .."
39
42
  ].join(" && ")
@@ -12,23 +12,24 @@ class TestVladGit < VladTestCase
12
12
  # Checkout the way the default :update task invokes the method
13
13
  def test_checkout
14
14
  cmd = @scm.checkout 'head', '/the/scm/path'
15
- assert_equal 'rm -rf /the/scm/path/repo && git clone git@myhost:/home/john/project1 /the/scm/path/repo && cd /the/scm/path/repo && git checkout -f -b deployed-HEAD HEAD && cd -', cmd
15
+ assert_equal 'rm -rf /the/scm/path/repo && git clone git@myhost:/home/john/project1 /the/scm/path/repo && cd /the/scm/path/repo && git submodule update --init && git checkout -f -b deployed-HEAD HEAD && cd -', cmd
16
16
  end
17
17
 
18
18
  # This is not how the :update task invokes the method
19
19
  def test_checkout_revision
20
20
  # Checkout to the current directory
21
21
  cmd = @scm.checkout 'master', '.'
22
- assert_equal 'rm -rf ./repo && git clone git@myhost:/home/john/project1 ./repo && cd ./repo && git checkout -f -b deployed-master master && cd -', cmd
22
+ assert_equal "rm -rf ./repo && git clone git@myhost:/home/john/project1 ./repo && cd ./repo && git submodule update --init && git checkout -f -b deployed-master master && cd -", cmd
23
23
 
24
24
  # Checkout to a relative path
25
25
  cmd = @scm.checkout 'master', 'some/relative/path'
26
- assert_equal 'rm -rf some/relative/path/repo && git clone git@myhost:/home/john/project1 some/relative/path/repo && cd some/relative/path/repo && git checkout -f -b deployed-master master && cd -', cmd
26
+ assert_equal 'rm -rf some/relative/path/repo && git clone git@myhost:/home/john/project1 some/relative/path/repo && cd some/relative/path/repo && git submodule update --init && git checkout -f -b deployed-master master && cd -', cmd
27
+
27
28
  end
28
29
 
29
30
  def test_export
30
31
  cmd = @scm.export 'master', 'the/release/path'
31
- assert_equal 'mkdir -p the/release/path && cd repo && git archive --format=tar deployed-master | (cd the/release/path && tar xf -) && cd - && cd ..', cmd
32
+ assert_equal "mkdir -p the/release/path && cd repo && git archive --format=tar deployed-master | (cd the/release/path && tar xf -) && git submodule foreach 'git archive --format=tar \$sha1 | (cd the/release/path/\$path && tar xf -)' && cd - && cd ..", cmd
32
33
  end
33
34
 
34
35
  def test_revision
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vlad-git
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Barnette
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-19 00:00:00 -07:00
12
+ date: 2009-10-14 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.3.2
23
+ version: 2.3.3
24
24
  version:
25
25
  description: |-
26
26
  Vlad plugin for Git support. This was previously part of Vlad, but all