hgext/shelve.py
changeset 37603 678d760c71ff
parent 37084 f0b6fbea00cf
child 37967 7932be8b0559
--- a/hgext/shelve.py	Thu Apr 12 22:39:43 2018 +0900
+++ b/hgext/shelve.py	Thu Apr 12 22:59:49 2018 +0900
@@ -413,9 +413,8 @@
 def _shelvecreatedcommit(repo, node, name):
     bases = list(mutableancestors(repo[node]))
     shelvedfile(repo, name, 'hg').writebundle(bases, node)
-    cmdutil.export(repo, [node],
-                   fp=shelvedfile(repo, name, patchextension).opener('wb'),
-                   opts=mdiff.diffopts(git=True))
+    with shelvedfile(repo, name, patchextension).opener('wb') as fp:
+        cmdutil.exportfile(repo, [node], fp, opts=mdiff.diffopts(git=True))
 
 def _includeunknownfiles(repo, pats, opts, extra):
     s = repo.status(match=scmutil.match(repo[None], pats, opts),