TicGit-ng 1.0.2.5 → 1.0.2.6

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.
@@ -332,7 +332,7 @@ module TicGitNG
332
332
  new_file('.hold', 'hold')
333
333
 
334
334
  unless ticgitng_branch
335
- git.add
335
+ git.add ".hold"
336
336
  git.commit('creating the ticgit-ng branch')
337
337
  end
338
338
  end
@@ -84,19 +84,29 @@ module TicGitNG
84
84
  # write this ticket to the git database
85
85
  def save_new
86
86
  base.in_branch do |wd|
87
+ files=[]
88
+ t=nil
87
89
  base.logger.info "saving #{ticket_name}"
88
90
 
89
91
  Dir.mkdir(ticket_name)
90
92
  Dir.chdir(ticket_name) do
91
93
  base.new_file('TICKET_ID', ticket_name)
94
+ files << File.join( ticket_name, 'TICKET_ID' )
92
95
  base.new_file('TICKET_TITLE', title)
93
- base.new_file('ASSIGNED_' + email, email)
94
- base.new_file('STATE_' + state, state)
96
+ files << File.join( ticket_name, 'TICKET_TITLE' )
97
+ base.new_file( (t='ASSIGNED_'+email) , email)
98
+ files << File.join( ticket_name, t )
99
+ base.new_file( (t='STATE_'+state) , state)
100
+ files << File.join( ticket_name, t )
95
101
  base.new_file('TITLE', title)
102
+ files << File.join( ticket_name, 'TITLE' )
96
103
 
97
104
  # add initial comment
98
105
  #COMMENT_080315060503045__schacon_at_gmail
99
- base.new_file(comment_name(email), opts[:comment]) if opts[:comment]
106
+ if opts[:comment]
107
+ base.new_file(t=comment_name(email), opts[:comment])
108
+ files << File.join( ticket_name, t )
109
+ end
100
110
 
101
111
  # add initial tags
102
112
  if opts[:tags] && opts[:tags].size > 0
@@ -106,12 +116,15 @@ module TicGitNG
106
116
  tag_filename = 'TAG_' + Ticket.clean_string(tag)
107
117
  if !File.exists?(tag_filename)
108
118
  base.new_file(tag_filename, tag_filename)
119
+ files << File.join( ticket_name, tag_filename )
109
120
  end
110
121
  end
111
122
  end
112
123
  end
113
124
  end
114
- base.git.add
125
+ files.each {|file|
126
+ base.git.add file
127
+ }
115
128
  base.git.commit("added ticket #{ticket_name}")
116
129
  end
117
130
  # ticket_id
@@ -124,10 +137,11 @@ module TicGitNG
124
137
  def add_comment(comment)
125
138
  return false if !comment
126
139
  base.in_branch do |wd|
140
+ t=nil
127
141
  Dir.chdir(ticket_name) do
128
- base.new_file(comment_name(email), comment)
142
+ base.new_file(t=comment_name(email), comment)
129
143
  end
130
- base.git.add
144
+ base.git.add File.join(ticket_name, t)
131
145
  base.git.commit("added comment to ticket #{ticket_name}")
132
146
  end
133
147
  end
@@ -135,13 +149,14 @@ module TicGitNG
135
149
  def change_state(new_state)
136
150
  return false if !new_state
137
151
  return false if new_state == state
152
+ t=nil
138
153
 
139
154
  base.in_branch do |wd|
140
155
  Dir.chdir(ticket_name) do
141
- base.new_file('STATE_' + new_state, new_state)
156
+ base.new_file(t='STATE_' + new_state, new_state)
142
157
  end
143
158
  base.git.remove(File.join(ticket_name,'STATE_' + state))
144
- base.git.add
159
+ base.git.add File.join(ticket_name, t)
145
160
  base.git.commit("added state (#{new_state}) to ticket #{ticket_name}")
146
161
  end
147
162
  end
@@ -152,11 +167,12 @@ module TicGitNG
152
167
  return false if new_assigned == old_assigned
153
168
 
154
169
  base.in_branch do |wd|
170
+ t=nil
155
171
  Dir.chdir(ticket_name) do
156
- base.new_file('ASSIGNED_' + new_assigned, new_assigned)
172
+ base.new_file(t='ASSIGNED_' + new_assigned, new_assigned)
157
173
  end
158
174
  base.git.remove(File.join(ticket_name,'ASSIGNED_' + old_assigned))
159
- base.git.add
175
+ base.git.add File.join(ticket_name,t)
160
176
  base.git.commit("assigned #{new_assigned} to ticket #{ticket_name}")
161
177
  end
162
178
  end
@@ -168,13 +184,14 @@ module TicGitNG
168
184
  Dir.chdir(ticket_name) do
169
185
  base.new_file('POINTS', new_points)
170
186
  end
171
- base.git.add
187
+ base.git.add File.join(ticket_name, 'POINTS')
172
188
  base.git.commit("set points to #{new_points} for ticket #{ticket_name}")
173
189
  end
174
190
  end
175
191
 
176
192
  def add_tag(tag)
177
193
  return false if !tag
194
+ files=[]
178
195
  added = false
179
196
  tags = tag.split(',').map { |t| t.strip }
180
197
  base.in_branch do |wd|
@@ -184,13 +201,16 @@ module TicGitNG
184
201
  tag_filename = 'TAG_' + Ticket.clean_string(add_tag)
185
202
  if !File.exists?(tag_filename)
186
203
  base.new_file(tag_filename, tag_filename)
204
+ files << File.join( ticket_name, tag_filename )
187
205
  added = true
188
206
  end
189
207
  end
190
208
  end
191
209
  end
192
210
  if added
193
- base.git.add
211
+ files.each {|file|
212
+ base.git.add file
213
+ }
194
214
  base.git.commit("added tags (#{tag}) to ticket #{ticket_name}")
195
215
  end
196
216
  end
@@ -1,3 +1,3 @@
1
1
  module TicGitNG
2
- VERSION = '1.0.2.5'
2
+ VERSION = '1.0.2.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: TicGit-ng
3
3
  version: !ruby/object:Gem::Version
4
- hash: 93
4
+ hash: 91
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
9
  - 2
10
- - 5
11
- version: 1.0.2.5
10
+ - 6
11
+ version: 1.0.2.6
12
12
  platform: ruby
13
13
  authors:
14
14
  - Scott Chacon
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-05-26 00:00:00 -04:00
20
+ date: 2011-05-28 00:00:00 -04:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency