Patchwork [2,of,4,emacs-for-augie] cmdutil: add tmpdir parament to ui.edit calls

login
register
mail settings
Submitter Sean Farley
Date Jan. 17, 2017, 5:41 a.m.
Message ID <5630ebc6aa1f4560bf59.1484631672@1.0.0.127.in-addr.arpa>
Download mbox | patch
Permalink /patch/18231/
State Accepted
Headers show

Comments

Sean Farley - Jan. 17, 2017, 5:41 a.m.
# HG changeset patch
# User Sean Farley <sean@farley.io>
# Date 1484630121 28800
#      Mon Jan 16 21:15:21 2017 -0800
# Node ID 5630ebc6aa1f4560bf59275d654becc1861fd8c8
# Parent  cb18a2517507a169a7b3c38b369199130b1c89c0
cmdutil: add tmpdir parament to ui.edit calls

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
index a1ed9d3..8e23a18 100644
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -229,11 +229,12 @@  def dorecord(ui, repo, commitfunc, cmdsu
             if opts.get('review', False):
                 patchtext = (crecordmod.diffhelptext
                              + crecordmod.patchhelptext
                              + fp.read())
                 reviewedpatch = ui.edit(patchtext, "",
-                                        extra={"suffix": ".diff"})
+                                        extra={"suffix": ".diff"},
+                                        tmpdir=repo.path)
                 fp.truncate(0)
                 fp.write(reviewedpatch)
                 fp.seek(0)
 
             [os.unlink(repo.wjoin(c)) for c in newlyaddedandmodifiedfiles]
@@ -2777,11 +2778,12 @@  def commitforceeditor(repo, ctx, subs, f
     tr = repo.currenttransaction()
     repo.dirstate.write(tr)
     pending = tr and tr.writepending() and repo.root
 
     editortext = repo.ui.edit(committext, ctx.user(), ctx.extra(),
-                        editform=editform, pending=pending)
+                              editform=editform, pending=pending,
+                              tmpdir=repo.path)
     text = editortext
 
     # strip away anything below this special string (used for editors that want
     # to display the diff)
     stripbelow = re.search(_linebelow, text, flags=re.MULTILINE)