[PATCH] ui: rename tmpdir parameter to more specific repopath

Augie Fackler raf at durin42.com
Wed Jan 18 23:10:54 EST 2017


queued, thanks
> On Jan 18, 2017, at 9:38 PM, Sean Farley <sean at farley.io> wrote:
> 
> # HG changeset patch
> # User Sean Farley <sean at farley.io>
> # Date 1484792751 28800
> #      Wed Jan 18 18:25:51 2017 -0800
> # Branch stable
> # Node ID 41d220e2bed95664c335f6a7ef70b8ce06dca86c
> # Parent  94af7d0c812fe7d3a5651191685ca43e1a331814
> ui: rename tmpdir parameter to more specific repopath
> 
> This was requested by Augie and I agree that repopath is more
> descriptive.
> 
> diff --git a/hgext/histedit.py b/hgext/histedit.py
> index ae860d8..3e11fff 100644
> --- a/hgext/histedit.py
> +++ b/hgext/histedit.py
> @@ -1333,11 +1333,11 @@ def ruleeditor(repo, ui, actions, editco
> 
>     rules = '\n'.join([act.torule() for act in actions])
>     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
>     # surprising happens.
>     f = open(repo.join('histedit-last-edit.txt'), 'w')
> diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
> index f7763eb..b6b827e 100644
> --- a/hgext/patchbomb.py
> +++ b/hgext/patchbomb.py
> @@ -269,11 +269,11 @@ def _getdescription(repo, defaultbody, s
>     if opts.get('desc'):
>         body = open(opts.get('desc')).read()
>     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)
>         msgfile.close()
>     return body
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> index 3e697e0..6f1c27a 100644
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -230,11 +230,11 @@ def dorecord(ui, repo, commitfunc, cmdsu
>                 patchtext = (crecordmod.diffhelptext
>                              + crecordmod.patchhelptext
>                              + fp.read())
>                 reviewedpatch = ui.edit(patchtext, "",
>                                         extra={"suffix": ".diff"},
> -                                        tmpdir=repo.path)
> +                                        repopath=repo.path)
>                 fp.truncate(0)
>                 fp.write(reviewedpatch)
>                 fp.seek(0)
> 
>             [os.unlink(repo.wjoin(c)) for c in newlyaddedandmodifiedfiles]
> @@ -2780,11 +2780,11 @@ def commitforceeditor(repo, ctx, subs, f
>     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,
> -                              tmpdir=repo.path)
> +                              repopath=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)
> diff --git a/mercurial/ui.py b/mercurial/ui.py
> index 6c7c67a..f65035a 100644
> --- a/mercurial/ui.py
> +++ b/mercurial/ui.py
> @@ -1020,25 +1020,25 @@ class ui(object):
>         if self.debugflag:
>             opts['label'] = opts.get('label', '') + ' ui.debug'
>             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',
>         }
>         if extra is not None:
>             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)
>             f.close()
> 
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list