Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.2, 1.9.3, and 2.0

wconfig: normalize line endings on write

Closes #91

Changeset b2f1a8e06640

Parent 19dde97588bf

by Steve Borho

Changes to one file · Browse files at b2f1a8e06640 Showing diff from parent 19dde97588bf Diff from another changeset...

 
6
7
8
 
9
10
11
 
235
236
237
238
 
 
 
 
 
239
240
241
 
6
7
8
9
10
11
12
 
236
237
238
 
239
240
241
242
243
244
245
246
@@ -6,6 +6,7 @@
 # GNU General Public License version 2 or any later version.    import os +import cStringIO  from mercurial import util, config as config_mod    try: @@ -235,7 +236,11 @@
  """Write the given config obj to the specified file"""   f = util.atomictempfile(os.path.realpath(path), 'w')   try: - config.write(f) + buf = cStringIO.StringIO() + config.write(buf) + # normalize line endings + for line in buf.getvalue().splitlines(): + f.write(line + '\n')   f.rename()   finally:   del f # unlink temp file