braid 1.0.3 → 1.0.4

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: aa691f5a28cf6daca3abe0a103bc9bc50786ee8b
4
- data.tar.gz: 6dac5a1ac3d0f1f8c2d4e25eae222dd4ebbaea1e
3
+ metadata.gz: f3ed308ecd0d1f942297b2414db50e25e562ed4f
4
+ data.tar.gz: daa7372e07ad6b3dd0a47cfc4e93a3d8412bd4ed
5
5
  SHA512:
6
- metadata.gz: 49d8bab55f41ee73ea9fc92ee80cb4993e0ce409ae56b329c6a23c0d227a22477bc530061f11e97ce231641b4feb49c4c2fe8fdf1879fd3c4dfff13065a2f5be
7
- data.tar.gz: 3bf6c71c7f52c1a0b757308ab2e3fb7296f04550becce5983d0a8b20cdc06e64a7382aca3839637b0a7d44b5ca437bb0be05c6a15591bff1120c015d03dbb45b
6
+ metadata.gz: fa53d78eb05454a44369074ec88714b116f67125bf5bcd2b4bfa033fff60c65d6519d2c0117fdbd7fe3fb4f044a486ca7269e0d91594ef6177ec157d21d82137
7
+ data.tar.gz: c9808e139bd1e44c2e112a4ba414e7ce36b9094cf1833cfd3b4b06e83c38bc493f8fdfc79f41c17d5a1864fb5446a98f01f5741f309b5e1a26d481b966689c8d
@@ -12,8 +12,6 @@ Pester us if we don't get your Pull Requests merged in a timely fashion. :)
12
12
 
13
13
  ## How to speed the merging of pull requests
14
14
 
15
- * Describe your changes in the CHANGELOG.
16
- * Give yourself some credit in the appropriate place (usually the CHANGELOG).
17
15
  * Make commits of logical units.
18
16
  * Ensure your commit messages help others understand what you are doing and why.
19
17
  * Check for unnecessary whitespace with `git diff --check` before committing.
data/README.md CHANGED
@@ -152,6 +152,7 @@ re-add and maintain the Subversion support, please contact the authors.
152
152
  * Christoph Sturm
153
153
  * Dennis Muhlestein
154
154
  * Ferdinand Svehla
155
+ * Matt McCutchen
155
156
  * Michael Klishin
156
157
  * Roman Heinrich
157
158
  * Travis Tilley
@@ -21,7 +21,7 @@ module Braid
21
21
  unless mirror.squashed?
22
22
  git.merge_ours(target_revision)
23
23
  end
24
- git.read_tree_prefix(target_revision, mirror.path)
24
+ git.read_tree_prefix_u(target_revision, mirror.path)
25
25
 
26
26
  mirror.revision = new_revision
27
27
  mirror.lock = new_revision if options['revision']
@@ -65,16 +65,12 @@ module Braid
65
65
  msg "Merging in mirror '#{mirror.path}'." if verbose?
66
66
  begin
67
67
  if mirror.squashed?
68
- local_hash = git.rev_parse('HEAD')
69
- if !diff.empty?
70
- base_hash = generate_tree_hash(mirror, base_revision)
71
- else
72
- base_hash = local_hash
73
- end
68
+ local_hash = git.rev_parse('HEAD')
69
+ base_hash = generate_tree_hash(mirror, base_revision)
74
70
  remote_hash = generate_tree_hash(mirror, target_revision)
75
71
  ENV["GITHEAD_#{local_hash}"] = 'HEAD'
76
72
  ENV["GITHEAD_#{remote_hash}"] = target_revision
77
- git.merge_recursive(base_hash, local_hash, remote_hash)
73
+ git.merge_trees(base_hash, local_hash, remote_hash)
78
74
  else
79
75
  git.merge_subtree(target_revision)
80
76
  end
@@ -96,12 +92,10 @@ module Braid
96
92
  end
97
93
 
98
94
  def generate_tree_hash(mirror, revision)
99
- git.rm_r(mirror.path)
100
- git.read_tree_prefix(revision, mirror.path)
101
- success = git.commit("Temporary commit for mirror '#{mirror.path}'")
102
- hash = git.rev_parse('HEAD')
103
- git.reset_hard('HEAD^') if success
104
- hash
95
+ git.with_temporary_index do
96
+ git.read_tree_prefix_i(revision, mirror.path)
97
+ git.write_tree()
98
+ end
105
99
  end
