equal
deleted
inserted
replaced
832 This adds an output label of "ui.debug". |
832 This adds an output label of "ui.debug". |
833 ''' |
833 ''' |
834 if self.debugflag: |
834 if self.debugflag: |
835 opts['label'] = opts.get('label', '') + ' ui.debug' |
835 opts['label'] = opts.get('label', '') + ' ui.debug' |
836 self.write(*msg, **opts) |
836 self.write(*msg, **opts) |
837 def edit(self, text, user, extra={}, editform=None): |
837 def edit(self, text, user, extra=None, editform=None): |
|
838 if extra is None: |
|
839 extra = {} |
838 (fd, name) = tempfile.mkstemp(prefix="hg-editor-", suffix=".txt", |
840 (fd, name) = tempfile.mkstemp(prefix="hg-editor-", suffix=".txt", |
839 text=True) |
841 text=True) |
840 try: |
842 try: |
841 f = os.fdopen(fd, "w") |
843 f = os.fdopen(fd, "w") |
842 f.write(text) |
844 f.write(text) |
864 finally: |
866 finally: |
865 os.unlink(name) |
867 os.unlink(name) |
866 |
868 |
867 return t |
869 return t |
868 |
870 |
869 def system(self, cmd, environ={}, cwd=None, onerr=None, errprefix=None): |
871 def system(self, cmd, environ=None, cwd=None, onerr=None, errprefix=None): |
870 '''execute shell command with appropriate output stream. command |
872 '''execute shell command with appropriate output stream. command |
871 output will be redirected if fout is not stdout. |
873 output will be redirected if fout is not stdout. |
872 ''' |
874 ''' |
873 out = self.fout |
875 out = self.fout |
874 if any(s[1] for s in self._bufferstates): |
876 if any(s[1] for s in self._bufferstates): |