def save_file_rev(self, menuitem): wfile = util.localpath(self.curfile) wfile, ext = os.path.splitext(os.path.basename(wfile)) if wfile: filename = "%s@%d%s" % (wfile, self.currev, ext) else: filename = "%s@%d" % (ext, self.currev) result = gtklib.NativeSaveFileDialogWrapper(title=_("Save file to"), initial=self.cwd, filename=filename).run() if not result: return try: q = Queue.Queue() hglib.hgcmd_toq(q, False, ('cat', '--rev', str(self.currev), '--output', hglib.fromutf(result), self.curfile)) except (util.Abort, IOError), e: gdialog.Prompt(_('Unable to save file'), str(e), self).run()
def threadfunc(q, *args): try: hglib.hgcmd_toq(q, False, args) except util.Abort, e: self._write(_('Abort: %s\n') % str(e))
def threadfunc(q, *args): try: hglib.hgcmd_toq(q, False, args) except (util.Abort, error.LookupError), e: self.stbar.set_text(_('Abort: %s') % str(e))