Mercurial and Git clients can push and pull from this alias URL to interact with this repository. You can change to which repository an alias points by going to the Aliases link on the project page.
## Gtk UI class TortoiseHg## Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>#importsysimportgtkimportgobjectimportpangoimportQueuefrommercurialimportuifromthgutil.i18nimport_fromthgutilimporthglibfromthgutilimportshlibfromthgutilimportthread2importdialogimportgdialogclassGtkUi(ui.ui):''' PyGtk enabled mercurial.ui subclass. All this code will be running in a background thread, so it cannot directly call into Gtk. Instead, it places output and dialog requests onto queues for the main thread to pickup. '''def__init__(self,src=None,outputq=None,dialogq=None,responseq=None,parentui=None):ifparentui:# Mercurial 1.2super(GtkUi,self).__init__(parentui=parentui)src=parentuielse:# Mercurial 1.3super(GtkUi,self).__init__(src)ifsrc:self.outputq=src.outputqself.dialogq=src.dialogqself.responseq=src.responseqelse:self.outputq=outputqself.dialogq=dialogqself.responseq=responseqself.setconfig('ui','interactive','on')defwrite(self,*args):ifhglib.uiwrite(self,args):forainargs:self.outputq.put(str(a))defwrite_err(self,*args):forainargs:self.outputq.put('*** '+str(a))defflush(self):passdefprompt(self,msg,choices=None,default="y"):importreifnothglib.calliffunc(self.interactive):returndefaultifisinstance(choices,str):pat=choiceschoices=Noneelse:pat=NonewhileTrue:try:# send request to main thread, await responseself.dialogq.put((msg,True,choices,default))r=self.responseq.get(True)ifrisNone:raiseEOFErrorifnotr:returndefaultifnotpatorre.match(pat,r):returnrelse:self.write(_('unrecognized response\n'))exceptEOFError:raiseutil.Abort(_('response expected'))defgetpass(self,prompt=None,default=None):# send request to main thread, await responseself.dialogq.put((promptor_('password: '),False,None,default))r=self.responseq.get(True)ifrisNone:raiseutil.Abort(_('response expected'))returnrclassHgThread(thread2.Thread):''' Run an hg command in a background thread, implies output is being sent to a rendered text buffer interactively and requests for feedback from Mercurial can be handled by the user via dialog windows. '''def__init__(self,args=[],postfunc=None,parent=None):self.outputq=Queue.Queue()self.dialogq=Queue.Queue()self.responseq=Queue.Queue()self.ui=GtkUi(None,self.outputq,self.dialogq,self.responseq)self.args=argsself.ret=Noneself.postfunc=postfuncself.parent=parentthread2.Thread.__init__(self)defgetqueue(self):returnself.outputqdefreturn_code(self):''' None - command is incomplete, possibly exited with exception 0 - command returned successfully else an error was returned '''returnself.retdefprocess_dialogs(self):'''Polled every 10ms to serve dialogs for the background thread'''try:(prompt,visible,choices,default)=self.dialogq.get_nowait()ifchoices:dlg=gdialog.CustomPrompt('Hg Prompt',prompt,self.parent,choices,default)dlg.connect('response',self.prompt_response)dlg.show_all()else:dlg=dialog.entry_dialog(self.parent,prompt,visible,default,self.dialog_response)exceptQueue.Empty:passdefprompt_response(self,dialog,response_id):dialog.destroy()ifresponse_id==gtk.RESPONSE_DELETE_EVENT:raiseutil.Abort('No response')else:self.responseq.put(chr(response_id))defdialog_response(self,dialog,response_id):ifresponse_id==gtk.RESPONSE_OK:text=dialog.entry.get_text()else:text=Nonedialog.destroy()self.responseq.put(text)defrun(self):try:ret=Noneifhasattr(self.ui,'copy'):# Mercurial 1.3ret=hglib.dispatch._dispatch(self.ui,self.args)else:# Mercurial 1.2# Some commands create repositories, and thus must create# new ui() instances. For those, we monkey-patch ui.ui()# as briefly as possible.origui=Noneifself.args[0]in('clone','init'):origui=ui.uiui.ui=GtkUitry:ret=hglib.thgdispatch(self.ui,None,self.args)finally:iforigui:ui.ui=origuiifret:self.ui.write(_('[command returned code %d]\n')%int(ret))else:self.ui.write(_('[command completed successfully]\n')) self.ret = ret or 0
if self.postfunc:
self.postfunc(ret)
- except RepoError, e:
+ except hglib.RepoError, e:
self.ui.write_err(str(e))
except util.Abort, e:
self.ui.write_err(str(e))
excepturllib2.HTTPError,e:self.ui.write_err(str(e)+'\n')exceptException,e:self.ui.write_err(str(e))
Attach a Trello Card
Add a tag
Your session has expired
You are no longer logged in. Please log in and try your request again.
Filter RSS Feed
This RSS feed URL allows you to see the contents of your current filter using any feed reader.
This link includes a special authentication token. If you share the URL with anyone else, they can see this RSS feed's activity. You can disable these tokens when needed.
Your current filter is unsaved; changing it won't affect this RSS feed.