braid 1.0.4 → 1.0.5

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: f3ed308ecd0d1f942297b2414db50e25e562ed4f
4
- data.tar.gz: daa7372e07ad6b3dd0a47cfc4e93a3d8412bd4ed
3
+ metadata.gz: c0b2f225e7f0c82f88971cbd3bf9a64e5577928d
4
+ data.tar.gz: 644ccc97b60f9dbbf8442300d7ee7361ef58111f
5
5
  SHA512:
6
- metadata.gz: fa53d78eb05454a44369074ec88714b116f67125bf5bcd2b4bfa033fff60c65d6519d2c0117fdbd7fe3fb4f044a486ca7269e0d91594ef6177ec157d21d82137
7
- data.tar.gz: c9808e139bd1e44c2e112a4ba414e7ce36b9094cf1833cfd3b4b06e83c38bc493f8fdfc79f41c17d5a1864fb5446a98f01f5741f309b5e1a26d481b966689c8d
6
+ metadata.gz: f7bcbac3193bdf5a1c42b1d72bf231f84330f54d906465b34086faa24403a1245ad1fd5fbd6fa75e8579796df14f3911e7bd483a53881e712756da9c7b43e0ef
7
+ data.tar.gz: d9051b3e28fc9f67ef0e4f09572f84d02e4ee60be26752878b0ea7e159d01de8941449a03b367968e4caf3b652074ce3d9ae19add14f9907ab143cdc06b73356
@@ -93,6 +93,8 @@ module Braid
93
93
 
94
94
  def generate_tree_hash(mirror, revision)
95
95
  git.with_temporary_index do
96
+ git.read_tree_im('HEAD')
97
+ git.rm_r_cached(mirror.path)
96
98
  git.read_tree_prefix_i(revision, mirror.path)
97
99
  git.write_tree()
98
100
  end
@@ -277,6 +277,13 @@ module Braid
277
277
  true
278
278
  end
279
279
 
280
+ # Read tree into the root of the index. This may not be the preferred way
281
+ # to do it, but it seems to work.
282
+ def read_tree_im(treeish)
283
+ invoke(:read_tree, "-im", treeish)
284
+ true
285
+ end
286
+
280
287
  # Write a tree object for the current index and return its ID.
281
288
  def write_tree()
282
289
  invoke(:write_tree)
@@ -300,6 +307,12 @@ module Braid
300
307
  true
301
308
  end
302
309
 
310
+ # Remove from index only.
311
+ def rm_r_cached(path)
312
+ invoke(:rm, '-r', '--cached', path)
313
+ true
314
+ end
315
+
303
316
  def tree_hash(path, treeish = 'HEAD')
304
317
  out = invoke(:ls_tree, treeish, '-d', path)
305
318
  out.split[2]
@@ -1,3 +1,3 @@
1
1
  module Braid
2
- VERSION = '1.0.4'
2
+ VERSION = '1.0.5'
3
3
  end
