git-si 0.4.0 → 0.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f699eab35b01983b28c6a305f4f052bff51c877b
4
- data.tar.gz: 66757783cb35d72353a1aea64c982148114771d5
3
+ metadata.gz: 1b1e502869a3891f7b2d1d78f10c705c40c87782
4
+ data.tar.gz: d206a05181f60625df74ed1f3090e8deceaa0409
5
5
  SHA512:
6
- metadata.gz: 7f47abf1fc81a97582940b27708e1e362c30d0947fb3d19017c7a91a07243704742d837d47eaf67b6273ad06209ebd570edeaa5781818b3f4f936494f75c54af
7
- data.tar.gz: df346172fd8e64b4ef85cbcf106fa9d8952b8005fdf91ecfdf228d29b87bc60c76e6310b1d462372df3bb743c43fa35ea134c39b038cbd6bf542fbcd61d7cd2d
6
+ metadata.gz: e47124cfdaf0bda009d8f9df510d8f87599f0b51ccf88a87204f48750a967c5b2be355fe6fa3b1f092524853e2466aec9a72009efc6846c058890df64d91cf81
7
+ data.tar.gz: f7f744750518a4088e4b924b69c86ebee568239840c5b3598f4abc603ed31afb7c2a3bd8e1b4658770ed9539a080bb6d5a957ec9d4626c259263b01ac8aea7f6
data/lib/git/si.rb CHANGED
@@ -113,6 +113,15 @@ use the commands below.
113
113
  do_commit_action
114
114
  end
115
115
 
116
+ ################
117
+ # Action: atune
118
+ ################
119
+ desc "atune", "Commit files to mirror branch that have been modified."
120
+ def atune
121
+ configure
122
+ do_atune_action
123
+ end
124
+
116
125
  ################
117
126
  # Action: readd
118
127
  ################
@@ -147,6 +147,17 @@ module Git
147
147
  end
148
148
  end
149
149
 
150
+ def do_atune_action
151
+ notice_message "Atuning mirror branch with current svn state"
152
+ on_mirror_branch do
153
+ add_all_svn_files
154
+ run_command( Git::Si::GitControl.commit_all_command )
155
+ end
156
+ on_local_branch do
157
+ run_command( Git::Si::GitControl.rebase_command( get_mirror_branch ) )
158
+ end
159
+ end
160
+
150
161
  end
151
162
  end
152
163
  end
@@ -45,6 +45,11 @@ module Git
45
45
  "#{@@git_binary} commit --allow-empty -am 'git-si #{version} svn update to version #{revision}'"
46
46
  end
47
47
 
48
+ def self.commit_all_command
49
+ version = Git::Si::Version.version
50
+ "#{@@git_binary} commit --allow-empty -am 'git-si #{version} atuned to current svn state'"
51
+ end
52
+
48
53
  def self.stash_command
49
54
  "#{@@git_binary} stash"
50
55
  end
@@ -102,7 +107,7 @@ module Git
102
107
 
103
108
  def self.delete_command(filename)
104
109
  raise GitSiError.new("Remove file command requires filename") if filename.empty?
105
- "#{@@git_binary} rm #{filename}"
110
+ "#{@@git_binary} rm -r #{filename}"
106
111
  end
107
112
 
108
113
  end
@@ -1,6 +1,6 @@
1
1
  module Git
2
2
  module Si
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
 
5
5
  class Version
6
6
  def self.version
data/spec/actions_spec.rb CHANGED
@@ -143,6 +143,29 @@ M something else"
143
143
  end
144
144
  end
145
145
 
146
+ describe "#do_atune_action" do
147
+ it "calls git commit all" do
148
+ expect( runner_spy ).to receive( :run_command ).with( /git commit.*-a/, any_args )
149
+ subject.do_atune_action
150
+ end
151
+
152
+ it "operates in the mirror branch" do
153
+ expect( subject ).to receive( :on_mirror_branch ).once
154
+ subject.do_atune_action
155
+ end
156
+
157
+ it "calls add_all_svn_files" do
158
+ expect( subject ).to receive( :add_all_svn_files ).once
159
+ subject.do_atune_action
160
+ end
161
+
162
+ it "calls rebase command with the mirror branch" do
163
+ allow( subject ).to receive( :get_mirror_branch ).and_return( 'testbranch' )
164
+ expect( runner_spy ).to receive( :run_command ).with( /git rebase .+testbranch/, any_args )
165
+ subject.do_atune_action
166
+ end
167
+ end
168
+
146
169
  describe "#do_fetch_action" do
147
170
  it "calls stash_local_changes" do
148
171
  expect( subject ).to receive( :stash_local_changes ).once
@@ -138,6 +138,13 @@ git-si 0.3.0 svn update to version 1014
138
138
  end
139
139
  end
140
140
 
141
+ describe ".commit_all_command" do
142
+ it "returns the correct command" do
143
+ version = Git::Si::Version.version
144
+ expect( Git::Si::GitControl.commit_all_command ).to eq( "git commit --allow-empty -am 'git-si #{version} atuned to current svn state'" )
145
+ end
146
+ end
147
+
141
148
  describe ".stash_command" do
142
149
  it "returns the correct command" do
143
150
  expect(Git::Si::GitControl.stash_command).to eq( "git stash" )
@@ -248,7 +255,7 @@ git-si 0.3.0 svn update to version 1014
248
255
  end
249
256
 
250
257
  it "returns the correct command" do
251
- expect(Git::Si::GitControl.delete_command('foobar')).to eq( "git rm foobar" )
258
+ expect(Git::Si::GitControl.delete_command('foobar')).to eq( "git rm -r foobar" )
252
259
  end
253
260
  end
254
261
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-si
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Payton Swick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-18 00:00:00.000000000 Z
11
+ date: 2015-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler