Mercurial > piecrust2
comparison garcon/changelog.py @ 649:e6d9eed35c8e
cm: Fix CHANGELOG newlines on Windows.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 16 Feb 2016 22:31:42 -0800 |
parents | 79aefe82c6b6 |
children | 3ab6f7a3a2c7 |
comparison
equal
deleted
inserted
replaced
648:1696f0a41cfc | 649:e6d9eed35c8e |
---|---|
45 '--template', hg_log_template]) | 45 '--template', hg_log_template]) |
46 hglog = hglog.decode('utf8') | 46 hglog = hglog.decode('utf8') |
47 | 47 |
48 templates = _get_templates() | 48 templates = _get_templates() |
49 | 49 |
50 with open(out_file, 'w') as fp: | 50 with open(out_file, 'w', encoding='utf8', newline='') as fp: |
51 fp.write(templates['header']) | 51 fp.write(templates['header']) |
52 | 52 |
53 skip = False | 53 skip = False |
54 in_desc = False | 54 in_desc = False |
55 current_version = 0 | 55 current_version = 0 |
155 tpls[name_no_ext] = tpl | 155 tpls[name_no_ext] = tpl |
156 return tpls | 156 return tpls |
157 | 157 |
158 | 158 |
159 def _get_template(filename): | 159 def _get_template(filename): |
160 with open(filename, 'r', encoding='utf8') as fp: | 160 with open(filename, 'r', encoding='utf8', newline='') as fp: |
161 return fp.read() | 161 return fp.read() |
162 | 162 |
163 | 163 |
164 if __name__ == '__main__': | 164 if __name__ == '__main__': |
165 parser = argparse.ArgumentParser(description='Generate CHANGELOG file.') | 165 parser = argparse.ArgumentParser(description='Generate CHANGELOG file.') |