@@ -0,0 +1,219 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ {{ '/feed/atom.xml' | assign_to: 'global_feed' }}
4
+ {{ '/feed/all_comments.xml' | assign_to: 'global_comments_feed' }}
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>
8
+ {{ site.title }}
9
+ {% if site.current_section %}
10
+ - {{ site.current_section.name }}
11
+ {% endif %}
12
+ {% if article %}
13
+ - {{ article.title }}
14
+ {% endif %}
15
+ </title>
16
+ <link rel="alternate" type="application/atom+xml" title="{{ site.title }} feed" href="{{ global_feed }}"/>
17
+ <link rel="alternate" type="application/atom+xml" title="{{ site.title }} comments feed" href="{{ global_comments_feed }}"/>
18
+ {{ 'base' | stylesheet }}
19
+ {{ 'app' | javascript }}
20
+ <!--[if IE]>
21
+ {{ 'base_ie' | stylesheet }}
22
+ <![endif]-->
23
+ </head>
24
+
25
+ <body class="fixed orange">
26
+ <script type="text/javascript">loadPreferences()</script>
27
+
28
+ <div id="wrapper">
29
+
30
+ <div id="header" class="clearfix">
31
+ <div id="title" class="clearfix">
32
+ <h1><a href="/">{{ site.title }}</a></h1>
33
+ </div>
34
+ <h2>Sections</h2>
35
+ <ul id="menu">
36
+ {% for section in site.sections %}
37
+ {% if section.articles_count > 0 %}
38
+ {% if section.is_home %}
39
+ <li{% if section.current %} class="selected"{% endif %}>{{ section | link_to_section }}</li>
40
+ {% else %}
41
+ {% if section.is_paged %}
42
+ <li{% if section.current %} class="selected"{% endif %}>{{ section | link_to_section }}</li>
43
+ {% endif %}
44
+ {% endif %}
45
+ {% endif %}
46
+ {% endfor %}
47
+ </ul>
48
+ </div>
49
+
50
+ <div id="contentwrapper" class="clearfix">
51
+
52
+ <div id="content">
53
+
54
+ <div id="innerwrapper">
55
+
56
+ <div class="article">
57
+ <div class="body">
58
+ <h2>Skittlish Tips'n'Tricks</h2>
59
+ <ul>
60
+ <li>Change the classes for the body tag to set your default site style. also change these in the app.js file (line 66).</li>
61
+ <li>Remove the scripts and the #options div if you don't want the option switcher.</li>
62
+ <li>The top menu shows the home section and the sections that are not blogs.</li>
63
+ <li>Email me at <a href="mailto:evil@che.lu">evil@che.lu</a> if you have any questions.</li>
64
+ <li>Happy hacking!</li>
65
+ </ul>
66
+ </div>
67
+ </div>
68
+
69
+ {{ content_for_layout }}
70
+
71
+ </div>
72
+
73
+ </div>
74
+
75
+ <div id="sidebar">
76
+
77
+ <div class="boxy short">
78
+ <h3>boxy short</h3>
79
+
80
+ <p>You can have, boxes with a short, tall or no background shade, just change the class of the containing div.</p>
81
+
82
+ <p>Have boxes with smaller text with the class "minor". See the "Recent" boxy below.</p>
83
+
84
+ </div>
85
+
86
+ <div id="search" class="boxy short">
87
+ <h3>Search</h3>
88
+ <form method="get" action="/search">
89
+ <fieldset>
90
+ <input class="text" type="text" id="q" value="" name="q"/>
91
+ </fieldset>
92
+ </form>
93
+ </div>
94
+
95
+ <div class="boxy tall minor">
96
+ <h3>Recent</h3>
97
+
98
+ <dl>
99
+ <dt>Articles <a class="feed" href="{{ global_feed }}"><span>feed</span></a></dt>
100
+ <dd>
101
+ <ul>
102
+ {% for article in site.latest_articles %}
103
+ <li>{{ article | link_to_article }} <em>({{ article.published_at | format_date: 'stub', true }})</em></li>
104
+ {% endfor %}
105
+ </ul>
106
+ </dd>
107
+
108
+ <dt>Comments <a class="feed" href="{{ global_comments_feed }}"><span>feed</span></a></dt>
109
+ <dd>
110
+ <ul>
111
+ {% for comment in site.latest_comments %}
112
+ <li>{{ comment.author_link }} on <a href="{{ comment.url }}#comment-{{ comment.id }}">{{ comment.title }}</a></li>
113
+ {% endfor %}
114
+ </ul>
115
+ </dd>
116
+ </dl>
117
+ </div>
118
+
119
+ <div class="boxy short">
120
+ <h3>Archives</h3>
121
+ <p>This would be much nicer with jamis' month_drop thingy.</p>
122
+ {{ '' | section | months | assign_to: 'home_section' }}
123
+ <ul>
124
+ {% for month in home_section.months %}
125
+ {{ home_section | monthly_articles: month | size | assign_to: 'articles_count' }}
126
+ {% if articles_count > 0 %}
127
+ <li>{{ home_section | link_to_month: month }} ({{ articles_count }})</li>
128
+ {% endif %}
129
+ {% endfor %}
130
+ </ul>
131
+ </div>
132
+
133
+ {% if site.blog_sections.size > 1 %}
134
+ <div class="boxy short">
135
+ <h3>Categories</h3>
136
+ <p>Lists only blog type categories with at least one article.</p>
137
+ <p>This list uses an ul. You could use a dl with only dd's in it for the same effect. Wouldn't be semantic tho.</p>
138
+ <ul class="sections">
139
+ {% for section in site.blog_sections %}
140
+ {% if section.articles_count > 0 %}
141
+ {% unless section.is_home %}
142
+ <li>{{ section | link_to_section }} ({{ section.articles_count }})</li>
143
+ {% endunless %}
144
+ {% endif %}
145
+ {% endfor %}
146
+ </ul>
147
+ </div>
148
+
149
+ {% endif %}
150
+ {% unless site.tags == empty %}
151
+ <div class="boxy short">
152
+ <p>This would be nicer if we could get the number of articles for each tag.</p>
153
+ <h3>tags: </h3>
154
+ <ul>
155
+ {% for tag in site.tags %}
156
+ <li>{{ tag | link_to_tag }}</li>
157
+ {% endfor %}
158
+ </ul>
159
+ </div>
160
+
161
+ {% endunless %}
162
+ <div class="boxy tall">
163
+ <h3>boxy tall</h3>
164
+ <p>When using a tall box, make sure it's got plenty of content or that it's immediately followed by a short boxy. It might look a bit chopped off otherwise.</p>
165
+ <dl>
166
+ <dt>thing 1</dt>
167
+ <dd><a href="#">value 1</a></dd>
168
+ <dd><a href="#">value 2</a></dd>
169
+ <dd><a href="#">value 3</a></dd>
170
+ <dd><a href="#">value 4</a></dd>
171
+ <dd><a href="#">value 5</a></dd>
172
+ <dd><a href="#">value 6</a></dd>
173
+ <dd><a href="#">value 6</a></dd>
174
+
175
+ <dt>thing 1</dt>
176
+ <dd><a href="#">value 1</a></dd>
177
+ <dd><a href="#">value 2</a></dd>
178
+ <dd><a href="#">value 3</a></dd>
179
+ <dd>value 4</dd>
180
+ <dd>value 5</dd>
181
+ <dd><a href="#">value 6</a></dd>
182
+ <dd><a href="#">value 6</a></dd>
183
+
184
+ </dl>
185
+ </div>
186
+
187
+ </div>
188
+
189
+ </div>
190
+
191
+ <div id="options">
192
+ <h2>Options:</h2>
193
+ <h3>Size</h3>
194
+ <ul id="option_size">
195
+ <li id="option_size_fixed" class="fixed" ><a><span>fixed </span></a></li>
196
+ <li id="option_size_fluid" class="fluid" ><a><span>fluid </span></a></li>
197
+ </ul>
198
+ <h3>Colors</h3>
199
+ <ul id="option_color">
200
+ <li id="option_color_orange" class="orange"><a><span>orange</span></a></li>
201
+ <li id="option_color_blue" class="blue" ><a><span>blue </span></a></li>
202
+ <li id="option_color_green" class="green" ><a><span>green </span></a></li>
203
+ <li id="option_color_pink" class="pink" ><a><span>pink </span></a></li>
204
+ <li id="option_color_cyan" class="cyan" ><a><span>cyan </span></a></li>
205
+ <li id="option_color_red" class="red" ><a><span>red </span></a></li>
206
+ <li id="option_color_violet" class="violet"><a><span>violet</span></a></li>
207
+ </ul>
208
+ </div>
209
+
210
+ <div id="footer">
211
+ <p>Copyright &copy; 2006, Your Name. Valid <a href="http://validator.w3.org/check/referer">XHTML</a> and <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>.</p>
212
+ <p>Using <a href="http://evil.che.lu/projects/skittlish">skittlish</a> on <a href="http://publishwithimpunity.com/">mephisto</a>.</p>
213
+ </div>
214
+
215
+ </div>
216
+
217
+ </body>
218
+
219
+ </html>
@@ -52,14 +52,14 @@ describe "Updating a mirror" do
52
52
 
53
53
  context "with mergeable changes to the same file" do
54
54
  it "should auto-merge and commit" do
55
- `cp #{File.join(FIXTURE_PATH, "skit1_mergeable", @file_name)} #{File.join(TMP_PATH, "shiny", "skit1", @file_name)}`
55
+ `cp #{File.join(FIXTURE_PATH, "shiny_skit1_mergeable", @file_name)} #{File.join(TMP_PATH, "shiny", "skit1", @file_name)}`
56
56
 
57
57
  in_dir(@shiny) do
58
58
  `git commit -a -m 'mergeable change'`
59
59
  `#{BRAID_BIN} update skit1`
60
60
  end
61
61
 
62
- output = `diff -U 3 #{File.join(FIXTURE_PATH, "skit1.2_merged", @file_name)} #{File.join(TMP_PATH, "shiny", "skit1", @file_name)}`
62
+ output = `diff -U 3 #{File.join(FIXTURE_PATH, "shiny_skit1.2_merged", @file_name)} #{File.join(TMP_PATH, "shiny", "skit1", @file_name)}`
63
63
  $?.should be_success
64
64
 
65
65
  output = `git log --pretty=oneline`.split("\n")
@@ -70,7 +70,7 @@ describe "Updating a mirror" do
70
70
 
71
71
  context "with conflicting changes" do
