Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 20603:cc76c619bed6
ui: allow edit() to work with revision extras
Make edit() to accept optional 'extra' dictionary. Revision extras will be
used in upcoming patches to set some environment variables.
author | Alexander Drozdov <al.drozdov@gmail.com> |
---|---|
date | Thu, 06 Feb 2014 11:38:28 +0400 |
parents | b75a23eec9c9 |
children | a8aa699a812a |
comparison
equal
deleted
inserted
replaced
20602:8a2dfac89ad6 | 20603:cc76c619bed6 |
---|---|
712 This adds an output label of "ui.debug". | 712 This adds an output label of "ui.debug". |
713 ''' | 713 ''' |
714 if self.debugflag: | 714 if self.debugflag: |
715 opts['label'] = opts.get('label', '') + ' ui.debug' | 715 opts['label'] = opts.get('label', '') + ' ui.debug' |
716 self.write(*msg, **opts) | 716 self.write(*msg, **opts) |
717 def edit(self, text, user): | 717 def edit(self, text, user, extra={}): |
718 (fd, name) = tempfile.mkstemp(prefix="hg-editor-", suffix=".txt", | 718 (fd, name) = tempfile.mkstemp(prefix="hg-editor-", suffix=".txt", |
719 text=True) | 719 text=True) |
720 try: | 720 try: |
721 f = os.fdopen(fd, "w") | 721 f = os.fdopen(fd, "w") |
722 f.write(text) | 722 f.write(text) |