ui: rename tmpdir parameter to more specific repopath stable
authorSean Farley <sean@farley.io>
Wed, 18 Jan 2017 18:25:51 -0800
branchstable
changeset 30848 7080652af6e6
parent 30847 e12553cfd0a4
child 30849 763031a7690d
ui: rename tmpdir parameter to more specific repopath This was requested by Augie and I agree that repopath is more descriptive.
hgext/histedit.py
hgext/patchbomb.py
mercurial/cmdutil.py
mercurial/ui.py
--- a/hgext/histedit.py	Thu Jan 19 23:01:32 2017 +0900
+++ b/hgext/histedit.py	Wed Jan 18 18:25:51 2017 -0800
@@ -1335,7 +1335,7 @@
     rules += '\n\n'
     rules += editcomment
     rules = ui.edit(rules, ui.username(), {'prefix': 'histedit'},
-                    tmpdir=repo.path)
+                    repopath=repo.path)
 
     # Save edit rules in .hg/histedit-last-edit.txt in case
     # the user needs to ask for help after something
--- a/hgext/patchbomb.py	Thu Jan 19 23:01:32 2017 +0900
+++ b/hgext/patchbomb.py	Wed Jan 18 18:25:51 2017 -0800
@@ -271,7 +271,7 @@
     else:
         ui.write(_('\nWrite the introductory message for the '
                    'patch series.\n\n'))
-        body = ui.edit(defaultbody, sender, tmpdir=repo.path)
+        body = ui.edit(defaultbody, sender, repopath=repo.path)
         # Save series description in case sendmail fails
         msgfile = repo.vfs('last-email.txt', 'wb')
         msgfile.write(body)
--- a/mercurial/cmdutil.py	Thu Jan 19 23:01:32 2017 +0900
+++ b/mercurial/cmdutil.py	Wed Jan 18 18:25:51 2017 -0800
@@ -232,7 +232,7 @@
                              + fp.read())
                 reviewedpatch = ui.edit(patchtext, "",
                                         extra={"suffix": ".diff"},
-                                        tmpdir=repo.path)
+                                        repopath=repo.path)
                 fp.truncate(0)
                 fp.write(reviewedpatch)
                 fp.seek(0)
@@ -2782,7 +2782,7 @@
 
     editortext = repo.ui.edit(committext, ctx.user(), ctx.extra(),
                               editform=editform, pending=pending,
-                              tmpdir=repo.path)
+                              repopath=repo.path)
     text = editortext
 
     # strip away anything below this special string (used for editors that want
--- a/mercurial/ui.py	Thu Jan 19 23:01:32 2017 +0900
+++ b/mercurial/ui.py	Wed Jan 18 18:25:51 2017 -0800
@@ -1022,7 +1022,7 @@
             self.write(*msg, **opts)
 
     def edit(self, text, user, extra=None, editform=None, pending=None,
-             tmpdir=None):
+             repopath=None):
         extra_defaults = {
             'prefix': 'editor',
             'suffix': '.txt',
@@ -1031,12 +1031,12 @@
             extra_defaults.update(extra)
         extra = extra_defaults
 
-        tdir = None
+        rdir = None
         if self.configbool('experimental', 'editortmpinhg'):
-            tdir = tmpdir
+            rdir = repopath
         (fd, name) = tempfile.mkstemp(prefix='hg-' + extra['prefix'] + '-',
                                       suffix=extra['suffix'], text=True,
-                                      dir=tdir)
+                                      dir=rdir)
         try:
             f = os.fdopen(fd, "w")
             f.write(text)