by
Changes to 18 files · Browse files at 5a6f30401e32 Showing diff from parent 1943afdd5692 f0b9c6867bc8 Diff from another changeset...
@@ -57,3 +57,4 @@ 26a8187ef879c83c2055044fa2080a640145d542 2.0.4
f2165388e6870c643636a0a74f1ebd1d008bdf3e 2.0.5
2a970d5e40fe4f757347464d820218809d58251b 2.1
+65a385cf4238af969487dc1a7a2b5ee60cf388cc 2.1.1
|
|
|
@@ -8,15 +8,15 @@ "Project-Id-Version: tortoisehg\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-07-01 16:15-0300\n"
-"PO-Revision-Date: 2011-06-28 15:36+0000\n"
+"PO-Revision-Date: 2011-07-05 21:33+0000\n"
"Last-Translator: Karsten Tinnefeld <Unknown>\n"
"Language-Team: German <de@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Launchpad-Export-Date: 2011-07-01 19:36+0000\n"
-"X-Generator: Launchpad (build 13333)\n"
+"X-Launchpad-Export-Date: 2011-07-06 04:43+0000\n"
+"X-Generator: Launchpad (build 13168)\n"
#: TortoiseHgOverlayServer.py:51
msgid "TortoiseHg Overlay Icon Server"
@@ -1530,15 +1530,15 @@
#: tortoisehg/hgqt/filedialogs.py:210 tortoisehg/hgqt/filedialogs.py:686
msgid "View at revision..."
-msgstr ""
+msgstr "Anzeigen der Revision..."
#: tortoisehg/hgqt/filedialogs.py:213 tortoisehg/hgqt/filedialogs.py:689
msgid "Edit local"
-msgstr ""
+msgstr "Lokale Version bearbeiten"
#: tortoisehg/hgqt/filedialogs.py:216 tortoisehg/hgqt/filedialogs.py:692
msgid "Revert to revision..."
-msgstr ""
+msgstr "Zurückrollen zur Revision..."
#: tortoisehg/hgqt/filedialogs.py:363
msgid "File Differences Log Columns"
@@ -2476,7 +2476,7 @@#: tortoisehg/hgqt/mq.py:114
msgctxt "MQ QPush"
msgid "Push all"
-msgstr ""
+msgstr "Alle verteilen"
#: tortoisehg/hgqt/mq.py:115 tortoisehg/hgtk/thgmq.py:125
msgid "Apply all patches"
@@ -2485,7 +2485,7 @@#: tortoisehg/hgqt/mq.py:117
msgctxt "MQ QPush"
msgid "Push"
-msgstr ""
+msgstr "Verteilen"
#: tortoisehg/hgqt/mq.py:118
msgid "Apply one patch"
@@ -3238,7 +3238,7 @@
#: tortoisehg/hgqt/quickop.py:78 tortoisehg/hgtk/quickop.py:133
msgid "Do not save backup files (*.orig)"
-msgstr "Sicherheitskopien (*.orig) nicht speichern"
+msgstr "Sicherungskopien (*.orig) nicht speichern"
#: tortoisehg/hgqt/quickop.py:134 tortoisehg/hgtk/quickop.py:261
msgid "No files selected"
@@ -3537,7 +3537,7 @@
#: tortoisehg/hgqt/repofilter.py:209
msgid "Display only active branches"
-msgstr ""
+msgstr "Nur aktive Zweige anzeigen"
#: tortoisehg/hgqt/repofilter.py:212
msgid "Display closed branches"
@@ -5267,7 +5267,7 @@
#: tortoisehg/hgqt/run.py:1070 tortoisehg/hgqt/run.py:1101
msgid "discard uncommitted changes (no backup)"
-msgstr "Nicht übernommene Änderungen (ohne Kopie) verwerfen"
+msgstr "Nicht übernommene Änderungen (ungesichert) verwerfen"
#: tortoisehg/hgqt/run.py:1071
msgid "do not back up stripped revisions"
@@ -5413,7 +5413,7 @@
#: tortoisehg/hgqt/rupdate.py:61
msgid "Discard remote changes, no backup (-C/--clean)"
-msgstr ""
+msgstr "Entfernte Änderungen ungesichert verwerfen (-C/--clean)"
#: tortoisehg/hgqt/rupdate.py:63
msgid "Perform a push before updating (-p/--push)"
@@ -5652,13 +5652,15 @@
#: tortoisehg/hgqt/settings.py:413
msgid "Default widget"
-msgstr ""
+msgstr "Vorgabebereich"
#: tortoisehg/hgqt/settings.py:415
msgid ""
"Select the initial widget that will be shown when opening a repository. "
"Default: revdetails"
msgstr ""
+"Wählen SIe den Bereich, der standardmäßig beim Öffnen eines Projektarchivs "
+"angezeigt werden soll. Vorgabe: revdetails"
#: tortoisehg/hgqt/settings.py:420
msgid ""
@@ -5666,6 +5668,10 @@" You can select the \"current\" (i.e. the working directory parent), the "
"current \"tip\" or the working directory (\"workingdir\"). Default: current"
msgstr ""
+"Wählen Sie die Revision, die standardmäßig beim Öffnen eines Projektarchivs "
+"ausgewählt werden soll. Sie können die aktuelle wählen (current, bezeichnet "
+"den Vorgänger der Arbeitskopie), die Spitze des Archivs (tip) oder die "
+"Arbeitskopieversion (workingdir). Vorgabe: current"
#: tortoisehg/hgqt/settings.py:424 tortoisehg/hgtk/thgconfig.py:130
msgid "Author Coloring"
@@ -6674,8 +6680,7 @@
#: tortoisehg/hgqt/shelve.py:186
msgid "Backup copies of modified files can be found in .hg/Trashcan/"
-msgstr ""
-"Sicherheitskopien der geänderten Dateien finden sich in .hg/Trashcan/"
+msgstr "Sicherungskopien der geänderten Dateien finden sich in .hg/Trashcan/"
#: tortoisehg/hgqt/shelve.py:192
#, python-format
@@ -7784,7 +7789,7 @@
#: tortoisehg/hgqt/update.py:94 tortoisehg/hgtk/update.py:98
msgid "Discard local changes, no backup (-C/--clean)"
-msgstr "Lokale Änderungen ohne Sicherung abräumen (-C/--clean)"
+msgstr "Lokale Änderungen ungesichert abräumen (-C/--clean)"
#: tortoisehg/hgqt/update.py:96 tortoisehg/hgtk/update.py:104
msgid "Always merge (when possible)"
@@ -7821,7 +7826,7 @@
#: tortoisehg/hgqt/update.py:249 tortoisehg/hgtk/update.py:234
msgid "Discard - discard local changes, no backup"
-msgstr "Verwerfen - lokale Änderungen ungesichert vewerfen"
+msgstr "Verwerfen - lokale Änderungen ungesichert verwerfen"
#: tortoisehg/hgqt/update.py:250 tortoisehg/hgtk/update.py:235
msgid "&Shelve"
@@ -12745,15 +12750,15 @@#: tortoisehg/util/hgshelve.py:433
#, python-format
msgid "removing backup file : %r\n"
-msgstr "Entferne Sicherungsdatei: %r\n"
+msgstr "Entferne Sicherungskopie: %r\n"
#: tortoisehg/util/hgshelve.py:437
msgid "delete of shelve backup failed"
-msgstr "Entfernen des Stauraum-Kopie gescheitert"
+msgstr "Entfernen des Stauraum-Sicherung gescheitert"
#: tortoisehg/util/hgshelve.py:440
msgid "bad shelve backup directory name"
-msgstr "Name des Stauraum-Sicherungsverzeichnis ungeeignet"
+msgstr "Verzeichnisname für die Stauraum-Sicherung ungeeignet"
#: tortoisehg/util/hgshelve.py:470
msgid "shelve can only be run interactively"
@@ -12795,7 +12800,7 @@
#: tortoisehg/util/hgshelve.py:593
msgid "unshelve backup aborted\n"
-msgstr "Kopieren des Stauraums abgebrochen\n"
+msgstr "Sicherung des Stauraums abgebrochen\n"
#: tortoisehg/util/hgshelve.py:597
msgid "applying shelved patch\n"
@@ -12803,7 +12808,7 @@
#: tortoisehg/util/hgshelve.py:610
msgid "restoring backup files\n"
-msgstr "Sicherungskopien widerherstellen\n"
+msgstr "stelle Dateien aus der Sicherung wieder her\n"
#: tortoisehg/util/hgshelve.py:619
msgid "removing shelved patches\n"
|
@@ -8,15 +8,15 @@ "Project-Id-Version: tortoisehg\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-07-01 16:15-0300\n"
-"PO-Revision-Date: 2011-03-01 23:06+0000\n"
-"Last-Translator: Tim <Unknown>\n"
+"PO-Revision-Date: 2011-07-04 19:24+0000\n"
+"Last-Translator: Tonnis Oosterhoff <Unknown>\n"
"Language-Team: Dutch <nl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Launchpad-Export-Date: 2011-07-01 19:37+0000\n"
-"X-Generator: Launchpad (build 13333)\n"
+"X-Launchpad-Export-Date: 2011-07-05 04:35+0000\n"
+"X-Generator: Launchpad (build 13168)\n"
#: TortoiseHgOverlayServer.py:51
msgid "TortoiseHg Overlay Icon Server"
@@ -194,7 +194,7 @@
#: tortoisehg/hgqt/archive.py:238 tortoisehg/hgqt/archive.py:241
msgid "Zip archives"
-msgstr ""
+msgstr "Zip archieven"
#: tortoisehg/hgqt/archive.py:316 tortoisehg/hgqt/archive.py:334
msgid "Duplicate Name"
@@ -370,7 +370,7 @@
#: tortoisehg/hgqt/backout.py:412 tortoisehg/hgqt/merge.py:489
msgid "Working Directory (merged)"
-msgstr ""
+msgstr "Werkmap (samengevoegd)"
#: tortoisehg/hgqt/backout.py:420 tortoisehg/hgqt/merge.py:497
msgid "Commit message"
|
@@ -77,6 +77,8 @@ mystderr = cStringIO.StringIO()
origstderr = sys.stderr
sys.stderr = mystderr
+ sys.__stdout__ = sys.stdout
+ sys.__stderr__ = sys.stderr
ret = 0
try:
ret = tortoisehg.hgqt.run.dispatch(sys.argv[1:])
|
|
|
@@ -141,7 +141,7 @@ self.rev_combo.setMaxVisibleItems(self.rev_combo.count())
self.rev_combo.setCurrentIndex(0)
self.subrepos_chk.setChecked(self.get_subrepos_present())
- self.dest_edit.setText(self.repo.root)
+ self.dest_edit.setText(hglib.tounicode(self.repo.root))
self.filesradio.setChecked(True)
self.update_path()
@@ -163,6 +163,7 @@ self.arch_btn.clicked.connect(self.archive)
self.detail_btn.clicked.connect(self.detail_clicked)
self.close_btn.clicked.connect(self.close)
+ self.cancel_btn.clicked.connect(self.cancel_clicked)
# dialog setting
self.setWindowTitle(_('Archive - %s') % self.repo.displayname)
@@ -184,23 +185,21 @@
def browse_clicked(self):
"""Select the destination directory or file"""
- dest = hglib.fromunicode(self.dest_edit.text())
+ dest = unicode(self.dest_edit.text())
if not os.path.exists(dest):
dest = os.path.dirname(dest)
select = self.get_selected_archive_type()
FD = QFileDialog
if select['type'] == 'files':
caption = _('Select Destination Folder')
- path = FD.getExistingDirectory(parent=self, caption=caption,
+ response = FD.getExistingDirectory(parent=self, caption=caption,
directory=dest, options=FD.ShowDirsOnly | FD.ReadOnly)
- response = str(path)
else:
caption = _('Open File')
ext = '*' + select['ext']
filter = '%s (%s)\nAll Files (*.*)' % (select['label'], ext)
- filename = FD.getOpenFileName(parent=self, caption=caption,
- directory=dest, filter=filter, options=FD.ReadOnly );
- response = str(filename)
+ response = FD.getOpenFileName(parent=self, caption=caption,
+ directory=dest, filter=filter, options=FD.ReadOnly)
if response:
self.dest_edit.setText(response)
self.update_path()
@@ -250,7 +249,7 @@ def remove_rev(path):
l = ''
for i in xrange(self.rev_combo.count() - 1):
- l += hglib.fromunicode(self.rev_combo.itemText(i))
+ l += unicode(self.rev_combo.itemText(i))
revs = [rev[0] for rev in l]
revs.append(wdrev)
if not self.prevtarget is None:
@@ -266,7 +265,7 @@ if select['type'] != 'files':
path += select['ext']
return path
- text = self.rev_combo.currentText()
+ text = unicode(self.rev_combo.currentText())
if len(text) == 0:
return
wdrev = str(self.repo['.'].rev())
@@ -277,15 +276,15 @@ self.repo[hglib.fromunicode(text)]
except (error.RepoError, error.LookupError):
return
- path = hglib.fromunicode(self.dest_edit.text())
+ path = unicode(self.dest_edit.text())
path = remove_ext(path)
path = remove_rev(path)
- path = add_rev(path, hglib.fromunicode(text))
+ path = add_rev(path, text)
path = add_ext(path)
self.dest_edit.setText(path)
self.prevtarget = text
type = self.get_selected_archive_type()['type']
- self.compose_command(path, type)
+ self.compose_command(hglib.fromunicode(path), type)
def compose_command(self, dest, type):
cmdline = ['archive', '--repository', self.repo.root]
@@ -302,20 +301,20 @@ cmdline.append('-I')
cmdline.append(f)
cmdline.append('--')
- cmdline.append(hglib.fromunicode(dest))
- self.hgcmd_txt.setText('hg ' + ' '.join(cmdline))
+ cmdline.append(dest) # dest: local str
+ self.hgcmd_txt.setText(hglib.tounicode('hg ' + ' '.join(cmdline)))
return cmdline
def archive(self):
# verify input
type = self.get_selected_archive_type()['type']
- dest = self.dest_edit.text()
+ dest = unicode(self.dest_edit.text())
if os.path.exists(dest):
if type == 'files':
if os.path.isfile(dest):
qtlib.WarningMsgBox(_('Duplicate Name'),
_('The destination "%s" already exists as '
- 'a file!' % dest))
+ 'a file!') % dest)
return False
elif os.listdir(dest):
if not qtlib.QuestionMsgBox(_('Confirm Overwrite'),
@@ -333,11 +332,11 @@ else:
qtlib.WarningMsgBox(_('Duplicate Name'),
_('The destination "%s" already exists as '
- 'a folder!' % dest))
+ 'a folder!') % dest)
return False
# prepare command line
- cmdline = self.compose_command(dest, type)
+ cmdline = self.compose_command(hglib.fromunicode(dest), type)
if self.files_in_rev_chk.isChecked():
self.savedcwd = os.getcwd()
@@ -352,7 +351,7 @@ else:
self.cmd.setShowOutput(True)
- def cancel_clicked():
+ def cancel_clicked(self):
self.cmd.cancel()
def command_started(self):
|
@@ -10,7 +10,7 @@ from tortoisehg.util import hglib
from tortoisehg.hgqt.i18n import _
from tortoisehg.hgqt import qtlib, csinfo, i18n, cmdui, status, resolve
-from tortoisehg.hgqt import commit, qscilib, thgrepo
+from tortoisehg.hgqt import qscilib, thgrepo, messageentry
from PyQt4.QtCore import *
from PyQt4.QtGui import *
@@ -232,6 +232,7 @@ cmd = hglib.fromunicode(cmd)
repo = self.repo
if cmd == 'commit':
+ from tortoisehg.hgqt import commit
dlg = commit.CommitDialog(repo, [], {}, self.wizard())
dlg.finished.connect(dlg.deleteLater)
dlg.exec_()
@@ -419,7 +420,7 @@ # commit message area
msg_sep = qtlib.LabeledSeparator(_('Commit message'))
self.layout().addWidget(msg_sep)
- msgEntry = commit.MessageEntry(self)
+ msgEntry = messageentry.MessageEntry(self)
msgEntry.installEventFilter(qscilib.KeyPressInterceptor(self))
msgEntry.refresh(repo)
msgEntry.loadSettings(QSettings(), 'backout/message')
|
|
@@ -9,14 +9,17 @@
from mercurial import ui, util, error
+from tortoisehg.util import hglib, shlib, wconfig, bugtraq
+
+from tortoisehg.hgqt.i18n import _
+from tortoisehg.hgqt.messageentry import MessageEntry
+from tortoisehg.hgqt import qtlib, qscilib, status, cmdui, branchop, revpanel
+from tortoisehg.hgqt import hgrcutil, mq
+
from PyQt4.QtCore import *
from PyQt4.QtGui import *
-from PyQt4.Qsci import QsciScintilla, QsciAPIs, QsciLexerMakefile
+from PyQt4.Qsci import QsciAPIs
-from tortoisehg.hgqt.i18n import _
-from tortoisehg.util import hglib, shlib, wconfig, bugtraq
-from tortoisehg.hgqt import qtlib, qscilib, status, cmdui, branchop, revpanel
-from tortoisehg.hgqt import hgrcutil, mq
# Technical Debt for CommitWidget
# disable commit button while no message is entered or no files are selected
@@ -24,136 +27,6 @@# spell check / tab completion
# in-memory patching / committing chunk selected files
-class MessageEntry(qscilib.Scintilla):
-
- def __init__(self, parent, getCheckedFunc=None):
- super(MessageEntry, self).__init__(parent)
- self.setEdgeColor(QColor('LightSalmon'))
- self.setEdgeMode(QsciScintilla.EdgeLine)
- self.setReadOnly(False)
- self.setMarginWidth(1, 0)
- self.setFont(qtlib.getfont('fontcomment').font())
- self.setCaretWidth(10)
- self.setCaretLineBackgroundColor(QColor("#e6fff0"))
- self.setCaretLineVisible(True)
- self.setAutoIndent(True)
- self.setAutoCompletionThreshold(2)
- self.setAutoCompletionSource(QsciScintilla.AcsAPIs)
- self.setAutoCompletionFillupsEnabled(True)
- self.setLexer(QsciLexerMakefile(self))
- self.lexer().setFont(qtlib.getfont('fontcomment').font())
- self.lexer().setColor(QColor(Qt.red), QsciLexerMakefile.Error)
- self.setMatchedBraceBackgroundColor(Qt.yellow)
- self.setIndentationsUseTabs(False)
- self.setBraceMatching(QsciScintilla.SloppyBraceMatch)
- #self.setIndentationGuidesBackgroundColor(QColor("#e6e6de"))
- #self.setFolding(QsciScintilla.BoxedFoldStyle)
- # http://www.riverbankcomputing.com/pipermail/qscintilla/2009-February/000461.html
- self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
- self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
- # default message entry widgets to word wrap, user may override
- self.setWrapMode(QsciScintilla.WrapWord)
-
- self.getChecked = getCheckedFunc
- self.setContextMenuPolicy(Qt.CustomContextMenu)
- self.customContextMenuRequested.connect(self.menuRequested)
-
- def menuRequested(self, point):
- line = self.lineAt(point)
- point = self.viewport().mapToGlobal(point)
-
- def apply():
- line = 0
- while True:
- line = self.reflowBlock(line)
- if line is None:
- break;
- def paste():
- files = self.getChecked()
- self.insert(', '.join(files))
- def settings():
- from tortoisehg.hgqt.settings import SettingsDialog
- dlg = SettingsDialog(True, focus='tortoisehg.summarylen')
- dlg.exec_()
-
- menu = self.createStandardContextMenu()
- menu.addSeparator()
- if self.getChecked:
- action = menu.addAction(_('Paste &Filenames'))
- action.triggered.connect(paste)
- for name, func in [(_('App&ly Format'), apply),
- (_('C&onfigure Format'), settings)]:
- def add(name, func):
- action = menu.addAction(name)
- action.triggered.connect(func)
- add(name, func)
- return menu.exec_(point)
-
- def refresh(self, repo):
- self.setEdgeColumn(repo.summarylen)
- self.setIndentationWidth(repo.tabwidth)
- self.setTabWidth(repo.tabwidth)
- self.summarylen = repo.summarylen
-
- def reflowBlock(self, line):
- lines = self.text().split('\n', QString.KeepEmptyParts)
- if line >= len(lines):
- return None
- if not len(lines[line]) > 1:
- return line+1
-
- # find boundaries (empty lines or bounds)
- b = line
- while b and len(lines[b-1]) > 1:
- b = b - 1
- e = line
- while e+1 < len(lines) and len(lines[e+1]) > 1:
- e = e + 1
- group = QStringList([lines[l].simplified() for l in xrange(b, e+1)])
- sentence = group.join(' ')
- parts = sentence.split(' ', QString.SkipEmptyParts)
-
- outlines = QStringList()
- line = QStringList()
- partslen = 0
- for part in parts:
- if partslen + len(line) + len(part) + 1 > self.summarylen:
- if line:
- outlines.append(line.join(' '))
- line, partslen = QStringList(), 0
- line.append(part)
- partslen += len(part)
- if line:
- outlines.append(line.join(' '))
-
- self.beginUndoAction()
- self.setSelection(b, 0, e+1, 0)
- self.removeSelectedText()
- self.insertAt(outlines.join('\n')+'\n', b, 0)
- self.endUndoAction()
- self.setCursorPosition(b, 0)
- return b + len(outlines) + 1
-
- def moveCursorToEnd(self):
- lines = self.lines()
- if lines:
- lines -= 1
- pos = self.lineLength(lines)
- self.setCursorPosition(lines, pos)
- self.ensureLineVisible(lines)
- self.horizontalScrollBar().setSliderPosition(0)
-
- def keyPressEvent(self, event):
- if event.modifiers() == Qt.ControlModifier and event.key() == Qt.Key_E:
- line, col = self.getCursorPosition()
- self.reflowBlock(line)
- elif event.key() == Qt.Key_Backtab:
- event.accept()
- newev = QKeyEvent(event.type(), Qt.Key_Tab, Qt.ShiftModifier)
- super(MessageEntry, self).keyPressEvent(newev)
- else:
- super(MessageEntry, self).keyPressEvent(event)
-
class CommitWidget(QWidget, qtlib.TaskWidget):
'A widget that encompasses a StatusWidget and commit extras'
commitButtonEnable = pyqtSignal(bool)
|
@@ -29,7 +29,7 @@ class HgFileView(QFrame):
"file diff, content, and annotation viewer"
- diffHeaderRegExp = re.compile("^@@ -[0-9]+,[0-9]+ \+[0-9]+,[0-9]+ @@$")
+ diffHeaderRegExp = re.compile("^@@ -[0-9]+,[0-9]+ \+[0-9]+,[0-9]+ @@")
linkActivated = pyqtSignal(QString)
fileDisplayed = pyqtSignal(QString, QString)
|
@@ -10,8 +10,8 @@
from tortoisehg.util import hglib
from tortoisehg.hgqt.i18n import _
-from tortoisehg.hgqt import qtlib, csinfo, i18n, cmdui, status, commit, resolve
-from tortoisehg.hgqt import qscilib, thgrepo
+from tortoisehg.hgqt import qtlib, csinfo, i18n, cmdui, status, resolve
+from tortoisehg.hgqt import qscilib, thgrepo, messageentry
from PyQt4.QtCore import *
from PyQt4.QtGui import *
@@ -295,6 +295,7 @@ cmd = hglib.fromunicode(cmd)
repo = self.repo
if cmd == 'commit':
+ from tortoisehg.hgqt import commit
dlg = commit.CommitDialog(repo, [], {}, self)
dlg.finished.connect(dlg.deleteLater)
dlg.exec_()
@@ -496,7 +497,7 @@ # commit message area
msg_sep = qtlib.LabeledSeparator(_('Commit message'))
self.layout().addWidget(msg_sep)
- msgEntry = commit.MessageEntry(self)
+ msgEntry = messageentry.MessageEntry(self)
msgEntry.installEventFilter(qscilib.KeyPressInterceptor(self))
msgEntry.refresh(repo)
msgEntry.loadSettings(QSettings(), 'merge/message')
|
|
|
@@ -0,0 +1,145 @@ + # messageentry.py - TortoiseHg's commit message editng 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, incorporated herein by reference.
+
+import os
+
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+from PyQt4.Qsci import QsciScintilla, QsciLexerMakefile
+
+from tortoisehg.hgqt.i18n import _
+from tortoisehg.hgqt import qtlib, qscilib
+
+class MessageEntry(qscilib.Scintilla):
+
+ def __init__(self, parent, getCheckedFunc=None):
+ super(MessageEntry, self).__init__(parent)
+ self.setEdgeColor(QColor('LightSalmon'))
+ self.setEdgeMode(QsciScintilla.EdgeLine)
+ self.setReadOnly(False)
+ self.setMarginWidth(1, 0)
+ self.setFont(qtlib.getfont('fontcomment').font())
+ self.setCaretWidth(10)
+ self.setCaretLineBackgroundColor(QColor("#e6fff0"))
+ self.setCaretLineVisible(True)
+ self.setAutoIndent(True)
+ self.setAutoCompletionThreshold(2)
+ self.setAutoCompletionSource(QsciScintilla.AcsAPIs)
+ self.setAutoCompletionFillupsEnabled(True)
+ self.setLexer(QsciLexerMakefile(self))
+ self.lexer().setFont(qtlib.getfont('fontcomment').font())
+ self.lexer().setColor(QColor(Qt.red), QsciLexerMakefile.Error)
+ self.setMatchedBraceBackgroundColor(Qt.yellow)
+ self.setIndentationsUseTabs(False)
+ self.setBraceMatching(QsciScintilla.SloppyBraceMatch)
+ #self.setIndentationGuidesBackgroundColor(QColor("#e6e6de"))
+ #self.setFolding(QsciScintilla.BoxedFoldStyle)
+ # http://www.riverbankcomputing.com/pipermail/qscintilla/2009-February/000461.html
+ self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
+ self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
+ # default message entry widgets to word wrap, user may override
+ self.setWrapMode(QsciScintilla.WrapWord)
+
+ self.getChecked = getCheckedFunc
+ self.setContextMenuPolicy(Qt.CustomContextMenu)
+ self.customContextMenuRequested.connect(self.menuRequested)
+
+ def menuRequested(self, point):
+ line = self.lineAt(point)
+ point = self.viewport().mapToGlobal(point)
+
+ def apply():
+ line = 0
+ while True:
+ line = self.reflowBlock(line)
+ if line is None:
+ break;
+ def paste():
+ files = self.getChecked()
+ self.insert(', '.join(files))
+ def settings():
+ from tortoisehg.hgqt.settings import SettingsDialog
+ dlg = SettingsDialog(True, focus='tortoisehg.summarylen')
+ dlg.exec_()
+
+ menu = self.createStandardContextMenu()
+ menu.addSeparator()
+ if self.getChecked:
+ action = menu.addAction(_('Paste &Filenames'))
+ action.triggered.connect(paste)
+ for name, func in [(_('App&ly Format'), apply),
+ (_('C&onfigure Format'), settings)]:
+ def add(name, func):
+ action = menu.addAction(name)
+ action.triggered.connect(func)
+ add(name, func)
+ return menu.exec_(point)
+
+ def refresh(self, repo):
+ self.setEdgeColumn(repo.summarylen)
+ self.setIndentationWidth(repo.tabwidth)
+ self.setTabWidth(repo.tabwidth)
+ self.summarylen = repo.summarylen
+
+ def reflowBlock(self, line):
+ lines = self.text().split('\n', QString.KeepEmptyParts)
+ if line >= len(lines):
+ return None
+ if not len(lines[line]) > 1:
+ return line+1
+
+ # find boundaries (empty lines or bounds)
+ b = line
+ while b and len(lines[b-1]) > 1:
+ b = b - 1
+ e = line
+ while e+1 < len(lines) and len(lines[e+1]) > 1:
+ e = e + 1
+ group = QStringList([lines[l].simplified() for l in xrange(b, e+1)])
+ sentence = group.join(' ')
+ parts = sentence.split(' ', QString.SkipEmptyParts)
+
+ outlines = QStringList()
+ line = QStringList()
+ partslen = 0
+ for part in parts:
+ if partslen + len(line) + len(part) + 1 > self.summarylen:
+ if line:
+ outlines.append(line.join(' '))
+ line, partslen = QStringList(), 0
+ line.append(part)
+ partslen += len(part)
+ if line:
+ outlines.append(line.join(' '))
+
+ self.beginUndoAction()
+ self.setSelection(b, 0, e+1, 0)
+ self.removeSelectedText()
+ self.insertAt(outlines.join('\n')+'\n', b, 0)
+ self.endUndoAction()
+ self.setCursorPosition(b, 0)
+ return b + len(outlines) + 1
+
+ def moveCursorToEnd(self):
+ lines = self.lines()
+ if lines:
+ lines -= 1
+ pos = self.lineLength(lines)
+ self.setCursorPosition(lines, pos)
+ self.ensureLineVisible(lines)
+ self.horizontalScrollBar().setSliderPosition(0)
+
+ def keyPressEvent(self, event):
+ if event.modifiers() == Qt.ControlModifier and event.key() == Qt.Key_E:
+ line, col = self.getCursorPosition()
+ self.reflowBlock(line)
+ elif event.key() == Qt.Key_Backtab:
+ event.accept()
+ newev = QKeyEvent(event.type(), Qt.Key_Tab, Qt.ShiftModifier)
+ super(MessageEntry, self).keyPressEvent(newev)
+ else:
+ super(MessageEntry, self).keyPressEvent(event)
|
@@ -18,8 +18,8 @@
from tortoisehg.util import hglib, patchctx
from tortoisehg.hgqt.i18n import _
-from tortoisehg.hgqt import qtlib, cmdui, rejects, commit, qscilib, thgrepo
-from tortoisehg.hgqt import qqueue, qreorder, fileview, thgimport, status
+from tortoisehg.hgqt import qtlib, cmdui, rejects, qscilib, thgrepo, status
+from tortoisehg.hgqt import qqueue, qreorder, fileview, thgimport, messageentry
from tortoisehg.hgqt.qtlib import geticon
# TODO
@@ -654,7 +654,7 @@ mtbarhbox.addWidget(self.newCheckBox)
mtbarhbox.addWidget(self.patchNameLE, 1)
- self.messageEditor = commit.MessageEntry(self)
+ self.messageEditor = messageentry.MessageEntry(self)
self.messageEditor.installEventFilter(qscilib.KeyPressInterceptor(self))
self.messageEditor.refresh(repo)
@@ -856,6 +856,7 @@ @pyqtSlot()
def qinitOrCommit(self):
if os.path.isdir(self.repo.mq.join('.hg')):
+ from tortoisehg.hgqt import commit
mqrepo = thgrepo.repository(None, self.repo.mq.path)
dlg = commit.CommitDialog(mqrepo, [], {}, self)
dlg.finished.connect(dlg.deleteLater)
|
@@ -16,8 +16,7 @@
from tortoisehg.util import hglib
from tortoisehg.hgqt.i18n import _
-from tortoisehg.hgqt import cmdui, qscilib, qtlib
-from tortoisehg.hgqt.commit import MessageEntry
+from tortoisehg.hgqt import cmdui, qscilib, qtlib, messageentry
class QFoldDialog(QDialog):
@@ -36,7 +35,7 @@
mlbl = QLabel(_('New patch message:'))
self.layout().addWidget(mlbl)
- self.msgte = MessageEntry(self)
+ self.msgte = messageentry.MessageEntry(self)
self.msgte.installEventFilter(qscilib.KeyPressInterceptor(self))
self.layout().addWidget(self.msgte)
|
@@ -645,10 +645,10 @@ effects = qtlib.geteffect(style)
text = qtlib.applyeffects(' %s ' % len(files), effects)
changes.append(text)
+ if A:
+ addtotal(A, 'log.added')
if M:
addtotal(M, 'log.modified')
- if A:
- addtotal(A, 'log.added')
if R:
addtotal(R, 'log.removed')
return ''.join(changes)
|
@@ -309,6 +309,7 @@ _('An error occurred while updating the repository hgrc '
'file (%s)' % abshgrcpath))
return False
+ self.setShortName(shortname)
return True
return False
@@ -407,9 +408,11 @@ self.name = value.toString()
return True
return False
+
def menulist(self):
return ['openAll', 'add', None, 'newGroup', None, 'rename', 'remove',
None, 'reloadRegistry']
+
def flags(self):
return (Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsDropEnabled
| Qt.ItemIsDragEnabled | Qt.ItemIsEditable)
@@ -483,9 +486,11 @@class AllRepoGroupItem(RepoGroupItem):
def __init__(self, parent=None):
RepoGroupItem.__init__(self, name=_('default'), parent=parent)
+
def menulist(self):
return ['openAll', 'add', None, 'newGroup', None, 'rename',
None, 'reloadRegistry']
+
def undump(self, xr):
a = xr.attributes()
name = a.value('', 'name').toString()
|
@@ -1413,11 +1413,12 @@ def exportRevisions(self, revisions):
if not revisions:
revisions = [self.rev]
- dir = QFileDialog.getExistingDirectory(self, _('Export patch'),
+ udir = QFileDialog.getExistingDirectory(self, _('Export patch'),
hglib.tounicode(self.repo.root))
- if not dir:
+ if not udir:
return
- epath = os.path.join(hglib.fromunicode(dir),
+ strdir = hglib.fromunicode(udir)
+ epath = os.path.join(strdir,
hglib.fromunicode(self.repo.shortname)+'_%r.patch')
cmdline = ['export', '--repository', self.repo.root, '--verbose',
@@ -1446,7 +1447,7 @@ 'in the selected location (%s).\n\n') \
% (len(existingRevisions),
" ,".join([str(rev) for rev in existingRevisions]),
- dir)
+ udir)
warningMessage += \
_('What do you want to do?\n') + u'\n' + \
@@ -1468,6 +1469,29 @@
self.runCommand(cmdline)
+ if len(revisions) == 1:
+ # Show a message box with a link to the export folder and to the
+ # exported file
+ rev = revisions[0]
+ patchfilename = os.path.normpath(epath % rev)
+ patchdirname = os.path.normpath(strdir)
+ patchshortname = os.path.basename(patchfilename)
+ qtlib.InfoMsgBox(_('Patch exported'),
+ _('Revision #%d (%s) was exported to:<p>'
+ '<a href="file:///%s">%s</a>%s'
+ '<a href="file:///%s">%s</a>') \
+ % (rev, str(self.repo[rev]),
+ patchdirname, patchdirname, os.path.sep,
+ patchfilename, patchshortname))
+ else:
+ # Show a message box with a link to the export folder
+ qtlib.InfoMsgBox(_('Patches exported'),
+ _('%d patches were exported to:<p>'
+ '<a href="file:///%s">%s</a>') \
+ % (len(revisions),
+ strdir,
+ strdir))
+
def visualDiffRevision(self):
opts = dict(change=self.rev)
dlg = visdiff.visualdiff(self.repo.ui, self.repo, [], opts)
|
@@ -332,13 +332,6 @@ index = 0
self.targetcombo.setCurrentIndex(index)
- def applyTargetOption(self, cmdline):
- if self.embedded and self.targetcheckbox.isChecked():
- idx = self.targetcombo.currentIndex()
- if idx != -1 and idx < len(self.targetargs):
- cmdline += self.targetargs[idx]
- return cmdline
-
def configChanged(self):
'Repository is reporting its config files have changed'
self.reload()
@@ -619,7 +612,13 @@ cmdline.append(val)
if 'rev' in details and '--rev' not in cmdline:
- cmdline = self.applyTargetOption(cmdline)
+ if self.embedded and self.targetcheckbox.isChecked():
+ idx = self.targetcombo.currentIndex()
+ if idx != -1 and idx < len(self.targetargs):
+ args = self.targetargs[idx]
+ if args[0][2:] not in details:
+ args[0] = '--rev'
+ cmdline += args
if self.opts.get('noproxy'):
cmdline += ['--config', 'http_proxy.host=']
if self.opts.get('debug'):
@@ -774,7 +773,7 @@ cmdline += ['--update', '--config', uimerge]
elif self.cachedpp == 'fetch':
cmdline[2] = 'fetch'
- self.run(cmdline, ('force', 'branch', 'rev'))
+ self.run(cmdline, ('force', 'branch', 'rev', 'bookmark'))
def outclicked(self):
url = self.currentUrl(True)
@@ -875,7 +874,7 @@ cmdline.extend(['--rev', str(rev)])
if branch:
cmdline.extend(['--branch', branch])
- self.run(cmdline, ('force', 'new-branch', 'branch', 'rev'))
+ self.run(cmdline, ('force', 'new-branch', 'branch', 'rev', 'bookmark'))
def postpullclicked(self):
dlg = PostPullDialog(self.repo, self)
|
@@ -113,24 +113,26 @@ t, path = selrows[0]
wctx = self.repo[None]
if t & frozenset('?') and wctx.deleted():
- rmenu = QMenu(_('Was renamed from'))
+ rmenu = QMenu(_('Was renamed from'), self.parent())
for d in wctx.deleted()[:15]:
def mkaction(deleted):
a = rmenu.addAction(hglib.tounicode(deleted))
a.triggered.connect(lambda: renamefromto(repo, deleted, path))
mkaction(d)
+ menu.addSeparator()
menu.addMenu(rmenu)
# Add restart merge actions for resolved files
if alltypes & frozenset('u'):
f = make(_('Restart Merge...'), resolve, frozenset('u'))
files = [f for t, f in selrows if 'u' in t]
- rmenu = QMenu(_('Restart merge with'))
+ rmenu = QMenu(_('Restart merge with'), self.parent())
for tool in hglib.mergetools(repo.ui):
def mkaction(rtool):
a = rmenu.addAction(hglib.tounicode(rtool))
a.triggered.connect(lambda: resolve_with(rtool, repo, files))
mkaction(tool)
+ menu.addSeparator()
menu.addMenu(rmenu)
return menu
@@ -316,7 +318,7 @@def rename(parent, ui, repo, files):
from tortoisehg.hgqt.rename import RenameDialog
assert len(files) == 1
- dlg = RenameDialog(repo, files, parent)
+ dlg = RenameDialog(ui, files, parent)
dlg.finished.connect(dlg.deleteLater)
dlg.exec_()
return True
|
Loading...