braid 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0b2f225e7f0c82f88971cbd3bf9a64e5577928d
4
- data.tar.gz: 644ccc97b60f9dbbf8442300d7ee7361ef58111f
3
+ metadata.gz: 22c192bf298deec94e78ff118cbb19ab8fedc6e6
4
+ data.tar.gz: cf7ab24e69fb9c3272e9fde0d71a93db16f4f289
5
5
  SHA512:
6
- metadata.gz: f7bcbac3193bdf5a1c42b1d72bf231f84330f54d906465b34086faa24403a1245ad1fd5fbd6fa75e8579796df14f3911e7bd483a53881e712756da9c7b43e0ef
7
- data.tar.gz: d9051b3e28fc9f67ef0e4f09572f84d02e4ee60be26752878b0ea7e159d01de8941449a03b367968e4caf3b652074ce3d9ae19add14f9907ab143cdc06b73356
6
+ metadata.gz: 6a2aa594064557e3c0fb8d1ed7452f8607b98bb101fcf42a3b7265779ce0ea16168dbbeb69dcf74e5883a008d6c7ab4686015a28ecbebe236b95d592087d56ba
7
+ data.tar.gz: 5d1cb3f00d03531dc5c5ca7319aa733bc36e55e1bdab40c11d49f52f22c0a680a40a6792d438e10f53fa8fbc93faf20c54f1cb1ee69c7127ce328d0d52c70611
@@ -75,6 +75,7 @@ module Braid
75
75
  git.merge_subtree(target_revision)
76
76
  end
77
77
  rescue Operations::MergeError => error
78
+ print error.conflicts_text
78
79
  msg 'Caught merge error. Breaking.'
79
80
  end
80
81
 
@@ -8,8 +8,11 @@ module Braid
8
8
 
9
9
  module Operations
10
10
  class ShellExecutionError < BraidError
11
- def initialize(err = nil)
11
+ attr_reader :err, :out
12
+
13
+ def initialize(err = nil, out = nil)
12
14
  @err = err
15
+ @out = out
13
16
  end
14
17
 
15
18
  def message
@@ -38,6 +41,12 @@ module Braid
38
41
  end
39
42
  end
40
43
  class MergeError < BraidError
44
+ attr_reader :conflicts_text
45
+
46
+ def initialize(conflicts_text)
47
+ @conflicts_text = conflicts_text
48
+ end
49
+
41
50
  def message
42
51
  'could not merge'
43
52
  end
@@ -134,7 +143,7 @@ module Braid
134
143
 
135
144
  def exec!(cmd)
136
145
  status, out, err = exec(cmd)
137
- raise ShellExecutionError, err unless status == 0
146
+ raise ShellExecutionError.new(err, out) unless status == 0
138
147
  [status, out, err]
139
148
  end
140
149
 
@@ -242,7 +251,8 @@ module Braid
242
251
  invoke(:merge, '-s subtree --no-commit --no-ff', opt)
243
252
  true
244
253
  rescue ShellExecutionError
245
- raise MergeError
254
+ # TODO: Figure out how to pass along conflict messages.
255
+ raise MergeError, ''
246
256
  end
247
257
 
248
258
  # Merge three trees (local_treeish should match the current state of the
@@ -256,8 +266,9 @@ module Braid
256
266
  def merge_trees(base_treeish, local_treeish, remote_treeish)
257
267
  invoke(:merge_recursive, base_treeish, "-- #{local_treeish} #{remote_treeish}")
258
268
  true
259
- rescue ShellExecutionError
260
- raise MergeError
269
+ rescue ShellExecutionError => error
270
+ # "CONFLICT" messages go to stdout.
271
+ raise MergeError, error.out
261
272
  end
262
273
 
263
274
  def read_ls_files(prefix)
@@ -1,3 +1,3 @@
1
1
  module Braid
2
- VERSION = '1.0.5'
2
+ VERSION = '1.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cristi Balan
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-01-28 00:00:00.000000000 Z
13
+ date: 2017-01-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: main
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  version: '0'
142
142
  requirements: []
143
143
  rubyforge_project: braid
144
- rubygems_version: 2.2.2
144
+ rubygems_version: 2.5.1
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: A simple tool for tracking vendor branches in git.