Permalink
Browse files

removed the bare branch deal because it was confusing

  • Loading branch information...
1 parent d294beb commit a34c1151386501b52161ef02b548e68ac422fd50 @schacon schacon committed Apr 21, 2008
Showing with 17 additions and 12 deletions.
  1. +2 −2 TODO
  2. +8 −8 page.rb
  3. +5 −1 views/branches.erb
  4. +2 −1 views/show.erb
View
4 TODO
@@ -4,14 +4,14 @@
* pushing repo from web interface
= CHACON IDEAS
- * inter-branch links
* tagging
* file attachments
+ * inter-branch links
* merge conflict resolution
- * cherry-picked branches (read-tree/write-tree)
* git-less version (read-only)
* track which branched from which
* push?
+ * cherry-picked branches (read-tree/write-tree)
* users (email/name/ip - use for commits)
= LATER/MAYBE
View
16 page.rb
@@ -5,7 +5,11 @@ def initialize(name, rev=nil)
@name = name
@rev = rev
@filename = File.join(GIT_REPO, @name)
- @attach_dir = File.join(GIT_REPO, '_attachments', @name)
+ @attach_dir = File.join(GIT_REPO, '_attachments', unwiki(@name))
+ end
+
+ def unwiki(string)
+ string.downcase
end
def body
@@ -43,11 +47,7 @@ def update(content, message=nil)
end
def tracked?
- begin
- $repo.gtree('HEAD').children.keys.include?(@name)
- rescue
- false
- end
+ $repo.ls_files.keys.include?(@name)
end
def history
@@ -97,7 +97,7 @@ def save_file(file, name = '')
else
filename = file[:filename]
end
- File.makedirs(@attach_dir) if !File.exists?(@attach_dir)
+ FileUtils.mkdir_p(@attach_dir) if !File.exists?(@attach_dir)
new_file = File.join(@attach_dir, filename)
f = File.new(new_file, 'w')
@@ -131,7 +131,7 @@ def delete_file(file)
def attachments
if File.exists?(@attach_dir)
- return Dir.glob(File.join(@attach_dir, '*')).map { |f| Attachment.new(f, self.name) }
+ return Dir.glob(File.join(@attach_dir, '*')).map { |f| Attachment.new(f, unwiki(@name)) }
else
false
end
View
6 views/branches.erb
@@ -21,15 +21,19 @@
<label for="name">name</label>
<input type="text" name="branch" />
<br />
+
+ <input type="hidden" name="type" value="derive" />
+ <!--
<label for="derive_radio">copy this branch</label>
<input type="radio" name="type" value="derive" />
<br />
<label for="blank_radio">empty branch</label>
<input type="radio" name="type" value="blank" />
<br />
-
+ -->
+
<label for="submit"></label>
<input type="submit" value="create" class="submit" />
</form>
View
3 views/show.erb
@@ -34,14 +34,15 @@
<% if @page.next_commit %>
&bull; <a href="/h/<%= @page.name %>/<%= @page.next_commit %>" class="nav_link">newer</a>
<% end %>
-
+
<div class="sub_nav details">
<script type="text/javascript">
document.write(time_ago_in_words(<%= @page.updated_at.for_time_ago_in_words %>) + ' ago');
</script>
<br />
<%= $repo.current_branch %> branch
</div>
+
</div>
<div class="content edit_area"><%= @page.body %></div>

0 comments on commit a34c115

Please sign in to comment.