106
100
  end
107
101
  end
@@ -245,8 +245,16 @@ module Braid
245
245
  raise MergeError
246
246
  end
247
247
 
248
- def merge_recursive(base_hash, local_hash, remote_hash)
249
- invoke(:merge_recursive, base_hash, "-- #{local_hash} #{remote_hash}")
248
+ # Merge three trees (local_treeish should match the current state of the
249
+ # index) and update the index and working tree.
250
+ #
251
+ # The usage of "git merge-recursive" doesn't seem to be officially
252
+ # documented, but it does accept trees. When a single base is passed, the
253
+ # "recursive" part (i.e., merge of bases) does not come into play and only
254
+ # the trees matter. But for some reason, Git's smartest tree merge
255
+ # algorithm is only available via the "recursive" strategy.
256
+ def merge_trees(base_treeish, local_treeish, remote_treeish)
257
+ invoke(:merge_recursive, base_treeish, "-- #{local_treeish} #{remote_treeish}")
250
258
  true
251
259
  rescue ShellExecutionError
252
260
  raise MergeError
@@ -256,11 +264,37 @@ module Braid
256
264
  invoke('ls-files', prefix)
257
265
  end
258
266
 
259
- def read_tree_prefix(treeish, prefix)
267
+ # Read tree into the index and working tree.
268
+ def read_tree_prefix_u(treeish, prefix)
260
269
  invoke(:read_tree, "--prefix=#{prefix}/ -u", treeish)
261
270
  true
262
271
  end
263
272
 
273
+ # Read tree into the index, regardless of the state of the working tree.
274
+ # Most useful with a temporary index file.
275
+ def read_tree_prefix_i(treeish, prefix)
276
+ invoke(:read_tree, "--prefix=#{prefix}/ -i", treeish)
277
+ true
278
+ end
279
+
280
+ # Write a tree object for the current index and return its ID.
281
+ def write_tree()
282
+ invoke(:write_tree)
283
+ end
284
+
285
+ # Execute a block using a temporary git index file, initially empty.
286
+ def with_temporary_index()
287
+ Dir.mktmpdir("braid_index") do |dir|
288
+ orig_index_file = ENV["GIT_INDEX_FILE"]
289
+ ENV["GIT_INDEX_FILE"] = File.join(dir, "index")
290
+ begin
291
+ yield
292
+ ensure
293
+ ENV["GIT_INDEX_FILE"] = orig_index_file
294
+ end
295
+ end
296
+ end
297
+
264
298
  def rm_r(path)
265
299
  invoke(:rm, '-r', path)
266
300
  true
@@ -1,3 +1,3 @@
1
1
  module Braid
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.4'
3
3
  end
