public
Fork of schacon/ticgit
Description: Git based distributed ticketing system, including a command line client and web viewer
Clone URL: git://github.com/cyberlync/ticgit.git
added rspec tests that at least give it a baseline of coverage

also had to tweak the patch submitted for finding the .git directory
from looking for GIT_DIR to looking for GIT_WORKING_DIR
schacon (author)
Sat Mar 29 23:08:53 -0700 2008
commit  67e361826bed295526688cd5b8054d6936ef015c
tree    3576f4a19ba8ac7193c9adcbda04177ac2608199
parent  41940a30d606f70a0223263085040c27d8cf5745
...
41
42
43
44
45
 
 
46
47
48
...
178
179
180
181
182
183
184
...
201
202
203
204
205
206
 
 
 
 
 
207
208
209
...
220
221
222
223
224
225
226
227
 
228
229
230
...
249
250
251
252
 
253
254
255
...
41
42
43
 
 
44
45
46
47
48
...
178
179
180
 
181
182
183
...
200
201
202
 
 
 
203
204
205
206
207
208
209
210
...
221
222
223
 
 
 
 
 
224
225
226
227
...
246
247
248
 
249
250
251
252
0
@@ -41,8 +41,8 @@ module TicGit
0
     
0
     def find_repo(dir)
0
       full = File.expand_path(dir)
0
- ENV["GIT_DIR"] || loop do
0
- return full if File.directory?(File.join(full,".git"))
0
+ ENV["GIT_WORKING_DIR"] || loop do
0
+ return full if File.directory?(File.join(full, ".git"))
0
         raise NoRepoFound if full == full=File.dirname(full)
0
       end
0
     end
0
@@ -178,7 +178,6 @@ module TicGit
0
         else
0
           # partial or full sha
0
           if ch = @tickets.select { |name, t| t['files'].assoc('TICKET_ID')[1] =~ /^#{ticket_id}/ }
0
- p ch
0
             return ch.first[0]
0
           end
0
         end
0
@@ -201,9 +200,11 @@ module TicGit
0
         
0
     def ticket_change(new_state, ticket_id = nil)
0
       if t = ticket_revparse(ticket_id)
0
- ticket = TicGit::Ticket.open(self, t, @tickets[t])
0
- ticket.change_state(new_state)
0
- reset_ticgit
0
+ if tic_states.include?(new_state)
0
+ ticket = TicGit::Ticket.open(self, t, @tickets[t])
0
+ ticket.change_state(new_state)
0
+ reset_ticgit
0
+ end
0
       end
0
     end
0
     
0
@@ -220,11 +221,7 @@ module TicGit
0
 
0
     def comment_list(ticket_id)
0
     end
0
-
0
-
0
- def checkout(ticket)
0
- end
0
-
0
+
0
     def tic_states
0
       ['open', 'resolved', 'invalid', 'hold']
0
     end
0
@@ -249,7 +246,7 @@ module TicGit
0
     end
0
     
0
     def init_ticgit_branch(ticgit_branch = false)
0
- puts 'creating ticgit repo branch'
0
+ @logger.info 'creating ticgit repo branch'
0
       
0
       in_branch(ticgit_branch) do
0
         new_file('.hold', 'hold')
...
73
74
75
76
 
77
78
79
...
87
88
89
 
90
91
92
...
95
96
97
98
99
100
101
 
102
103
104
...
73
74
75
 
76
77
78
79
...
87
88
89
90
91
92
93
...
96
97
98
 
 
 
 
99
100
101
102
0
@@ -73,7 +73,7 @@ module TicGit
0
     # write this ticket to the git database
0
     def save_new
0
       base.in_branch do |wd|
0
- puts "saving #{ticket_name}"
0
+ base.logger.info "saving #{ticket_name}"
0
         
0
         Dir.mkdir(ticket_name)
0
         Dir.chdir(ticket_name) do
0
@@ -87,6 +87,7 @@ module TicGit
0
 
0
           # add initial tags
0
           if opts[:tags] && opts[:tags].size > 0
0
+ opts[:tags] = opts[:tags].map { |t| t.strip }.compact
0
             opts[:tags].each do |tag|
0
               if tag.size > 0
0
                 tag_filename = 'TAG_' + Ticket.clean_string(tag)
0
@@ -95,10 +96,7 @@ module TicGit
0
                 end
0
               end
0
             end
0
- end
0
-
0
- # !! TODO : add initial milestone
0
-
0
+ end
0
         end
0
   
0
         base.git.add

Comments

    No one has commented yet.