changeset 50830 | de3191c0cec9 |
parent 50829 | 7d54b877782e |
child 50831 | 57ae6063c494 |
--- a/mercurial/commands.py Sun Aug 20 01:08:58 2023 -0400 +++ b/mercurial/commands.py Sun Aug 20 01:12:26 2023 -0400 @@ -18,7 +18,6 @@ short, wdirrev, ) -from .pycompat import open from . import ( archival, bookmarks, @@ -2354,9 +2353,7 @@ samplehgrc = uimod.samplehgrcs[b'user'] f = paths[0] - fp = open(f, b"wb") - fp.write(util.tonativeeol(samplehgrc)) - fp.close() + util.writefile(f, util.tonativeeol(samplehgrc)) editor = ui.geteditor() ui.system(