mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
ui: rename tmpdir parameter to more specific repopath
This was requested by Augie and I agree that repopath is more descriptive.
This commit is contained in:
parent
9979640f1d
commit
e145fc2df7
@ -1335,7 +1335,7 @@ def ruleeditor(repo, ui, actions, editcomment=""):
|
||||
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
|
||||
|
@ -271,7 +271,7 @@ def _getdescription(repo, defaultbody, sender, **opts):
|
||||
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)
|
||||
|
@ -232,7 +232,7 @@ def dorecord(ui, repo, commitfunc, cmdsuggest, backupall,
|
||||
+ 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 @@ def commitforceeditor(repo, ctx, subs, finishdesc=None, extramsg=None,
|
||||
|
||||
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
|
||||
|
@ -1022,7 +1022,7 @@ class ui(object):
|
||||
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 @@ class ui(object):
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user