comparison hgext/transplant.py @ 9433:f01a22096f1f

transplant: Add trailing LF in tmp file for filtering Transplant filtering used a tmp file ending with the (stripped) commit message and thus no final LF. Text files not ending with LF is usually not used on Unix and is thus wrong ;-) The missing LF had bad consequences because Solaris sed chokes on unterminated input lines, so echo -n foo|sed 's,o,0,g' doesn't output anything, and the filter used in tests/test-transplant thus stripped the last (and only) line in the message away on solaris.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 10 Sep 2009 01:56:25 +0200
parents d0225fa2f6c4
children aa92ce9586d8
comparison
equal deleted inserted replaced
9431:d1b135f2f415 9433:f01a22096f1f
180 fd, headerfile = tempfile.mkstemp(prefix='hg-transplant-') 180 fd, headerfile = tempfile.mkstemp(prefix='hg-transplant-')
181 fp = os.fdopen(fd, 'w') 181 fp = os.fdopen(fd, 'w')
182 fp.write("# HG changeset patch\n") 182 fp.write("# HG changeset patch\n")
183 fp.write("# User %s\n" % user) 183 fp.write("# User %s\n" % user)
184 fp.write("# Date %d %d\n" % date) 184 fp.write("# Date %d %d\n" % date)
185 fp.write(changelog[4]) 185 fp.write(msg + '\n')
186 fp.close() 186 fp.close()
187 187
188 try: 188 try:
189 util.system('%s %s %s' % (filter, util.shellquote(headerfile), 189 util.system('%s %s %s' % (filter, util.shellquote(headerfile),
190 util.shellquote(patchfile)), 190 util.shellquote(patchfile)),