def currentPage(self): engmsg = self.repo.ui.configbool("tortoisehg", "engmsg", False) wctx = self.repo[None] if wctx.p1().branch() == wctx.p2().branch(): msgset = i18n.keepgettext()._("Merge") text = engmsg and msgset["id"] or msgset["str"] text = unicode(text) else: msgset = i18n.keepgettext()._("Merge with %s") text = engmsg and msgset["id"] or msgset["str"] text = unicode(text) % hglib.tounicode(wctx.p2().branch()) self.msgEntry.setText(text) self.msgEntry.moveCursorToEnd()
def currentPage(self): engmsg = self.repo.ui.configbool('tortoisehg', 'engmsg', False) wctx = self.repo[None] if wctx.p1().branch() == wctx.p2().branch(): msgset = i18n.keepgettext()._('Merge') text = engmsg and msgset['id'] or msgset['str'] text = unicode(text) else: msgset = i18n.keepgettext()._('Merge with %s') text = engmsg and msgset['id'] or msgset['str'] text = unicode(text) % hglib.tounicode(wctx.p2().branch()) self.msgEntry.setText(text) self.msgEntry.moveCursorToEnd()
def currentPage(self): super(CommitPage, self).currentPage() self.wizard().setOption(QWizard.NoDefaultButton, True) self.mergeCsInfo.update() # show post-merge state engmsg = self.repo.ui.configbool('tortoisehg', 'engmsg', False) wctx = self.repo[None] if wctx.p1().branch() == wctx.p2().branch(): msgset = i18n.keepgettext()._('Merge') text = engmsg and msgset['id'] or msgset['str'] text = unicode(text) else: msgset = i18n.keepgettext()._('Merge with %s') text = engmsg and msgset['id'] or msgset['str'] text = unicode(text) % hglib.tounicode(wctx.p2().branch()) self.msgEntry.setText(text) self.msgEntry.moveCursorToEnd()
def eng_toggled(checked): if self.isComplete(): oldmsg = self.msgEntry.text() if self.wizard().backoutmergeparentrev: msgset = i18n.keepgettext()._( 'Backed out merge changeset: ') else: msgset = i18n.keepgettext()._('Backed out changeset: ') msg = checked and msgset['id'] or msgset['str'] if oldmsg and oldmsg != msg: if not qtlib.QuestionMsgBox(_('Confirm Discard Message'), _('Discard current backout message?'), parent=self): self.engChk.blockSignals(True) self.engChk.setChecked(not checked) self.engChk.blockSignals(False) return self.msgEntry.setText(msg + str(self.repo[self.wizard().backoutrev])) self.msgEntry.moveCursorToEnd()
def currentPage(self): engmsg = self.repo.ui.configbool('tortoisehg', 'engmsg', False) mergeparentrev = self.wizard().backoutmergeparentrev if mergeparentrev: msgset = i18n.keepgettext()._('Backed out merge changeset: ') else: msgset = i18n.keepgettext()._('Backed out changeset: ') msg = engmsg and msgset['id'] or msgset['str'] msg += str(self.repo[self.wizard().backoutrev]) if mergeparentrev: msg += '\n\n' bctx = self.repo[self.wizard().backoutrev] isp1 = (bctx.p1().rev() == mergeparentrev) if isp1: msg += _('Backed out merge revision ' 'to its first parent (%s)') % str(bctx.p1()) else: msg += _('Backed out merge revision ' 'to its second parent (%s)') % str(bctx.p2()) self.msgEntry.setText(msg) self.msgEntry.moveCursorToEnd()
def eng_toggled(checked): if self.isComplete(): oldmsg = self.msgEntry.text() if self.wizard().backoutmergeparentrev: msgset = i18n.keepgettext()._( 'Backed out merge changeset: ') else: msgset = i18n.keepgettext()._('Backed out changeset: ') msg = checked and msgset['id'] or msgset['str'] if oldmsg and oldmsg != msg: if not qtlib.QuestionMsgBox( _('Confirm Discard Message'), _('Discard current backout message?'), parent=self): self.engChk.blockSignals(True) self.engChk.setChecked(not checked) self.engChk.blockSignals(False) return self.msgEntry.setText(msg + str(self.repo[self.wizard().backoutrev])) self.msgEntry.moveCursorToEnd()
def currentPage(self): engmsg = self.repo.ui.configbool('tortoisehg', 'engmsg', False) mergeparentrev = self.wizard().backoutmergeparentrev if mergeparentrev: msgset = i18n.keepgettext()._( 'Backed out merge changeset: ') else: msgset = i18n.keepgettext()._('Backed out changeset: ') msg = engmsg and msgset['id'] or msgset['str'] msg += str(self.repo[self.wizard().backoutrev]) if mergeparentrev: msg += '\n\n' bctx = self.repo[self.wizard().backoutrev] isp1 = (bctx.p1().rev() == mergeparentrev) if isp1: msg += _('Backed out merge revision ' 'to its first parent (%s)') % str(bctx.p1()) else: msg += _('Backed out merge revision ' 'to its second parent (%s)') % str(bctx.p2()) self.msgEntry.setText(msg) self.msgEntry.moveCursorToEnd()
# tag.py - Tag dialog for TortoiseHg # # Copyright 2010 Yuki KODAMA <*****@*****.**> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2, incorporated herein by reference. from tortoisehg.util import hglib from tortoisehg.hgqt.i18n import _ from tortoisehg.hgqt import qtlib, cmdui, i18n from PyQt4.QtCore import * from PyQt4.QtGui import * keep = i18n.keepgettext() class TagDialog(QDialog): showMessage = pyqtSignal(QString) output = pyqtSignal(QString, QString) makeLogVisible = pyqtSignal(bool) def __init__(self, repoagent, tag="", rev="tip", parent=None, opts={}): super(TagDialog, self).__init__(parent) self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) self._repoagent = repoagent repo = repoagent.rawRepo() self.setWindowTitle(_("Tag - %s") % repo.displayname) self.setWindowIcon(qtlib.geticon("hg-tag"))
# tag.py - Tag dialog for TortoiseHg # # Copyright 2010 Yuki KODAMA <*****@*****.**> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2, incorporated herein by reference. from tortoisehg.util import hglib from tortoisehg.hgqt.i18n import _ from tortoisehg.hgqt import qtlib, cmdui, i18n from PyQt4.QtCore import * from PyQt4.QtGui import * keep = i18n.keepgettext() class TagDialog(QDialog): showMessage = pyqtSignal(QString) output = pyqtSignal(QString, QString) makeLogVisible = pyqtSignal(bool) def __init__(self, repo, tag='', rev='tip', parent=None, opts={}): super(TagDialog, self).__init__(parent) self.setWindowFlags(self.windowFlags() & \ ~Qt.WindowContextHelpButtonHint) self.repo = repo self.setWindowTitle(_('Tag - %s') % repo.displayname) self.setWindowIcon(qtlib.geticon('hg-tag'))