Exemple #1
0
 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()
Exemple #2
0
 def threadfunc(q, *args):
     try:
         hglib.hgcmd_toq(q, False, args)
     except util.Abort, e:
         self._write(_('Abort: %s\n') % str(e))
Exemple #3
0
 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))