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.
# bookmark.py - Bookmark dialog for TortoiseHg## Copyright 2010 Michal De Wildt <michael.dewildt@gmail.com>## This software may be used and distributed according to the terms of the# GNU General Public License version 2, incorporated herein by reference.importosfromPyQt4.QtCoreimport*fromPyQt4.QtGuiimport*frommercurialimporterrorfromtortoisehg.utilimporthglib,i18nfromtortoisehg.hgqt.i18nimport_fromtortoisehg.hgqtimportqtlib,cmduikeep=i18n.keepgettext()classBookmarkDialog(QDialog):showMessage=pyqtSignal(QString)output=pyqtSignal(QString,QString)progress=pyqtSignal(QString,object,QString,QString,object)makeLogVisible=pyqtSignal(bool)def__init__(self,repo,rev,parent):super(BookmarkDialog,self).__init__(parent)self.setWindowFlags(self.windowFlags()& \
~Qt.WindowContextHelpButtonHint)self.repo=repoself.rev=revself.node=repo[rev].node()# base layout boxbase=QVBoxLayout()base.setSpacing(0)base.setContentsMargins(*(0,)*4)base.setSizeConstraint(QLayout.SetFixedSize)self.setLayout(base)box=QVBoxLayout()box.setSpacing(8)box.setContentsMargins(*(8,)*4)self.layout().addLayout(box)## main layout grid form = QFormLayout(fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow)
box.addLayout(form)
- form.addRow(_('Revision:'), QLabel(str(rev)))
+ form.addRow(_('Revision:'), QLabel('%d (%s)' % (rev, repo[rev])))
### bookmark combo
self.bookmarkCombo = QComboBox()
self.bookmarkCombo.setEditable(True)self.bookmarkCombo.currentIndexChanged.connect(self.bookmarkTextChanged)self.bookmarkCombo.editTextChanged.connect(self.bookmarkTextChanged)form.addRow(_('Bookmark:'),self.bookmarkCombo)### Rename inputself.newNameEdit=QLineEdit()self.newNameEdit.textEdited.connect(self.bookmarkTextChanged)form.addRow(_('New Name:'),self.newNameEdit)## bottom buttonsBB=QDialogButtonBoxbbox=QDialogButtonBox()self.addBtn=bbox.addButton(_('&Add'),BB.ActionRole)self.renameBtn=bbox.addButton(_('Re&name'),BB.ActionRole)self.removeBtn=bbox.addButton(_('&Remove'),BB.ActionRole)self.moveBtn=bbox.addButton(_('&Move'),BB.ActionRole)bbox.addButton(BB.Close)bbox.rejected.connect(self.reject)box.addWidget(bbox)self.addBtn.clicked.connect(self.add_bookmark)self.renameBtn.clicked.connect(self.rename_bookmark)self.removeBtn.clicked.connect(self.remove_bookmark)self.moveBtn.clicked.connect(self.move_bookmark)## horizontal separatorself.sep=QFrame()self.sep.setFrameShadow(QFrame.Sunken)self.sep.setFrameShape(QFrame.HLine)self.layout().addWidget(self.sep)## status lineself.status=qtlib.StatusLabel()self.status.setContentsMargins(4,2,4,4)self.layout().addWidget(self.status)# dialog settingself.setWindowTitle(_('Bookmark - %s')%self.repo.displayname)self.setWindowIcon(qtlib.geticon('hg-bookmarks'))self.cmd=cmdui.Runner(False,self)self.cmd.output.connect(self.output)self.cmd.makeLogVisible.connect(self.makeLogVisible)self.cmd.progress.connect(self.progress)self.cmd.commandFinished.connect(self.commandFinished)# prepare to showself.clear_status()self.refresh()self.repo.repositoryChanged.connect(self.refresh)self.bookmarkCombo.setFocus()self.bookmarkTextChanged()defrefresh(self):""" update display on dialog with recent repo data """# add bookmarks to drop-down listmarks=self.repo._bookmarks.keys()[:]marks.sort()marks.reverse()cur=self.bookmarkCombo.currentText()self.bookmarkCombo.clear()forbookmarkinmarks:self.bookmarkCombo.addItem(hglib.tounicode(bookmark))ifcur:self.bookmarkCombo.setEditText(cur)else:self.bookmarkTextChanged()@pyqtSlot()defbookmarkTextChanged(self):bookmark=self.bookmarkCombo.currentText()bookmarklocal=hglib.fromunicode(bookmark)ifbookmarklocalinself.repo._bookmarks:curnode=self.repo._bookmarks[bookmarklocal]self.addBtn.setEnabled(False)self.newNameEdit.setEnabled(True)self.removeBtn.setEnabled(True)self.renameBtn.setEnabled(bool(self.newNameEdit.text()))self.moveBtn.setEnabled(self.node!=curnode)else:self.addBtn.setEnabled(bool(bookmark))self.removeBtn.setEnabled(False)self.moveBtn.setEnabled(False)self.renameBtn.setEnabled(False)self.newNameEdit.setEnabled(False)defset_status(self,text,icon=None):self.status.setShown(True)self.sep.setShown(True)self.status.set_status(text,icon)self.showMessage.emit(text)defclear_status(self):self.status.setHidden(True)self.sep.setHidden(True)defcommandFinished(self,ret):ifretis0:self.bookmarkCombo.clearEditText()self.newNameEdit.setText('')self.finishfunc()defadd_bookmark(self):bookmark=self.bookmarkCombo.currentText()bookmarklocal=hglib.fromunicode(bookmark)ifbookmarklocalinself.repo._bookmarks:self.set_status(_('A bookmark named "%s" already exists')%bookmark,False)returndeffinished():self.set_status(_("Bookmark '%s' has been added")%bookmark,True)cmdline=['bookmark','--repository',self.repo.root,'--rev',str(self.rev),bookmarklocal]self.cmd.run(cmdline)self.finishfunc=finisheddefmove_bookmark(self):bookmark=self.bookmarkCombo.currentText()bookmarklocal=hglib.fromunicode(bookmark)ifbookmarklocalnotinself.repo._bookmarks:self.set_status(_('Bookmark named "%s" does not exist')%bookmark,False)returndeffinished():self.set_status(_("Bookmark '%s' has been moved")%bookmark,True)cmdline=['bookmark','--repository',self.repo.root,'--rev',str(self.rev),'--force',bookmarklocal]self.cmd.run(cmdline)self.finishfunc=finisheddefremove_bookmark(self):bookmark=self.bookmarkCombo.currentText()bookmarklocal=hglib.fromunicode(bookmark)ifbookmarklocalnotinself.repo._bookmarks:self.set_status(_("Bookmark '%s' does not exist")%bookmark,False)returndeffinished():self.set_status(_("Bookmark '%s' has been removed")%bookmark,True)cmdline=['bookmark','--repository',self.repo.root,'--delete',bookmarklocal]self.cmd.run(cmdline)self.finishfunc=finisheddefrename_bookmark(self):name=self.bookmarkCombo.currentText()namelocal=hglib.fromunicode(name)newname=self.newNameEdit.text()newnamelocal=hglib.fromunicode(newname)ifnamelocalnotinself.repo._bookmarks:self.set_status(_("Bookmark '%s' does not exist")%name,False)returnifnewnamelocalinself.repo._bookmarks:self.set_status(_('A bookmark named "%s" already exists')%newname,False)returndeffinished():self.set_status(_("Bookmark '%s' has been renamed to '%s'")%(name,newname),True)cmdline=['bookmark','--repository',self.repo.root,'--rename',namelocal,newnamelocal]self.cmd.run(cmdline)self.finishfunc=finished
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.