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.
# wctxactions.py - menu and responses for working copy files## Copyright 2010 Steve Borho <steve@borho.org>## This software may be used and distributed according to the terms of the# GNU General Public License version 2, incorporated herein by reference.frommercurialimportutil,cmdutil,error,merge,commandsfromtortoisehg.hgqtimportqtlib,htmluifromtortoisehg.utilimporthglib,shlibfromtortoisehg.util.i18nimport_fromPyQt4.QtCoreimportQt,SIGNALfromPyQt4.QtGuiimportQAction,QMenu,QMessageBoxdefwctxactions(parent,point,repo,selrows):ifnotselrows:returnalltypes=set()fort,pathinselrows:alltypes|=tdefmake(text,func,types,icon=None):files=[ffort,finselrowsift&types]ifnotfiles:returnNone action = menu.addAction(text)
if icon:
action.setIcon(icon)
- action.wrapper = lambda files=files: run(func, files, repo)
+ action.wrapper = lambda files=files: run(func, parent, files, repo)
parent.connect(action, SIGNAL('triggered()'), action.wrapper)
return action
menu=QMenu(parent)make(_('&Visual Diff'),vdiff,frozenset('MAR!'))make(_('Edit'),edit,frozenset('MACI?'))make(_('View missing'),viewmissing,frozenset('R!'))iflen(repo.parents())>1:make(_('View other'),other,frozenset('MA'))menu.addSeparator()make(_('&Revert'),revert,frozenset('MAR!'))menu.addSeparator()make(_('L&og'),log,frozenset('MARC!'))menu.addSeparator()make(_('&Forget'),forget,frozenset('MAC!'))make(_('&Add'),add,frozenset('I?'))make(_('&Guess Rename...'),guessRename,frozenset('?!'))make(_('&Ignore'),ignore,frozenset('?'))make(_('Remove versioned'),remove,frozenset('C'))make(_('&Delete unversioned'),delete,frozenset('?I'))iflen(selrows)==1:menu.addSeparator()make(_('&Copy...'),copy,frozenset('MC'))make(_('Rename...'),rename,frozenset('MC'))menu.addSeparator()make(_('Mark unresolved'),unmark,frozenset('r'))make(_('Mark resolved'),mark,frozenset('u'))f=make(_('Restart Merge...'),resolve,frozenset('u'))iff:files=[ffort,finselrowsif'u'int]rmenu=QMenu(_('Restart merge with'))fortoolinhglib.mergetools(repo.ui):action=rmenu.addAction(tool)action.wrapper=lambdatool=tool:resolve_with(tool,repo,files)parent.connect(action,SIGNAL('triggered()'),action.wrapper) menu.addMenu(rmenu)
return menu.exec_(point)
-def run(func, files, repo):
+def run(func, parent, files, repo):
'run wrapper for all action methods'
wfiles = [repo.wjoin(x) for x in files]
hu = htmlui.htmlui()
name=func.__name__.title()try:# All operations should quietly succeed. Any error should# result in a message box notify = func(hu, wfiles, repo)
o, e = hu.getdata()
if e:
- QMessageBox.warning(None, name + _(' reported errors'), str(e))
+ QMessageBox.warning(parent, name + _(' reported errors'), str(e))
elif o:
- QMessageBox.information(None, name + _(' reported errors'), str(o))
+ QMessageBox.information(parent, name + _(' reported errors'), str(o))
elif notify:
shlib.shell_notify(wfiles)
return notify
except (util.Abort, IOError, OSError), e:
- QMessageBox.critical(None, name + _(' Aborted'), str(e))
+ QMessageBox.critical(parent, name + _(' Aborted'), str(e))
except (error.LookupError), e:
- QMessageBox.critical(None, name + _(' Aborted'), str(e))
+ QMessageBox.critical(parent, name + _(' Aborted'), str(e))
return False
def filelist(files):
'utility function to present file list'text='\n'.join(files[:5])iflen(files)>5:text+=' ...\n'returnhglib.tounicode(text)defvdiff(ui,repo,files):raiseNotImplementedError()defedit(ui,repo,files):raiseNotImplementedError()defviewmissing(ui,repo,files):raiseNotImplementedError()defother(ui,repo,files):raiseNotImplementedError()defrevert(ui,repo,files):raiseNotImplementedError()# Needs workrevertopts={}iflen(repo.parents())>1:res=QMessageBox.Question(None,_('Uncommited merge - please select a parent revision'),_('Revert files to local or other parent?'),(_('&Local'),_('&Other'),_('&Cancel')),2).run()ifres==0:revertopts['rev']=repo[None].p1().rev()elifres==1:revertopts['rev']=repo[None].p2().rev()else:returnresponse=Noneelse:# response: 0=Yes, 1=Yes,no backup, 2=Cancelrevs=revertopts['rev']ifrevsandtype(revs)==list:revertopts['rev']=revs[0]else:revertopts['rev']=str(self.stat.repo['.'].rev())response=gdialog.CustomPrompt(_('Confirm Revert'),_('Revert files to revision %s?\n\n%s')%(revertopts['rev'],filelist(files)),self.stat,(_('&Yes (backup changes)'),_('Yes (&discard changes)'),_('&Cancel')),2,2).run()ifresponsein(None,0,1):ifresponse==1:revertopts['no_backup']=Truecommands.revert(ui,repo,*wfiles,**revertopts)returnTruedeflog(ui,repo,files):raiseNotImplementedError()defforget(ui,repo,files):commands.forget(ui,repo,*files)returnTruedefadd(ui,repo,files):raiseNotImplementedError()defguessRename(ui,repo,files):raiseNotImplementedError()defignore(ui,repo,files):raiseNotImplementedError()defremove(ui,repo,files):commands.remove(ui,repo,*files)returnTruedefdelete(ui,repo,files):raiseNotImplementedError()defcopy(ui,repo,files):raiseNotImplementedError()defrename(ui,repo,files):raiseNotImplementedError()defresolve(ui,repo,files):raiseNotImplementedError()defunmark(ui,repo,files):raiseNotImplementedError()defmark(ui,repo,files):raiseNotImplementedError()defresolve_with(tool,repo,files):raiseNotImplementedError()
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.