@@ -0,0 +1,223 @@
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 green">
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>Mergeable change</p>
83
+
84
+ <p>Have boxes with smaller text with the class "minor". See the "Recent" boxy below.</p>
85
+
86
+ <p>Happy boxying!</p>
87
+
88
+ </div>
89
+
90
+ <div id="search" class="boxy short">
91
+ <h3>Search</h3>
92
+ <form method="get" action="/search">
93
+ <fieldset>
94
+ <input class="text" type="text" id="q" value="" name="q"/>
95
+ </fieldset>
96
+ </form>
97
+ </div>
98
+
99
+ <div class="boxy tall minor">
100
+ <h3>Recent</h3>
101
+
102
+ <dl>
103
+ <dt>Articles <a class="feed" href="{{ global_feed }}"><span>feed</span></a></dt>
104
+ <dd>
105
+ <ul>
106
+ {% for article in site.latest_articles %}
107
+ <li>{{ article | link_to_article }} <em>({{ article.published_at | format_date: 'stub', true }})</em></li>
108
+ {% endfor %}
109
+ </ul>
110
+ </dd>
111
+
112
+ <dt>Comments <a class="feed" href="{{ global_comments_feed }}"><span>feed</span></a></dt>
113
+ <dd>
114
+ <ul>
115
+ {% for comment in site.latest_comments %}
116
+ <li>{{ comment.author_link }} on <a href="{{ comment.url }}#comment-{{ comment.id }}">{{ comment.title }}</a></li>
117
+ {% endfor %}
118
+ </ul>
119
+ </dd>
120
+ </dl>
121
+ </div>
122
+
123
+ <div class="boxy short">
124
+ <h3>Archives</h3>
125
+ <p>This would be much nicer with jamis' month_drop thingy.</p>
126
+ {{ '' | section | months | assign_to: 'home_section' }}
127
+ <ul>
128
+ {% for month in home_section.months %}
129
+ {{ home_section | monthly_articles: month | size | assign_to: 'articles_count' }}
130
+ {% if articles_count > 0 %}
131
+ <li>{{ home_section | link_to_month: month }} ({{ articles_count }})</li>
132
+ {% endif %}
133
+ {% endfor %}
134
+ </ul>
135
+ </div>
136
+
137
+ {% if site.blog_sections.size > 1 %}
138
+ <div class="boxy short">
139
+ <h3>Categories</h3>
140
+ <p>Lists only blog type categories with at least one article.</p>
141
+ <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>
142
+ <ul class="sections">
143
+ {% for section in site.blog_sections %}
144
+ {% if section.articles_count > 0 %}
145
+ {% unless section.is_home %}
146
+ <li>{{ section | link_to_section }} ({{ section.articles_count }})</li>
147
+ {% endunless %}
148
+ {% endif %}
149
+ {% endfor %}
150
+ </ul>
151
+ </div>
152
+
153
+ {% endif %}
154
+ {% unless site.tags == empty %}
155
+ <div class="boxy short">
156
+ <p>This would be nicer if we could get the number of articles for each tag.</p>
157
+ <h3>tags: </h3>
158
+ <ul>
159
+ {% for tag in site.tags %}
160
+ <li>{{ tag | link_to_tag }}</li>
161
+ {% endfor %}
162
+ </ul>
163
+ </div>
164
+
165
+ {% endunless %}
166
+ <div class="boxy tall">
167
+ <h3>boxy tall</h3>
168
+ <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>
169
+ <dl>
170
+ <dt>thing 1</dt>
171
+ <dd><a href="#">value 1</a></dd>
172
+ <dd><a href="#">value 2</a></dd>
173
+ <dd><a href="#">value 3</a></dd>
174
+ <dd><a href="#">value 4</a></dd>
175
+ <dd><a href="#">value 5</a></dd>
176
+ <dd><a href="#">value 6</a></dd>
177
+ <dd><a href="#">value 6</a></dd>
178
+
179
+ <dt>thing 1</dt>
180
+ <dd><a href="#">value 1</a></dd>
181
+ <dd><a href="#">value 2</a></dd>
182
+ <dd><a href="#">value 3</a></dd>
183
+ <dd>value 4</dd>
184
+ <dd>value 5</dd>
185
+ <dd><a href="#">value 6</a></dd>
186
+ <dd><a href="#">value 6</a></dd>
187
+
188
+ </dl>
189
+ </div>
190
+
191
+ </div>
192
+
193
+ </div>
194
+
195
+ <div id="options">
196
+ <h2>Options:</h2>
197
+ <h3>Size</h3>
198
+ <ul id="option_size">
199
+ <li id="option_size_fixed" class="fixed" ><a><span>fixed </span></a></li>
200
+ <li id="option_size_fluid" class="fluid" ><a><span>fluid </span></a></li>
201
+ </ul>
202
+ <h3>Colors</h3>
203
+ <ul id="option_color">
204
+ <li id="option_color_orange" class="orange"><a><span>orange</span></a></li>
205
+ <li id="option_color_blue" class="blue" ><a><span>blue </span></a></li>
206
+ <li id="option_color_green" class="green" ><a><span>green </span></a></li>
207
+ <li id="option_color_pink" class="pink" ><a><span>pink </span></a></li>
208
+ <li id="option_color_cyan" class="cyan" ><a><span>cyan </span></a></li>
209
+ <li id="option_color_red" class="red" ><a><span>red </span></a></li>
210
+ <li id="option_color_violet" class="violet"><a><span>violet</span></a></li>
211
+ </ul>
212
+ </div>
213
+
214
+ <div id="footer">
215
+ <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>
216
+ <p>Using <a href="http://evil.che.lu/projects/skittlish">skittlish</a> on <a href="http://publishwithimpunity.com/">mephisto</a>.</p>
217
+ </div>
218
+
219
+ </div>
220
+
221
+ </body>
222
+
223
+ </html>
@@ -0,0 +1,221 @@
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
+ <p>Unhappy merging.</p>
85
+
86
+ </div>
87
+
88
+ <div id="search" class="boxy short">
89
+ <h3>Search</h3>
90
+ <form method="get" action="/search">
91
+ <fieldset>
92
+ <input class="text" type="text" id="q" value="" name="q"/>
93
+ </fieldset>
94
+ </form>
95
+ </div>
96
+
97
+ <div class="boxy tall minor">
98
+ <h3>Recent</h3>
99
+
100
+ <dl>
101
+ <dt>Articles <a class="feed" href="{{ global_feed }}"><span>feed</span></a></dt>
102
+ <dd>
103
+ <ul>
104
+ {% for article in site.latest_articles %}
105
+ <li>{{ article | link_to_article }} <em>({{ article.published_at | format_date: 'stub', true }})</em></li>
106
+ {% endfor %}
107
+ </ul>
108
+ </dd>
109
+
110
+ <dt>Comments <a class="feed" href="{{ global_comments_feed }}"><span>feed</span></a></dt>
111
+ <dd>
112
+ <ul>
113
+ {% for comment in site.latest_comments %}
114
+ <li>{{ comment.author_link }} on <a href="{{ comment.url }}#comment-{{ comment.id }}">{{ comment.title }}</a></li>
115
+ {% endfor %}
116
+ </ul>
117
+ </dd>
118
+ </dl>
119
+ </div>
120
+
121
+ <div class="boxy short">
122
+ <h3>Archives</h3>
123
+ <p>This would be much nicer with jamis' month_drop thingy.</p>
124
+ {{ '' | section | months | assign_to: 'home_section' }}
125
+ <ul>
126
+ {% for month in home_section.months %}
127
+ {{ home_section | monthly_articles: month | size | assign_to: 'articles_count' }}
128
+ {% if articles_count > 0 %}
129
+ <li>{{ home_section | link_to_month: month }} ({{ articles_count }})</li>
130
+ {% endif %}
131
+ {% endfor %}
132
+ </ul>
133
+ </div>
134
+
135
+ {% if site.blog_sections.size > 1 %}
136
+ <div class="boxy short">
137
+ <h3>Categories</h3>
138
+ <p>Lists only blog type categories with at least one article.</p>
139
+ <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>
140
+ <ul class="sections">
141
+ {% for section in site.blog_sections %}
142
+ {% if section.articles_count > 0 %}
143
+ {% unless section.is_home %}
144
+ <li>{{ section | link_to_section }} ({{ section.articles_count }})</li>
145
+ {% endunless %}
146
+ {% endif %}
147
+ {% endfor %}
148
+ </ul>
149
+ </div>
150
+
151
+ {% endif %}
152
+ {% unless site.tags == empty %}
153
+ <div class="boxy short">
154
+ <p>This would be nicer if we could get the number of articles for each tag.</p>
155
+ <h3>tags: </h3>
156
+ <ul>
157
+ {% for tag in site.tags %}
158
+ <li>{{ tag | link_to_tag }}</li>
159
+ {% endfor %}
160
+ </ul>
161
+ </div>
162
+
163
+ {% endunless %}
164
+ <div class="boxy tall">
165
+ <h3>boxy tall</h3>
166
+ <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>
167
+ <dl>
168
+ <dt>thing 1</dt>
169
+ <dd><a href="#">value 1</a></dd>
170
+ <dd><a href="#">value 2</a></dd>
171
+ <dd><a href="#">value 3</a></dd>
172
+ <dd><a href="#">value 4</a></dd>
173
+ <dd><a href="#">value 5</a></dd>
174
+ <dd><a href="#">value 6</a></dd>
175
+ <dd><a href="#">value 6</a></dd>
176
+
177
+ <dt>thing 1</dt>
178
+ <dd><a href="#">value 1</a></dd>
179
+ <dd><a href="#">value 2</a></dd>
180
+ <dd><a href="#">value 3</a></dd>
181
+ <dd>value 4</dd>
182
+ <dd>value 5</dd>
183
+ <dd><a href="#">value 6</a></dd>
184
+ <dd><a href="#">value 6</a></dd>
185
+
186
+ </dl>
187
+ </div>
188
+
189
+ </div>
190
+
191
+ </div>
192
+
193
+ <div id="options">
194
+ <h2>Options:</h2>
195
+ <h3>Size</h3>
196
+ <ul id="option_size">
197
+ <li id="option_size_fixed" class="fixed" ><a><span>fixed </span></a></li>
198
+ <li id="option_size_fluid" class="fluid" ><a><span>fluid </span></a></li>
199
+ </ul>
200
+ <h3>Colors</h3>
201
+ <ul id="option_color">
202
+ <li id="option_color_orange" class="orange"><a><span>orange</span></a></li>
203
+ <li id="option_color_blue" class="blue" ><a><span>blue </span></a></li>
204
+ <li id="option_color_green" class="green" ><a><span>green </span></a></li>
205
+ <li id="option_color_pink" class="pink" ><a><span>pink </span></a></li>
206
+ <li id="option_color_cyan" class="cyan" ><a><span>cyan </span></a></li>
207
+ <li id="option_color_red" class="red" ><a><span>red </span></a></li>
208
+ <li id="option_color_violet" class="violet"><a><span>violet</span></a></li>
209
+ </ul>
210
+ </div>
211
+
212
+ <div id="footer">
213
+ <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>
214
+ <p>Using <a href="http://evil.che.lu/projects/skittlish">skittlish</a> on <a href="http://publishwithimpunity.com/">mephisto</a>.</p>
215
+ </div>
216
+
217
+ </div>
218
+
219
+ </body>
220
+
221
+ </html>
@@ -0,0 +1,221 @@
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>Mergeable change</p>
83
+
84
+ <p>Have boxes with smaller text with the class "minor". See the "Recent" boxy below.</p>
85
+
86
+ </div>
87
+
88
+ <div id="search" class="boxy short">
89
+ <h3>Search</h3>
90
+ <form method="get" action="/search">
91
+ <fieldset>
92
+ <input class="text" type="text" id="q" value="" name="q"/>
93
+ </fieldset>
94
+ </form>
95
+ </div>
96
+
97
+ <div class="boxy tall minor">
98
+ <h3>Recent</h3>
99
+
100
+ <dl>
101
+ <dt>Articles <a class="feed" href="{{ global_feed }}"><span>feed</span></a></dt>
102
+ <dd>
103
+ <ul>
104
+ {% for article in site.latest_articles %}
105
+ <li>{{ article | link_to_article }} <em>({{ article.published_at | format_date: 'stub', true }})</em></li>
106
+ {% endfor %}
107
+ </ul>
108
+ </dd>
109
+
110
+ <dt>Comments <a class="feed" href="{{ global_comments_feed }}"><span>feed</span></a></dt>
111
+ <dd>
112
+ <ul>
113
+ {% for comment in site.latest_comments %}
114
+ <li>{{ comment.author_link }} on <a href="{{ comment.url }}#comment-{{ comment.id }}">{{ comment.title }}</a></li>
115
+ {% endfor %}
116
+ </ul>
117
+ </dd>
118
+ </dl>
119
+ </div>
120
+
121
+ <div class="boxy short">
122
+ <h3>Archives</h3>
123
+ <p>This would be much nicer with jamis' month_drop thingy.</p>
124
+ {{ '' | section | months | assign_to: 'home_section' }}
125
+ <ul>
126
+ {% for month in home_section.months %}
127
+ {{ home_section | monthly_articles: month | size | assign_to: 'articles_count' }}
128
+ {% if articles_count > 0 %}
129
+ <li>{{ home_section | link_to_month: month }} ({{ articles_count }})</li>
130
+ {% endif %}
131
+ {% endfor %}
132
+ </ul>
133
+ </div>
134
+
135
+ {% if site.blog_sections.size > 1 %}
136
+ <div class="boxy short">
137
+ <h3>Categories</h3>
138
+ <p>Lists only blog type categories with at least one article.</p>
139
+ <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>
140
+ <ul class="sections">
141
+ {% for section in site.blog_sections %}
142
+ {% if section.articles_count > 0 %}
143
+ {% unless section.is_home %}
144
+ <li>{{ section | link_to_section }} ({{ section.articles_count }})</li>
145
+ {% endunless %}
146
+ {% endif %}
147
+ {% endfor %}
148
+ </ul>
149
+ </div>
150
+
151
+ {% endif %}
152
+ {% unless site.tags == empty %}
153
+ <div class="boxy short">
154
+ <p>This would be nicer if we could get the number of articles for each tag.</p>
155
+ <h3>tags: </h3>
156
+ <ul>
157
+ {% for tag in site.tags %}
158
+ <li>{{ tag | link_to_tag }}</li>
159
+ {% endfor %}
160
+ </ul>
161
+ </div>
162
+
163
+ {% endunless %}
164
+ <div class="boxy tall">
165
+ <h3>boxy tall</h3>
166
+ <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>
167
+ <dl>
168
+ <dt>thing 1</dt>
169
+ <dd><a href="#">value 1</a></dd>
170
+ <dd><a href="#">value 2</a></dd>
171
+ <dd><a href="#">value 3</a></dd>
172
+ <dd><a href="#">value 4</a></dd>
173
+ <dd><a href="#">value 5</a></dd>
174
+ <dd><a href="#">value 6</a></dd>
175
+ <dd><a href="#">value 6</a></dd>
176
+
177
+ <dt>thing 1</dt>
178
+ <dd><a href="#">value 1</a></dd>
179
+ <dd><a href="#">value 2</a></dd>
180
+ <dd><a href="#">value 3</a></dd>
181
+ <dd>value 4</dd>
182
+ <dd>value 5</dd>
183
+ <dd><a href="#">value 6</a></dd>
184
+ <dd><a href="#">value 6</a></dd>
185
+
186
+ </dl>
187
+ </div>
188
+
189
+ </div>
190
+
191
+ </div>
192
+
193
+ <div id="options">
194
+ <h2>Options:</h2>
195
+ <h3>Size</h3>
196
+ <ul id="option_size">
197
+ <li id="option_size_fixed" class="fixed" ><a><span>fixed </span></a></li>
198
+ <li id="option_size_fluid" class="fluid" ><a><span>fluid </span></a></li>
199
+ </ul>
200
+ <h3>Colors</h3>
201
+ <ul id="option_color">
202
+ <li id="option_color_orange" class="orange"><a><span>orange</span></a></li>
203
+ <li id="option_color_blue" class="blue" ><a><span>blue </span></a></li>
204
+ <li id="option_color_green" class="green" ><a><span>green </span></a></li>
205
+ <li id="option_color_pink" class="pink" ><a><span>pink </span></a></li>
206
+ <li id="option_color_cyan" class="cyan" ><a><span>cyan </span></a></li>
207
+ <li id="option_color_red" class="red" ><a><span>red </span></a></li>
208
+ <li id="option_color_violet" class="violet"><a><span>violet</span></a></li>
209
+ </ul>
210
+ </div>
211
+
212
+ <div id="footer">
213
+ <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>
214
+ <p>Using <a href="http://evil.che.lu/projects/skittlish">skittlish</a> on <a href="http://publishwithimpunity.com/">mephisto</a>.</p>
215
+ </div>
216
+
217
+ </div>
218
+
219
+ </body>
220
+
221
+ </html>
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/../integration_helper'
2
2
 
3
- describe "Updating a mirror without conflicts" do
3
+ describe "Updating a mirror" do
4
4
 
5
5
  before do
6
6
  FileUtils.rm_rf(TMP_PATH)
@@ -11,6 +11,7 @@ describe "Updating a mirror without conflicts" do
11
11
  before do
12
12
  @shiny = create_git_repo_from_fixture("shiny")
13
13
  @skit1 = create_git_repo_from_fixture("skit1")
14
+ @file_name = "layouts/layout.liquid"
14
15
 
15
16
  in_dir(@shiny) do
16
17
  `#{BRAID_BIN} add #{@skit1}`
@@ -30,18 +31,62 @@ describe "Updating a mirror without conflicts" do
30
31
 
31
32
  end
32
33
 
33
- it "should add the files and commit" do
34
- in_dir(@shiny) do
35
- `#{BRAID_BIN} update skit1`
34
+ context "with no project-specific changes" do
35
+ it "should add the files and commit" do
36
+ in_dir(@shiny) do
37
+ `#{BRAID_BIN} update skit1`
38
+ end
39
+
40
+ output = `diff -U 3 #{File.join(FIXTURE_PATH, "skit1.2", @file_name)} #{File.join(TMP_PATH, "shiny", "skit1", @file_name)}`
41
+ $?.should be_success
42
+
43
+ output = `git log --pretty=oneline`.split("\n")
44
+ output.length.should == 3
45
+ output[0].should =~ /Braid: Update mirror 'skit1' to '[0-9a-f]{7}'/
46
+
47
+ # No temporary commits should be added to the reflog.
48
+ output = `git log -g --pretty=oneline`.split("\n")
49
+ output.length.should == 3
50
+ end
51
+ end
52
+
53
+ context "with mergeable changes to the same file" do
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)}`
56
+
57
+ in_dir(@shiny) do
58
+ `git commit -a -m 'mergeable change'`
59
+ `#{BRAID_BIN} update skit1`
60
+ end
61
+
62
+ output = `diff -U 3 #{File.join(FIXTURE_PATH, "skit1.2_merged", @file_name)} #{File.join(TMP_PATH, "shiny", "skit1", @file_name)}`
63
+ $?.should be_success
64
+
65
+ output = `git log --pretty=oneline`.split("\n")
66
+ output.length.should == 4 # plus 'mergeable change'
67
+ output[0].should =~ /Braid: Update mirror 'skit1' to '[0-9a-f]{7}'/
36
68
  end
69
+ end
37
70
 
38
- file_name = "layouts/layout.liquid"
39
- output = `diff -U 3 #{File.join(FIXTURE_PATH, "skit1.2", file_name)} #{File.join(TMP_PATH, "shiny", "skit1", file_name)}`
40
- $?.should be_success
71
+ context "with conflicting changes" do
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)}`
41
74
 
42
- output = `git log --pretty=oneline`.split("\n")
43
- output.length.should == 3
44
- output[0].should =~ /Braid: Update mirror 'skit1' to '[0-9a-f]{7}'/
75
+ target_revision = nil
76
+ in_dir(@skit1) do
77
+ target_revision = `git rev-parse HEAD`
78
+ end
79
+
80
+ braid_output = nil
81
+ in_dir(@shiny) do
82
+ `git commit -a -m 'conflicting change'`
83
+ braid_output = `#{BRAID_BIN} update skit1`
84
+ end
85
+ braid_output.should =~ /Caught merge error\. Breaking\./
86
+
87
+ `grep -q '>>>>>>> #{target_revision}' #{File.join(TMP_PATH, "shiny", "skit1", @file_name)}`
88
+ $?.should be_success
89
+ end
45
90
  end
46
91
 
47
92
  end
@@ -36,9 +36,9 @@ def create_git_repo_from_fixture(fixture_name)
36
36
  update_dir_from_fixture(fixture_name)
37
37
 
38
38
  in_dir(git_repo) do
39
- run_command("git config --global --get user.email || git config --global user.email \"you@example.com\"")
40
- run_command("git config --global --get user.name || git config --global user.name \"Your Name\"")
41
39
  run_command('git init')
40
+ run_command("git config user.email \"you@example.com\"")
41
+ run_command("git config user.name \"Your Name\"")
42
42
  run_command('git add *')
43
43
  run_command("git commit -m \"initial commit of #{fixture_name}\"")
44
44
  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.3
4
+ version: 1.0.4
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-07-25 00:00:00.000000000 Z
13
+ date: 2016-11-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: main
@@ -102,8 +102,14 @@ files:
102
102
  - spec/fixtures/shiny/README
103
103
  - spec/fixtures/skit1.1/layouts/layout.liquid
104
104
  - spec/fixtures/skit1.2/layouts/layout.liquid
105
+ - spec/fixtures/skit1.2_merged/layouts/layout.liquid
106
+ - spec/fixtures/skit1.2_merged/preview.png
105
107
  - spec/fixtures/skit1/layouts/layout.liquid
106
108
  - 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
107
113
  - spec/integration/adding_spec.rb
108
114
  - spec/integration/updating_spec.rb
109
115
  - spec/integration_helper.rb