comparison mercurial/cmdutil.py @ 30836:565c07036066

cmdutil: add tmpdir parament to ui.edit calls
author Sean Farley <sean@farley.io>
date Mon, 16 Jan 2017 21:15:21 -0800
parents bd5e9647f646
children 7080652af6e6
comparison
equal deleted inserted replaced
30835:bcad61a1f9a7 30836:565c07036066
229 if opts.get('review', False): 229 if opts.get('review', False):
230 patchtext = (crecordmod.diffhelptext 230 patchtext = (crecordmod.diffhelptext
231 + crecordmod.patchhelptext 231 + crecordmod.patchhelptext
232 + fp.read()) 232 + fp.read())
233 reviewedpatch = ui.edit(patchtext, "", 233 reviewedpatch = ui.edit(patchtext, "",
234 extra={"suffix": ".diff"}) 234 extra={"suffix": ".diff"},
235 tmpdir=repo.path)
235 fp.truncate(0) 236 fp.truncate(0)
236 fp.write(reviewedpatch) 237 fp.write(reviewedpatch)
237 fp.seek(0) 238 fp.seek(0)
238 239
239 [os.unlink(repo.wjoin(c)) for c in newlyaddedandmodifiedfiles] 240 [os.unlink(repo.wjoin(c)) for c in newlyaddedandmodifiedfiles]
2778 tr = repo.currenttransaction() 2779 tr = repo.currenttransaction()
2779 repo.dirstate.write(tr) 2780 repo.dirstate.write(tr)
2780 pending = tr and tr.writepending() and repo.root 2781 pending = tr and tr.writepending() and repo.root
2781 2782
2782 editortext = repo.ui.edit(committext, ctx.user(), ctx.extra(), 2783 editortext = repo.ui.edit(committext, ctx.user(), ctx.extra(),
2783 editform=editform, pending=pending) 2784 editform=editform, pending=pending,
2785 tmpdir=repo.path)
2784 text = editortext 2786 text = editortext
2785 2787
2786 # strip away anything below this special string (used for editors that want 2788 # strip away anything below this special string (used for editors that want
2787 # to display the diff) 2789 # to display the diff)
2788 stripbelow = re.search(_linebelow, text, flags=re.MULTILINE) 2790 stripbelow = re.search(_linebelow, text, flags=re.MULTILINE)