Mercurial > hg
comparison mercurial/ui.py @ 30848:7080652af6e6 stable
ui: rename tmpdir parameter to more specific repopath
This was requested by Augie and I agree that repopath is more
descriptive.
author | Sean Farley <sean@farley.io> |
---|---|
date | Wed, 18 Jan 2017 18:25:51 -0800 |
parents | bcad61a1f9a7 |
children | 82f1ef8b4477 4431add9aef9 |
comparison
equal
deleted
inserted
replaced
30847:e12553cfd0a4 | 30848:7080652af6e6 |
---|---|
1020 if self.debugflag: | 1020 if self.debugflag: |
1021 opts['label'] = opts.get('label', '') + ' ui.debug' | 1021 opts['label'] = opts.get('label', '') + ' ui.debug' |
1022 self.write(*msg, **opts) | 1022 self.write(*msg, **opts) |
1023 | 1023 |
1024 def edit(self, text, user, extra=None, editform=None, pending=None, | 1024 def edit(self, text, user, extra=None, editform=None, pending=None, |
1025 tmpdir=None): | 1025 repopath=None): |
1026 extra_defaults = { | 1026 extra_defaults = { |
1027 'prefix': 'editor', | 1027 'prefix': 'editor', |
1028 'suffix': '.txt', | 1028 'suffix': '.txt', |
1029 } | 1029 } |
1030 if extra is not None: | 1030 if extra is not None: |
1031 extra_defaults.update(extra) | 1031 extra_defaults.update(extra) |
1032 extra = extra_defaults | 1032 extra = extra_defaults |
1033 | 1033 |
1034 tdir = None | 1034 rdir = None |
1035 if self.configbool('experimental', 'editortmpinhg'): | 1035 if self.configbool('experimental', 'editortmpinhg'): |
1036 tdir = tmpdir | 1036 rdir = repopath |
1037 (fd, name) = tempfile.mkstemp(prefix='hg-' + extra['prefix'] + '-', | 1037 (fd, name) = tempfile.mkstemp(prefix='hg-' + extra['prefix'] + '-', |
1038 suffix=extra['suffix'], text=True, | 1038 suffix=extra['suffix'], text=True, |
1039 dir=tdir) | 1039 dir=rdir) |
1040 try: | 1040 try: |
1041 f = os.fdopen(fd, "w") | 1041 f = os.fdopen(fd, "w") |
1042 f.write(text) | 1042 f.write(text) |
1043 f.close() | 1043 f.close() |
1044 | 1044 |