Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.4, 2.0.5, and 2.1

stable shelve: do not needlessly insert a newline between patches (closes #579)

Changeset c0e1c948274a

Parent 97d2e52c2a02

by Steve Borho

Changes to one file · Browse files at c0e1c948274a Showing diff from parent 97d2e52c2a02 Diff from another changeset...

 
174
175
176
 
177
178
179
180
 
 
181
182
183
184
185
186
 
187
188
189
190
 
191
192
193
194
 
 
195
196
 
 
197
198
199
 
174
175
176
177
178
179
 
 
180
181
182
183
184
185
186
 
187
188
 
 
 
189
190
 
 
 
191
192
193
 
194
195
196
197
198
@@ -174,26 +174,25 @@
  if isinstance(ctx, patchctx):   repo.thgbackup(ctx._path)   fp = util.atomictempfile(ctx._path, 'wb') + buf = cStringIO.StringIO()   try:   if ctx._ph.comments: - fp.write('\n'.join(ctx._ph.comments)) - fp.write('\n\n') + buf.write('\n'.join(ctx._ph.comments)) + buf.write('\n\n')   needsnewline = False   for wfile in ctx._fileorder:   if wfile == self.currentFile:   if revertall:   continue - chunks[0].write(fp) + chunks[0].write(buf)   for chunk in kchunks: - chunk.write(fp) - if not chunks[-1].selected: - needsnewline = True + chunk.write(buf)   else: - if needsnewline: - fp.write('\n') - needsnewline = False + if buf.tell() and buf.getvalue()[-1] != '\n': + buf.write('\n')   for chunk in ctx._files[wfile]: - chunk.write(fp) + chunk.write(buf) + fp.write(buf.getvalue())   fp.rename()   finally:   del fp