git-si 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/git/si.rb +25 -4
  3. data/lib/git/si/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c77dbf792e64c63bff1a45af38b1554db4d32d0d
4
- data.tar.gz: 45647e4d3e817d743fda2559d11fc52e84ac8588
3
+ metadata.gz: 7bf20760b268eea61a8be1559cbb9021308312f1
4
+ data.tar.gz: 5b3e9643cdd6c24bb1fb4c400b06bc4845068b16
5
5
  SHA512:
6
- metadata.gz: d2ce1a14dbaa857ccdbfa81b06b8ab117a76cf6f060779a848bec3f4f540bef6a74b0b965d04aa1eda7747145501c1dad9ff4ace08fae315931c3709c00d2649
7
- data.tar.gz: e6c9b056273c3592539963724ed417f0206641fbfea819386f5ffafe92381b422066b8882865cfc972248668ee4009db4a2dddc8f7c0e09603d7cdb63d8161e9
6
+ metadata.gz: 9d65955697dd0fc1e1b4b25421143cff2a690ba6d29b65ce39d699621a09d9963e8a4d231f77f2cbbb5768c06611634717cba9acb7d01f45c21532944f2b7ddc
7
+ data.tar.gz: d65170ca5833a3da1507c587d8e14d8a9f54a511dc54480bd7c8fa474d01718ee57ede7830db06103bdace19a61953fdfb7a36a9e8639971e3a5760e579066b4
data/lib/git/si.rb CHANGED
@@ -124,7 +124,7 @@ use the commands below.
124
124
  updated_files.each_line do |line|
125
125
  say line
126
126
  case line.strip!
127
- when /^\w\s+(\S.+)/
127
+ when /^A\s+(\S.+)/, /^Restored '(.+)'\s*$/
128
128
  files_to_add << '"' + $1 + '"'
129
129
  end
130
130
  end
@@ -134,7 +134,8 @@ use the commands below.
134
134
  files_to_add.each do |filename|
135
135
  say "Updating file in git: #{filename}"
136
136
  end
137
- system("git add " + files_to_add.join(' '))
137
+ notice_message "Adding all those files"
138
+ system("git add --all " + files_to_add.join(' '))
138
139
  end
139
140
  run_command("git commit --allow-empty -am 'svn update to version #{get_svn_version}'")
140
141
  end
@@ -333,6 +334,13 @@ continue, it's wise to reset the master branch afterward."
333
334
  return nil
334
335
  end
335
336
 
337
+ def get_svn_root
338
+ svn_info = `svn info`
339
+ results = svn_info.match(/Root Path:\s+(.+)/)
340
+ return results[1] if results
341
+ return nil
342
+ end
343
+
336
344
  def get_local_branch
337
345
  git_branches = `git branch`
338
346
  results = git_branches.match(/^\*\s+(\S+)/)
@@ -341,9 +349,20 @@ continue, it's wise to reset the master branch afterward."
341
349
  return local_branch
342
350
  end
343
351
 
352
+ def in_svn_root(&block)
353
+ root_dir = get_svn_root
354
+ raise SvnError.new("Could not find the svn root directory.") unless root_dir
355
+ notice_message "Changing directory to svn root: #{root_dir}"
356
+ Dir.chdir(root_dir) do
357
+ yield
358
+ end
359
+ end
360
+
344
361
  def on_local_branch(&block)
345
362
  begin
346
- yield
363
+ in_svn_root do
364
+ yield
365
+ end
347
366
  rescue GitSiError => err
348
367
  error_message err
349
368
  exit false
@@ -354,7 +373,9 @@ continue, it's wise to reset the master branch afterward."
354
373
  local_branch = get_local_branch()
355
374
  run_command("git checkout #{@@mirror_branch}")
356
375
  begin
357
- yield
376
+ in_svn_root do
377
+ yield
378
+ end
358
379
  rescue GitSiError => err
359
380
  error_message err
360
381
  exit false
@@ -1,5 +1,5 @@
1
1
  module Git
2
2
  module Si
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  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.3.0
4
+ version: 0.3.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: 2014-03-12 00:00:00.000000000 Z
11
+ date: 2014-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler