public
Fork of sr/git-wiki
Description: A quick & dirty git-powered Sinatra wiki
Homepage: http://atonie.org/2008/02/git-wiki
Clone URL: git://github.com/schacon/git-wiki.git
removed the bare branch deal because it was confusing
schacon (author)
Sun Apr 20 18:24:26 -0700 2008
commit  a34c1151386501b52161ef02b548e68ac422fd50
tree    3a56db6f48876df8a83d579ee8800b48f3c26214
parent  d294bebf8a4b9364727d472560fb8cf7bf553c47
0
...
4
5
6
7
8
9
 
10
11
12
13
14
 
15
16
17
...
4
5
6
 
7
8
9
10
 
11
12
13
14
15
16
17
0
@@ -4,14 +4,14 @@
0
   * pushing repo from web interface
0
 
0
 = CHACON IDEAS
0
- * inter-branch links
0
   * tagging
0
   * file attachments
0
+ * inter-branch links
0
   * merge conflict resolution
0
- * cherry-picked branches (read-tree/write-tree)
0
   * git-less version (read-only)
0
   * track which branched from which
0
   * push?
0
+ * cherry-picked branches (read-tree/write-tree)
0
   * users (email/name/ip - use for commits)
0
   
0
 = LATER/MAYBE
...
5
6
7
8
 
 
 
 
 
9
10
11
...
43
44
45
46
47
48
49
50
 
51
52
53
...
97
98
99
100
 
101
102
103
...
131
132
133
134
 
135
136
137
...
5
6
7
 
8
9
10
11
12
13
14
15
...
47
48
49
 
 
 
 
 
50
51
52
53
...
97
98
99
 
100
101
102
103
...
131
132
133
 
134
135
136
137
0
@@ -5,7 +5,11 @@ class Page
0
     @name = name
0
     @rev = rev
0
     @filename = File.join(GIT_REPO, @name)
0
- @attach_dir = File.join(GIT_REPO, '_attachments', @name)
0
+ @attach_dir = File.join(GIT_REPO, '_attachments', unwiki(@name))
0
+ end
0
+
0
+ def unwiki(string)
0
+ string.downcase
0
   end
0
 
0
   def body
0
@@ -43,11 +47,7 @@ class Page
0
   end
0
 
0
   def tracked?
0
- begin
0
- $repo.gtree('HEAD').children.keys.include?(@name)
0
- rescue
0
- false
0
- end
0
+ $repo.ls_files.keys.include?(@name)
0
   end
0
 
0
   def history
0
@@ -97,7 +97,7 @@ class Page
0
     else
0
       filename = file[:filename]
0
     end
0
- File.makedirs(@attach_dir) if !File.exists?(@attach_dir)
0
+ FileUtils.mkdir_p(@attach_dir) if !File.exists?(@attach_dir)
0
     new_file = File.join(@attach_dir, filename)
0
 
0
     f = File.new(new_file, 'w')
0
@@ -131,7 +131,7 @@ class Page
0
   
0
   def attachments
0
     if File.exists?(@attach_dir)
0
- return Dir.glob(File.join(@attach_dir, '*')).map { |f| Attachment.new(f, self.name) }
0
+ return Dir.glob(File.join(@attach_dir, '*')).map { |f| Attachment.new(f, unwiki(@name)) }
0
     else
0
       false
0
     end
...
21
22
23
 
 
24
 
25
26
27
...
29
30
31
32
 
 
33
34
35
...
21
22
23
24
25
26
27
28
29
30
...
32
33
34
 
35
36
37
38
39
0
@@ -21,7 +21,10 @@
0
     <label for="name">name</label>
0
     <input type="text" name="branch" />
0
     <br />
0
+
0
+ <input type="hidden" name="type" value="derive" />
0
     
0
+ <!--
0
     <label for="derive_radio">copy this branch</label>
0
     <input type="radio" name="type" value="derive" />
0
     <br />
0
@@ -29,7 +32,8 @@
0
     <label for="blank_radio">empty branch</label>
0
     <input type="radio" name="type" value="blank" />
0
     <br />
0
-
0
+ -->
0
+
0
     <label for="submit"></label>
0
     <input type="submit" value="create" class="submit" />
0
   </form>
...
34
35
36
37
 
38
39
40
...
42
43
44
 
45
46
47
48
...
34
35
36
 
37
38
39
40
...
42
43
44
45
46
47
48
49
0
@@ -34,7 +34,7 @@
0
   <% if @page.next_commit %>
0
     &bull; <a href="/h/<%= @page.name %>/<%= @page.next_commit %>" class="nav_link">newer</a>
0
   <% end %>
0
-
0
+
0
   <div class="sub_nav details">
0
     <script type="text/javascript">
0
       document.write(time_ago_in_words(<%= @page.updated_at.for_time_ago_in_words %>) + ' ago');
0
@@ -42,6 +42,7 @@
0
     <br />
0
     <%= $repo.current_branch %> branch
0
   </div>
0
+
0
 </div>
0
 
0
 <div class="content edit_area"><%= @page.body %></div>
0
\ No newline at end of file

Comments

    No one has commented yet.