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.
# mq.py - TortoiseHg MQ widget## Copyright 2011 Steve Borho <steve@borho.org>## This software may be used and distributed according to the terms of the# GNU General Public License version 2 or any later version.importosimportrefromPyQt4.QtCoreimport*fromPyQt4.QtGuiimport*frommercurialimporthg,ui,url,util,errorfrommercurialimportmergeasmergemodfromtortoisehg.utilimporthglib,patchctxfromtortoisehg.hgqt.i18nimport_fromtortoisehg.hgqtimportqtlib,cmdui,rejects,commit,shelveclassMQWidget(QWidget):showMessage=pyqtSignal(unicode)output=pyqtSignal(QString,QString)progress=pyqtSignal(QString,object,QString,QString,object)makeLogVisible=pyqtSignal(bool)def__init__(self,repo,parent,**opts):QWidget.__init__(self,parent)self.repo=repoself.opts=optsself.refreshing=Falselayout=QVBoxLayout()layout.setSpacing(0)self.setLayout(layout)# top toolbartbarhbox=QHBoxLayout()tbarhbox.setSpacing(5)self.layout().addLayout(tbarhbox,0)self.queueCombo=QComboBox()self.optionsBtn=QPushButton(_('Options'))self.msgHistoryCombo=QComboBox()tbarhbox.addWidget(self.queueCombo)tbarhbox.addWidget(self.optionsBtn)tbarhbox.addWidget(self.msgHistoryCombo,1)# main area consists of a three-way horizontal splittersplitter=QSplitter()self.layout().addWidget(splitter,1)splitter.setOrientation(Qt.Horizontal)splitter.setChildrenCollapsible(True)splitter.setObjectName('splitter')self.queueFrame=QFrame(splitter)self.fileListFrame=QFrame(splitter)self.messageFrame=QFrame(splitter)# Patch Queue Framelayout=QVBoxLayout()layout.setContentsMargins(0,0,0,0)self.queueFrame.setLayout(layout)qtbarhbox=QHBoxLayout()qtbarhbox.setSpacing(2)layout.addLayout(qtbarhbox,0)qtbarhbox.setContentsMargins(0,0,0,0)self.qpushAllBtn=QToolButton()self.qpushBtn=QToolButton()self.qpushMoveBtn=QToolButton()self.qdeleteBtn=QToolButton()self.qpopBtn=QToolButton()self.qpopAllBtn=QToolButton()qtbarhbox.addWidget(self.qpushAllBtn)qtbarhbox.addWidget(self.qpushBtn)qtbarhbox.addStretch(1)qtbarhbox.addWidget(self.qpushMoveBtn)qtbarhbox.addWidget(self.qdeleteBtn)qtbarhbox.addStretch(1)qtbarhbox.addWidget(self.qpopBtn)qtbarhbox.addWidget(self.qpopAllBtn)self.queueListWidget=QListWidget(self)layout.addWidget(self.queueListWidget,1)self.guardSelBtn=QPushButton(_('Guards: 0/0'))layout.addWidget(self.guardSelBtn,0)self.revisionOrCommitBtn=QPushButton(_('Revision Queue'))layout.addWidget(self.revisionOrCommitBtn,0)# File List Framelayout=QVBoxLayout()layout.setContentsMargins(0,0,0,0)self.fileListFrame.setLayout(layout)self.fileListWidget=QListWidget(self)layout.addWidget(self.fileListWidget,0)# Message Framelayout=QVBoxLayout()layout.setContentsMargins(0,0,0,0)self.messageFrame.setLayout(layout)mtbarhbox=QHBoxLayout()mtbarhbox.setSpacing(5)layout.addLayout(mtbarhbox,0)mtbarhbox.setContentsMargins(0,0,0,0)self.newCheckBox=QCheckBox(_('New Patch'))self.patchNameLE=QLineEdit()mtbarhbox.addWidget(self.newCheckBox)mtbarhbox.addWidget(self.patchNameLE,1)self.messageEditor=commit.MessageEntry(self)layout.addWidget(self.messageEditor,1)qrefhbox=QHBoxLayout()layout.addLayout(qrefhbox,0)qrefhbox.setContentsMargins(0,0,0,0)self.shelveBtn=QPushButton(_('Shelve'))self.qnewOrRefreshBtn=QPushButton(_('QRefresh'))qrefhbox.addStretch(1)qrefhbox.addWidget(self.shelveBtn)qrefhbox.addWidget(self.qnewOrRefreshBtn)self.cmd=cmdui.Runner(_('Patch Queue'),parent!=None,self)self.cmd.output.connect(self.output)self.cmd.makeLogVisible.connect(self.makeLogVisible) self.cmd.progress.connect(self.progress)
self.shelveBtn.pressed.connect(self.launchShelveTool)
+ self.optionsBtn.pressed.connect(self.launchOptionsDialog) self.repo.configChanged.connect(self.onConfigChanged)
self.repo.repositoryChanged.connect(self.onRepositoryChanged)
self.setAcceptDrops(True)ifhasattr(self.patchNameLE,'setPlaceholderText'):# Qt >= 4.7 self.patchNameLE.setPlaceholderText('### patch name ###')ifparent:layout.setContentsMargins(2,2,2,2)else:layout.setContentsMargins(0,0,0,0)self.setWindowTitle(_('TortoiseHg Patch Queue'))self.resize(850,550)defonConfigChanged(self):'Repository is reporting its config files have changed'self.reload()defonRepositoryChanged(self):'Repository is reporting its changelog has changed'self.reload()deflaunchShelveTool(self):dlg=shelve.ShelveDialog(self.repo,self)dlg.finished.connect(dlg.deleteLater) dlg.exec_()
self.reload()
+ def launchOptionsDialog(self):+ dlg = OptionsDialog(self)+ dlg.finished.connect(dlg.deleteLater)+ dlg.setWindowFlags(Qt.Sheet)+ dlg.setWindowModality(Qt.WindowModal)+ if dlg.exec_() == QDialog.Accepted:+ self.opts.update(dlg.outopts)+ def reload(self):
self.refreshing = True
# refresh self.queueCombo
# refresh self.msgHistoryCombo# set self.patchNameLE to qtip patch name# update enabled states of qtbarhbox buttons# refresh self.queueListWidget# refresh self.guardSelBtn# refresh self.revisionOrCommitBtn# refresh self.messageEditor with qtip description, if not in new mode# refresh self.qnewOrRefreshBtn# refresh self.fileListWidgetself.refreshing=Falsedefdetails(self):dlg=OptionsDialog(self)dlg.setWindowFlags(Qt.Sheet)dlg.setWindowModality(Qt.WindowModal)ifdlg.exec_()==QDialog.Accepted:self.opts.update(dlg.outopts)# Capture drop events, try to import into current patch queuedefdragEnterEvent(self,event):event.acceptProposedAction()defdragMoveEvent(self,event):event.acceptProposedAction()defdropEvent(self,event):paths=[unicode(u.toLocalFile())foruinevent.mimeData().urls()]filepaths=[pforpinpathsifos.path.isfile(p)]iffilepaths:event.setDropAction(Qt.CopyAction)event.accept()else:super(MQWidget,self).dropEvent(event)returndlg=thgimport.ImportDialog(repo=self.repo,parent=self)# TODO: send flag to dialog indicating this is a qimport (alias?)dlg.finished.connect(dlg.deleteLater)dlg.setfilepaths(filepaths)dlg.exec_()# End drop eventsdefcanExit(self):returnnotself.cmd.core.running()defkeyPressEvent(self,event):ifevent.matches(QKeySequence.Refresh):self.reload()elifevent.key()==Qt.Key_Escape:ifself.cmd.core.running():self.cmd.cancel()elifnotself.parent():self.close()else:returnsuper(MQWidget,self).keyPressEvent(event)classOptionsDialog(QDialog):'Utility dialog for configuring uncommon options'def__init__(self,parent): QDialog.__init__(self, parent)
self.setWindowTitle('MQ options')
- layout = QVBoxLayout()
+ layout = QFormLayout()
self.setLayout(layout)
self.gitcb = QCheckBox(_('Use git extended diff format'))
- self.gitcb.setChecked(parent.opts.get('git', False)) layout.addRow(self.gitcb, None)
self.forcecb = QCheckBox(_('Force push or pop'))
- self.forcecb.setChecked(parent.opts.get('force', False)) layout.addRow(self.forcecb, None)
self.exactcb = QCheckBox(_('Apply patch to its recorded parent'))
- self.exactcb.setChecked(parent.opts.get('exact', False)) layout.addRow(self.exactcb, None)
self.currentdatecb = QCheckBox(_('Update date field with current date'))
- self.currentdatecb.setChecked(parent.opts.get('currentdate', False)) layout.addRow(self.currentdatecb, None)
+ self.datele = QLineEdit()+ layout.addRow(QLabel(_('Specify an explicit date:')), self.datele)+ self.currentusercb = QCheckBox(_('Update author field with current user'))
+ layout.addRow(self.currentusercb, None)++ self.userle = QLineEdit()+ layout.addRow(QLabel(_('Specify an explicit author:')), self.userle)++ self.currentdatecb.toggled.connect(self.datele.setDisabled)+ self.currentusercb.toggled.connect(self.userle.setDisabled)++ self.gitcb.setChecked(parent.opts.get('git', False))+ self.forcecb.setChecked(parent.opts.get('force', False))+ self.exactcb.setChecked(parent.opts.get('exact', False))+ self.currentdatecb.setChecked(parent.opts.get('currentdate', False)) self.currentusercb.setChecked(parent.opts.get('currentuser', False))
-layout.addRow(self.currentusercb, None)
+ self.datele.setText(hglib.tounicode(parent.opts.get('date', '')))
+ self.userle.setText(hglib.tounicode(parent.opts.get('user', ''))) BB = QDialogButtonBox
bb = QDialogButtonBox(BB.Ok|BB.Cancel)
bb.accepted.connect(self.accept)
bb.rejected.connect(self.reject)
+ self.bb = bb layout.addWidget(bb)
def accept(self):
outopts={}outopts['git']=self.gitcb.isChecked()outopts['force']=self.forcecb.isChecked() outopts['exact'] = self.exactcb.isChecked()
outopts['currentdate'] = self.currentdatecb.isChecked()
outopts['currentuser'] = self.currentusercb.isChecked()
+ if self.currentdatecb.isChecked():+ outopts['date'] = ''+ else:+ outopts['date'] = hglib.fromunicode(self.datele.text())+ if self.currentusercb.isChecked():+ outopts['user'] = ''+ else:+ outopts['user'] = hglib.fromunicode(self.userle.text())+ self.outopts = outopts
QDialog.accept(self)
-def run(ui, *pats, **opts):
from tortoisehg.util import paths
from tortoisehg.hgqt import thgrepo
repo=thgrepo.repository(ui,path=paths.find_root())returnMQWidget(repo,None,**opts)
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.