72
72
  it "should leave conflict markup with the target revision" do
73
- `cp #{File.join(FIXTURE_PATH, "skit1_conflicting", @file_name)} #{File.join(TMP_PATH, "shiny", "skit1", @file_name)}`
73
+ `cp #{File.join(FIXTURE_PATH, "shiny_skit1_conflicting", @file_name)} #{File.join(TMP_PATH, "shiny", "skit1", @file_name)}`
74
74
 
75
75
  target_revision = nil
76
76
  in_dir(@skit1) do
@@ -89,5 +89,27 @@ describe "Updating a mirror" do
89
89
  end
90
90
  end
91
91
 
92
+ # Regression test for https://github.com/cristibalan/braid/issues/41.
93
+ context "with a convergent deletion" do
94
+ it "should not detect a bogus rename" do
95
+ in_dir(@skit1) do
96
+ `git rm layouts/layout.liquid`
97
+ `git commit -m "delete"`
98
+ end
99
+ in_dir(@shiny) do
100
+ `git rm skit1/layouts/layout.liquid`
101
+ `git commit -m "delete here too"`
102
+ end
103
+
104
+ # Without the fix, when git diffs the base and local trees, it will
105
+ # think skit1/layouts/layout.liquid was renamed to
106
+ # other-skit/layout.liquid, resulting in a rename-delete conflict.
107
+ braid_output = nil
108
+ in_dir(@shiny) do
109
+ braid_output = `#{BRAID_BIN} update skit1`
110
+ end
111
+ braid_output.should_not =~ /Caught merge error\. Breaking\./
112
+ end
113
+ end
92
114
  end
93
115
  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.4
4
+ version: 1.0.5
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: 2016-11-24 00:00:00.000000000 Z
13
+ date: 2017-01-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: main
@@ -100,16 +100,17 @@ files:
100
100
  - lib/braid/version.rb
101
101
  - spec/config_spec.rb
102
102
  - spec/fixtures/shiny/README
103
+ - spec/fixtures/shiny/other-skit/layout.liquid
104
+ - spec/fixtures/shiny_skit1.2_merged/layouts/layout.liquid
105
+ - spec/fixtures/shiny_skit1.2_merged/preview.png
106
+ - spec/fixtures/shiny_skit1_conflicting/layouts/layout.liquid
107
+ - spec/fixtures/shiny_skit1_conflicting/preview.png
108
+ - spec/fixtures/shiny_skit1_mergeable/layouts/layout.liquid
109
+ - spec/fixtures/shiny_skit1_mergeable/preview.png
103
110
  - spec/fixtures/skit1.1/layouts/layout.liquid
104
111
  - spec/fixtures/skit1.2/layouts/layout.liquid
105
- - spec/fixtures/skit1.2_merged/layouts/layout.liquid
106
- - spec/fixtures/skit1.2_merged/preview.png
107
112
  - spec/fixtures/skit1/layouts/layout.liquid
108
113
  - spec/fixtures/skit1/preview.png
109
- - spec/fixtures/skit1_conflicting/layouts/layout.liquid
110
- - spec/fixtures/skit1_conflicting/preview.png
111
- - spec/fixtures/skit1_mergeable/layouts/layout.liquid
112
- - spec/fixtures/skit1_mergeable/preview.png
113
114
  - spec/integration/adding_spec.rb
114
115
  - spec/integration/updating_spec.rb
115
116
  - spec/integration_helper.rb