Commits

Yuya Nishihara  committed f4e16bd

new patches

  • Participants
  • Parent commits b18502c

Comments (0)

Files changed (10)

File chunk-msg.diff

-# HG changeset patch
-# Date 1349796563 -32400
-# Parent f0e8c62c56e22ced9243b313ddf39b58e61bdda7
-chunks: improve confirmation message for revertall
-
-It asks whether to revert file completely or to remove chunks but keep file
-entry. "Remove all file changes" could be misread as "remove changes of all
-files."
-
-diff --git a/tortoisehg/hgqt/chunks.py b/tortoisehg/hgqt/chunks.py
---- a/tortoisehg/hgqt/chunks.py
-+++ b/tortoisehg/hgqt/chunks.py
-@@ -239,7 +239,7 @@ class ChunksWidget(QWidget):
-         kchunks = [c for c in chunks[1:] if not c.selected]
-         revertall = False
-         if not kchunks and qtlib.QuestionMsgBox(_('No chunks remain'),
--                                                _('Remove all file changes?')):
-+                                                _('Also remove file entry?')):
-             revertall = True
-         ctx = self.ctx
-         if isinstance(ctx, patchctx):

File issue1267trace.diff

+# HG changeset patch
+# Parent 28a30e8382be0675aefb547e00a0236eac6bb6ac
+diff --git a/tortoisehg/hgqt/repofilter.py b/tortoisehg/hgqt/repofilter.py
+--- a/tortoisehg/hgqt/repofilter.py
++++ b/tortoisehg/hgqt/repofilter.py
+@@ -155,6 +155,7 @@ class RepoFilterBar(QToolBar):
+ 
+     @pyqtSlot(int)
+     def comboSelectionActivated(self, row):
++        print 'comboSelectionActivated', row
+         text = self.revsetcombo.itemText(row)
+         self.revsetcombo.lineEdit().setText(text)
+         self.entrydlg.entry.setText(text)
+@@ -163,6 +164,7 @@ class RepoFilterBar(QToolBar):
+     def queryIssued(self, query, revset):
+         self.revsetcombo.lineEdit().setText(query)
+         if revset:
++            print 'queryIssued', query, revset
+             self.setRevisionSet.emit(revset)
+         else:
+             self.clearRevisionSet.emit()
+diff --git a/tortoisehg/hgqt/repomodel.py b/tortoisehg/hgqt/repomodel.py
+--- a/tortoisehg/hgqt/repomodel.py
++++ b/tortoisehg/hgqt/repomodel.py
+@@ -172,7 +172,13 @@ class HgRepoListModel(QAbstractTableMode
+         for branch in sorted(self.repo.branchtags().keys()):
+             self.namedbranch_color(branch)
+ 
++    cnt = [0]
+     def setBranch(self, branch=None, allparents=False):
++        if self.revset:
++            self.cnt[0] += 1
++            print 'setBranch', self.revset, self.cnt, branch, allparents
++            if self.cnt[0] >= 3:
++                raise
+         self.filterbranch = branch  # unicode
+         self.invalidateCache()
+         if self.revset and self.filterbyrevset:
+diff --git a/tortoisehg/hgqt/revset.py b/tortoisehg/hgqt/revset.py
+--- a/tortoisehg/hgqt/revset.py
++++ b/tortoisehg/hgqt/revset.py
+@@ -222,7 +222,9 @@ class RevisionSetQuery(QDialog):
+         QShortcut(QKeySequence('Return'), self, self.returnPressed)
+         QShortcut(QKeySequence('Escape'), self, self.reject)
+ 
++    cnt = 0
+     def runQuery(self):
++        print 'runQuery'
+         self.entry.setEnabled(False)
+         self.showMessage.emit(_('Searching...'))
+         self.progress.emit(*cmdui.startProgress(_('Running'), _('query')))

File issue2256trace.diff

+# HG changeset patch
+# Parent 22568cfcaa459415c540a7adf139e888883bd4df
+diff --git a/tortoisehg/hgqt/reporegistry.py b/tortoisehg/hgqt/reporegistry.py
+--- a/tortoisehg/hgqt/reporegistry.py
++++ b/tortoisehg/hgqt/reporegistry.py
+@@ -336,6 +336,7 @@ class RepoRegistryView(QDockWidget):
+             QTimer.singleShot(1000 * UPDATE_DELAY, self.reloadModel)
+ 
+     def reloadModel(self):
++        print 'reloadModel {'
+         oldmodel = self.tview.model()
+         self.tview.setModel(
+             repotreemodel.RepoTreeModel(settingsfilename(), self,
+@@ -345,6 +346,7 @@ class RepoRegistryView(QDockWidget):
+         self.expand()
+         self.setActiveTabRepo()
+         self._pendingReloadModel = False
++        print '}  // reloadModel'
+ 
+     def _getItemAndAncestors(self, it):
+         """Create a list of ancestors (including the selected item)"""
+@@ -774,6 +776,7 @@ class RepoRegistryView(QDockWidget):
+ 
+     @pyqtSlot(QString)
+     def repoChanged(self, uroot):
++        print 'repoChanged', uroot
+         m = self.tview.model()
+         changedrootpath = hglib.fromunicode(QDir.fromNativeSeparators(uroot))
+ 
+diff --git a/tortoisehg/hgqt/repotreemodel.py b/tortoisehg/hgqt/repotreemodel.py
+--- a/tortoisehg/hgqt/repotreemodel.py
++++ b/tortoisehg/hgqt/repotreemodel.py
+@@ -339,9 +339,11 @@ class RepoTreeModel(QAbstractItemModel):
+             count += 1
+ 
+     def loadSubrepos(self, root, filterFunc=(lambda r: True)):
++        print 'loadSubrepos {'
+         repoList = getRepoItemList(root)
+         for n, c in enumerate(repoList):
+             QCoreApplication.processEvents()
++            import time; time.sleep(0.1)
+             if filterFunc(c.rootpath()):
+                 if self.showNetworkSubrepos \
+                         or not paths.netdrive_status(c.rootpath()):
+@@ -356,6 +358,7 @@ class RepoTreeModel(QAbstractItemModel):
+         self.updateProgress.emit(len(repoList), len(repoList),
+             _('Updating repository registry'),
+             _('Repository Registry updated'))
++        print '}  // loadSubrepos'
+ 
+     def updateCommonPaths(self, showShortPaths=None):
+         if not showShortPaths is None:

File ja-cmdname.diff

+# HG changeset patch
+# Parent a035d3662028073f89a0cf1ab31c894169ab8249
+
+diff --git a/i18n/tortoisehg/ja.po b/i18n/tortoisehg/ja.po
+--- a/i18n/tortoisehg/ja.po
++++ b/i18n/tortoisehg/ja.po
+@@ -10,7 +10,7 @@ msgstr ""
+ "Project-Id-Version: tortoisehg\n"
+ "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+ "POT-Creation-Date: 2012-11-05 23:09-0200\n"
+-"PO-Revision-Date: 2012-09-07 14:32+0000\n"
++"PO-Revision-Date: 2012-11-18 16:07+0900\n"
+ "Last-Translator: Yuya Nishihara <Unknown>\n"
+ "Language-Team: LANGUAGE <LL@li.org>\n"
+ "MIME-Version: 1.0\n"
+@@ -681,7 +681,7 @@ msgstr "作業領域のファイルを�
+ 
+ #: tortoisehg/hgqt/chunks.py:93 tortoisehg/hgqt/filectxactions.py:78
+ msgid "Revert to Revision"
+-msgstr "このリビジョンへ復旧"
++msgstr "このリビジョンへ復旧(revert)"
+ 
+ #: tortoisehg/hgqt/chunks.py:94 tortoisehg/hgqt/filectxactions.py:79
+ msgid "Revert file(s) to contents at this revision"
+@@ -1570,11 +1570,11 @@ msgstr "選択したファイルのリ�
+ #: tortoisehg/hgqt/filectxactions.py:63 tortoisehg/hgqt/grep.py:568
+ #: tortoisehg/util/menuthg.py:79
+ msgid "Diff to parent"
+-msgstr "親リビジョンとの差分"
++msgstr "親リビジョンとの差分(diff)"
+ 
+ #: tortoisehg/hgqt/filectxactions.py:65
+ msgid "Diff to local"
+-msgstr "ローカルとの差分"
++msgstr "ローカルとの差分(diff)"
+ 
+ #: tortoisehg/hgqt/filectxactions.py:66
+ msgid "View changes to current in external diff tool"
+@@ -1906,11 +1906,11 @@ msgstr "前の差分"
+ 
+ #: tortoisehg/hgqt/filedialogs.py:753 tortoisehg/hgqt/repowidget.py:1227
+ msgid "Diff to parent..."
+-msgstr "親リビジョンとの差分..."
++msgstr "親リビジョンとの差分(diff)..."
+ 
+ #: tortoisehg/hgqt/filedialogs.py:756 tortoisehg/hgqt/repowidget.py:1229
+ msgid "Diff to local..."
+-msgstr "ローカルとの差分..."
++msgstr "ローカルとの差分(diff)..."
+ 
+ #: tortoisehg/hgqt/filerevmodel.py:23
+ msgctxt "column header"
+@@ -4732,7 +4732,7 @@ msgstr "選択したブランチをプ�
+ 
+ #: tortoisehg/hgqt/repowidget.py:1224 tortoisehg/util/menuthg.py:61
+ msgid "Update..."
+-msgstr "特定のリビジョンへ更新..."
++msgstr "特定のリビジョンへ更新(update)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1231
+ msgid "Browse at rev..."
+@@ -4745,19 +4745,19 @@ msgstr "類似のリビジョン..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1236
+ msgid "Merge with local..."
+-msgstr "ローカルとマージ..."
++msgstr "ローカルとマージ(merge)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1239
+ msgid "Tag..."
+-msgstr "タグ..."
++msgstr "タグ(tag)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1241
+ msgid "Bookmark..."
+-msgstr "ブックマーク..."
++msgstr "ブックマーク(bookmark)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1244
+ msgid "Backout..."
+-msgstr "バックアウト..."
++msgstr "変更を打ち消す(backout)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1248
+ msgid "Copy hash"
+@@ -4769,19 +4769,19 @@ msgstr "エクスポート"
+ 
+ #: tortoisehg/hgqt/repowidget.py:1253
+ msgid "Export patch..."
+-msgstr "パッチとして保存..."
++msgstr "パッチとして保存(export)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1255
+ msgid "Email patch..."
+-msgstr "パッチをメール送信..."
++msgstr "パッチをメール送信(email)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1257
+ msgid "Archive..."
+-msgstr "アーカイブ..."
++msgstr "アーカイブ(archive)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1259
+ msgid "Bundle rev and descendants..."
+-msgstr "リビジョンと子孫をバンドルする..."
++msgstr "リビジョンと子孫をバンドル(bundle)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1261 tortoisehg/hgqt/wctxactions.py:41
+ msgid "Copy patch"
+@@ -4793,7 +4793,7 @@ msgstr "フェーズを変更"
+ 
+ #: tortoisehg/hgqt/repowidget.py:1271
+ msgid "Graft to local..."
+-msgstr ""
++msgstr "ローカルへ移植(graft)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1275
+ msgid "Modify history"
+@@ -4801,27 +4801,27 @@ msgstr "履歴を修正"
+ 
+ #: tortoisehg/hgqt/repowidget.py:1276
+ msgid "Unapply patch (QGoto parent)"
+-msgstr "パッチを適用解除 (QGoto parent)"
++msgstr "パッチを適用解除(qgoto parent)"
+ 
+ #: tortoisehg/hgqt/repowidget.py:1278
+ msgid "Import to MQ"
+-msgstr "MQ へインポート"
++msgstr "MQ へインポート(qimport)"
+ 
+ #: tortoisehg/hgqt/repowidget.py:1280
+ msgid "Finish patch"
+-msgstr "パッチを通常リビジョン化"
++msgstr "パッチを通常リビジョン化(qfinish)"
+ 
+ #: tortoisehg/hgqt/repowidget.py:1282 tortoisehg/hgqt/repowidget.py:1504
+ msgid "Rename patch..."
+-msgstr "パッチ名を変更..."
++msgstr "パッチ名を変更(qrename)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1285
+ msgid "Rebase..."
+-msgstr "リベース..."
++msgstr "リビジョンを移動(rebase)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1288
+ msgid "Strip..."
+-msgstr "リビジョンの除外..."
++msgstr "リビジョンの除外(strip)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1291
+ msgid "Post to Review Board..."
+@@ -4857,27 +4857,27 @@ msgstr "GUI 差分表示..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1430
+ msgid "Export Diff..."
+-msgstr "差分をエクスポート..."
++msgstr "差分をエクスポート(export)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1432 tortoisehg/hgqt/repowidget.py:1521
+ msgid "Export Selected..."
+-msgstr "選択した部分をエクスポート..."
++msgstr "選択した部分をエクスポート(export)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1433 tortoisehg/hgqt/repowidget.py:1522
+ msgid "Email Selected..."
+-msgstr "選択範囲をメール送信..."
++msgstr "選択範囲をメール送信(email)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1435
+ msgid "Export DAG Range..."
+-msgstr "DAG 範囲をエクスポート..."
++msgstr "DAG 範囲をエクスポート(export)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1436
+ msgid "Email DAG Range..."
+-msgstr "DAG 範囲をメール送信..."
++msgstr "DAG 範囲をメール送信(email)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1437
+ msgid "Bundle DAG Range..."
+-msgstr "DAG 範囲をバンドル..."
++msgstr "DAG 範囲をバンドル(bundle)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1439
+ msgid "Bisect - Good, Bad..."
+@@ -4897,7 +4897,7 @@ msgstr "共通の祖先に移動"
+ 
+ #: tortoisehg/hgqt/repowidget.py:1446 tortoisehg/hgqt/repowidget.py:1527
+ msgid "Graft Selected to local..."
+-msgstr ""
++msgstr "選択リビジョンを移植(graft)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1459 tortoisehg/hgqt/repowidget.py:1539
+ msgid "Post Selected to Review Board..."
+@@ -4905,7 +4905,7 @@ msgstr "選択した部分をレビュ�
+ 
+ #: tortoisehg/hgqt/repowidget.py:1499
+ msgid "Apply patch (QGoto)"
+-msgstr "パッチを適用 (QGoto)"
++msgstr "パッチを適用 (qgoto)"
+ 
+ #: tortoisehg/hgqt/repowidget.py:1500
+ msgid "QPush --move"
+@@ -4913,11 +4913,11 @@ msgstr "QPush --move"
+ 
+ #: tortoisehg/hgqt/repowidget.py:1501
+ msgid "Fold patches..."
+-msgstr "パッチを統合..."
++msgstr "パッチを統合(qfold)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1502
+ msgid "Delete patches..."
+-msgstr "パッチを削除..."
++msgstr "パッチを削除(qdelete)..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1503
+ msgid "Reorder patches..."
+@@ -4933,7 +4933,7 @@ msgstr "GUI 差分表示..."
+ 
+ #: tortoisehg/hgqt/repowidget.py:1568 tortoisehg/hgqt/repowidget.py:1578
+ msgid "Export patch"
+-msgstr "パッチをエクスポート"
++msgstr "パッチをエクスポート(export)"
+ 
+ #: tortoisehg/hgqt/repowidget.py:1570
+ msgid "Patch Files (*.patch)"
+@@ -8918,7 +8918,7 @@ msgstr "不明ファイルを表示"
+ 
+ #: tortoisehg/hgqt/wctxactions.py:55
+ msgid "&Revert..."
+-msgstr "復旧(&R)..."
++msgstr "復旧(&revert)..."
+ 
+ #: tortoisehg/hgqt/wctxactions.py:58 tortoisehg/util/menuthg.py:49
+ msgid "File History"
+@@ -8926,11 +8926,11 @@ msgstr "ファイル変更履歴"
+ 
+ #: tortoisehg/hgqt/wctxactions.py:59
+ msgid "&Annotate"
+-msgstr "変更表示(&A)"
++msgstr "変更表示(&annotate)"
+ 
+ #: tortoisehg/hgqt/wctxactions.py:61
+ msgid "&Forget"
+-msgstr "登録除外(&F)"
++msgstr "登録除外(&forget)"
+ 
+ #: tortoisehg/hgqt/wctxactions.py:64
+ msgid "Add &Largefiles..."
+@@ -9111,7 +9111,7 @@ msgstr "リポジトリを作成..."
+ 
+ #: tortoisehg/hgqt/workbench.py:89 tortoisehg/hgqt/workbench.py:170
+ msgid "Clone Repository..."
+-msgstr "リポジトリをクローン..."
++msgstr "リポジトリをクローン(clone)..."
+ 
+ #: tortoisehg/hgqt/workbench.py:91
+ msgid "Open Repository..."
+@@ -9163,7 +9163,7 @@ msgstr "新しいWorkbench(&W)..."
+ 
+ #: tortoisehg/hgqt/workbench.py:168
+ msgid "&New Repository..."
+-msgstr "リポジトリを作成(&N)..."
++msgstr "リポジトリを作成(i&nit)..."
+ 
+ #: tortoisehg/hgqt/workbench.py:174
+ msgid "&Open Repository..."
+@@ -9276,7 +9276,7 @@ msgstr "指定のリビジョンに移�
+ 
+ #: tortoisehg/hgqt/workbench.py:292
+ msgid "Web Server..."
+-msgstr "ウェブサーバー..."
++msgstr "ウェブサーバー(serve)..."
+ 
+ #: tortoisehg/hgqt/workbench.py:295
+ msgid "Shelve..."
+@@ -9284,31 +9284,31 @@ msgstr "シェルフ..."
+ 
+ #: tortoisehg/hgqt/workbench.py:297
+ msgid "Import..."
+-msgstr "インポート..."
++msgstr "インポート(import)..."
+ 
+ #: tortoisehg/hgqt/workbench.py:300
+ msgid "Verify"
+-msgstr "検証"
++msgstr "検証(verify)"
+ 
+ #: tortoisehg/hgqt/workbench.py:302
+ msgid "Recover"
+-msgstr "復元"
++msgstr "復元(recover)"
+ 
+ #: tortoisehg/hgqt/workbench.py:305
+ msgid "Resolve..."
+-msgstr "解決..."
++msgstr "解決(resolve)..."
+ 
+ #: tortoisehg/hgqt/workbench.py:308
+ msgid "Rollback/Undo..."
+-msgstr "ロールバック・元に戻す..."
++msgstr "ロールバック・元に戻す(rollback)..."
+ 
+ #: tortoisehg/hgqt/workbench.py:312
+ msgid "Purge..."
+-msgstr "完全に削除..."
++msgstr "完全に削除(purge)..."
+ 
+ #: tortoisehg/hgqt/workbench.py:315
+ msgid "Bisect..."
+-msgstr "分割探索..."
++msgstr "分割探索(bisect)..."
+ 
+ #: tortoisehg/hgqt/workbench.py:325
+ msgid "Help"

File mqlib.diff

-# HG changeset patch
-# Date 1349673988 -32400
-# Parent 11cf6cb25df95ef1a4528867f9457f5ab524ff95
-mq: split core functions to mqutil in order to avoid circular import
-
-The original code has circular import path, commit -> mq -> thgimport
--> commit.
-
-diff --git a/tortoisehg/hgqt/commit.py b/tortoisehg/hgqt/commit.py
---- a/tortoisehg/hgqt/commit.py
-+++ b/tortoisehg/hgqt/commit.py
-@@ -15,7 +15,7 @@ from tortoisehg.util import hglib, shlib
- 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, lfprompt, i18n
-+from tortoisehg.hgqt import hgrcutil, mqutil, lfprompt, i18n
- 
- from PyQt4.QtCore import *
- from PyQt4.QtGui import *
-@@ -165,7 +165,7 @@ class CommitWidget(QWidget, qtlib.TaskWi
-             pnhbox = QHBoxLayout()
-             self.pnlabel = QLabel()
-             pnhbox.addWidget(self.pnlabel)
--            self.pnedit = mq.getPatchNameLineEdit()
-+            self.pnedit = mqutil.getPatchNameLineEdit()
-             self.pnedit.setMaximumWidth(250)
-             pnhbox.addWidget(self.pnedit)
-             pnhbox.addStretch()
-@@ -349,7 +349,7 @@ class CommitWidget(QWidget, qtlib.TaskWi
-             self.pnlabel.setVisible(True)
-             self.pnedit.setVisible(True)
-             self.pnedit.setFocus()
--            self.pnedit.setText(mq.defaultNewPatchName(self.repo))
-+            self.pnedit.setText(mqutil.defaultNewPatchName(self.repo))
-             self.pnedit.selectAll()
-             self.stwidget.setPatchContext(None)
-             refreshwctx = refresh and oldpctx is not None
-@@ -448,10 +448,11 @@ class CommitWidget(QWidget, qtlib.TaskWi
-             wholecmdlines.extend(cmdlines)
- 
-         olist = ('user', 'date')
--        cmdlines = mq.mqNewRefreshCommand(self.repo,
--                                          curraction._name == 'qnew',
--                                          self.stwidget, self.pnedit,
--                                          self.msgte.text(), self.opts, olist)
-+        cmdlines = mqutil.mqNewRefreshCommand(self.repo,
-+                                              curraction._name == 'qnew',
-+                                              self.stwidget, self.pnedit,
-+                                              self.msgte.text(), self.opts,
-+                                              olist)
-         if not cmdlines:
-             return
-         wholecmdlines.extend(cmdlines)
-diff --git a/tortoisehg/hgqt/mq.py b/tortoisehg/hgqt/mq.py
---- a/tortoisehg/hgqt/mq.py
-+++ b/tortoisehg/hgqt/mq.py
-@@ -7,7 +7,6 @@
- 
- import os
- import re
--import time
- 
- from PyQt4.QtCore import *
- from PyQt4.QtGui import *
-@@ -18,64 +17,13 @@ from hgext import mq as mqmod
- from tortoisehg.util import hglib
- from tortoisehg.hgqt.i18n import _
- from tortoisehg.hgqt import qtlib, cmdui, rejects, qscilib, thgrepo, status
--from tortoisehg.hgqt import qqueue, qreorder, thgimport, messageentry
-+from tortoisehg.hgqt import qqueue, qreorder, thgimport, messageentry, mqutil
- from tortoisehg.hgqt.qtlib import geticon
- 
- # TODO
- # keep original file name in file list item
- # more wctx functions
- 
--def defaultNewPatchName(repo):
--    t = time.strftime('%Y-%m-%d_%H-%M-%S')
--    return t + '_r%d+.diff' % repo['.'].rev()
--
--def getPatchNameLineEdit():
--    patchNameLE = QLineEdit()
--    if hasattr(patchNameLE, 'setPlaceholderText'): # Qt >= 4.7
--        patchNameLE.setPlaceholderText(_('### patch name ###'))
--    return patchNameLE
--
--def getUserOptions(opts, *optionlist):
--    out = []
--    for opt in optionlist:
--        if opt not in opts:
--            continue
--        val = opts[opt]
--        if val is False:
--            continue
--        elif val is True:
--            out.append('--' + opt)
--        else:
--            out.append('--' + opt)
--            out.append(val)
--    return out
--
--def mqNewRefreshCommand(repo, isnew, stwidget, pnwidget, message, opts, olist):
--    if isnew:
--        name = hglib.fromunicode(pnwidget.text())
--        if not name:
--            qtlib.ErrorMsgBox(_('Patch Name Required'),
--                              _('You must enter a patch name'))
--            pnwidget.setFocus()
--            return
--        cmdline = ['qnew', '--repository', repo.root, name]
--    else:
--        cmdline = ['qrefresh', '--repository', repo.root]
--    if message:
--        cmdline += ['--message=' + hglib.fromunicode(message)]
--    cmdline += getUserOptions(opts, *olist)
--    files = ['--'] + [repo.wjoin(x) for x in stwidget.getChecked()]
--    addrem = [repo.wjoin(x) for x in stwidget.getChecked('!?')]
--    if len(files) > 1:
--        cmdline += files
--    else:
--        cmdline += ['--exclude', repo.root]
--    if addrem:
--        cmdlines = [ ['addremove', '-R', repo.root] + addrem, cmdline]
--    else:
--        cmdlines = [cmdline]
--    return cmdlines
--
- class MQPatchesWidget(QDockWidget):
-     showMessage = pyqtSignal(unicode)
-     output = pyqtSignal(QString, QString)
-@@ -648,7 +596,7 @@ class MQWidget(QWidget, qtlib.TaskWidget
-         layout.addLayout(mtbarhbox, 0)
-         mtbarhbox.setContentsMargins(0, 0, 0, 0)
-         self.newCheckBox = QCheckBox(_('New Patch'))
--        self.patchNameLE = getPatchNameLineEdit()
-+        self.patchNameLE = mqutil.getPatchNameLineEdit()
-         mtbarhbox.addWidget(self.newCheckBox)
-         mtbarhbox.addWidget(self.patchNameLE, 1)
- 
-@@ -719,7 +667,7 @@ class MQWidget(QWidget, qtlib.TaskWidget
-         super(MQWidget, self).closeEvent(event)
- 
-     def getUserOptions(self, *optionlist):
--        return getUserOptions(self.opts, *optionlist)
-+        return mqutil.getUserOptions(self.opts, *optionlist)
- 
-     @pyqtSlot()
-     def onConfigChanged(self):
-@@ -845,10 +793,10 @@ class MQWidget(QWidget, qtlib.TaskWidget
-         if self.newCheckBox.isChecked():
-             self.finishfunc = lambda ret: self.newCheckBox.setChecked(False)
-         optionlist = ('user', 'currentuser', 'git', 'date', 'currentdate')
--        cmdlines = mqNewRefreshCommand(self.repo, self.newCheckBox.isChecked(),
--                                       self.stwidget, self.patchNameLE,
--                                       self.messageEditor.text(), self.opts,
--                                       optionlist)
-+        cmdlines = mqutil.mqNewRefreshCommand(self.repo, self.newCheckBox.isChecked(),
-+                                              self.stwidget, self.patchNameLE,
-+                                              self.messageEditor.text(), self.opts,
-+                                              optionlist)
-         self.repo.incrementBusyCount()
-         self.cmd.run(*cmdlines)
- 
-@@ -979,7 +927,7 @@ class MQWidget(QWidget, qtlib.TaskWidget
-             self.messageEditor.setEnabled(True)
-             self.patchNameLE.setEnabled(True)
-             self.patchNameLE.setFocus()
--            self.patchNameLE.setText(defaultNewPatchName(self.repo))
-+            self.patchNameLE.setText(mqutil.defaultNewPatchName(self.repo))
-             self.patchNameLE.selectAll()
-             self.setMessage('')
-         else:
-diff --git a/tortoisehg/hgqt/mqutil.py b/tortoisehg/hgqt/mqutil.py
-new file mode 100644
---- /dev/null
-+++ b/tortoisehg/hgqt/mqutil.py
-@@ -0,0 +1,66 @@
-+# mqutil.py - Core functionality for 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.
-+
-+import time
-+
-+from PyQt4.QtCore import *
-+from PyQt4.QtGui import *
-+
-+from tortoisehg.util import hglib
-+from tortoisehg.hgqt.i18n import _
-+from tortoisehg.hgqt import qtlib
-+
-+def defaultNewPatchName(repo):
-+    t = time.strftime('%Y-%m-%d_%H-%M-%S')
-+    return t + '_r%d+.diff' % repo['.'].rev()
-+
-+def getPatchNameLineEdit():
-+    patchNameLE = QLineEdit()
-+    if hasattr(patchNameLE, 'setPlaceholderText'): # Qt >= 4.7
-+        patchNameLE.setPlaceholderText(_('### patch name ###'))
-+    return patchNameLE
-+
-+def getUserOptions(opts, *optionlist):
-+    out = []
-+    for opt in optionlist:
-+        if opt not in opts:
-+            continue
-+        val = opts[opt]
-+        if val is False:
-+            continue
-+        elif val is True:
-+            out.append('--' + opt)
-+        else:
-+            out.append('--' + opt)
-+            out.append(val)
-+    return out
-+
-+def mqNewRefreshCommand(repo, isnew, stwidget, pnwidget, message, opts, olist):
-+    if isnew:
-+        name = hglib.fromunicode(pnwidget.text())
-+        if not name:
-+            qtlib.ErrorMsgBox(_('Patch Name Required'),
-+                              _('You must enter a patch name'))
-+            pnwidget.setFocus()
-+            return
-+        cmdline = ['qnew', '--repository', repo.root, name]
-+    else:
-+        cmdline = ['qrefresh', '--repository', repo.root]
-+    if message:
-+        cmdline += ['--message=' + hglib.fromunicode(message)]
-+    cmdline += getUserOptions(opts, *olist)
-+    files = ['--'] + [repo.wjoin(x) for x in stwidget.getChecked()]
-+    addrem = [repo.wjoin(x) for x in stwidget.getChecked('!?')]
-+    if len(files) > 1:
-+        cmdline += files
-+    else:
-+        cmdline += ['--exclude', repo.root]
-+    if addrem:
-+        cmdlines = [ ['addremove', '-R', repo.root] + addrem, cmdline]
-+    else:
-+        cmdlines = [cmdline]
-+    return cmdlines

File prettycmd.diff

+# HG changeset patch
+# Date 1353846659 -32400
+# Parent e8dadcc361ca2860bdceb17e10c470bdfb964049
+cmdui: prettify command-line string for display (closes #1529)
+
+Currently "Output Log" window shows the full command-line arguments, but
+it isn't nice for CLI learners.
+
+This patch removes obvious options like --repository from display string,
+and escapes common characters.
+
+diff --git a/tortoisehg/hgqt/cmdui.py b/tortoisehg/hgqt/cmdui.py
+--- a/tortoisehg/hgqt/cmdui.py
++++ b/tortoisehg/hgqt/cmdui.py
+@@ -132,6 +132,39 @@ class ThgStatusBar(QStatusBar):
+             pm.unknown()
+ 
+ 
++def _quotecmdarg(arg):
++    # only for display; no use to construct command string for os.system()
++    if not arg or ' ' in arg or '\\' in arg or '"' in arg:
++        return '"%s"' % arg.replace('"', '\\"')
++    else:
++        return arg
++
++def _prettifycmdline(cmdline):
++    r"""Build pretty command-line string for display
++
++    >>> _prettifycmdline(['--repository', 'foo', 'status'])
++    'status'
++    >>> _prettifycmdline(['--cwd', 'foo', 'resolve', '--', '--repository'])
++    'resolve -- --repository'
++    >>> _prettifycmdline(['log', 'foo\\bar', '', 'foo bar', 'foo"bar'])
++    'log "foo\\bar" "" "foo bar" "foo\\"bar"'
++    """
++    try:
++        argcount = cmdline.index('--')
++    except ValueError:
++        argcount = len(cmdline)
++    printables = []
++    pos = 0
++    while pos < argcount:
++        if cmdline[pos] in ('-R', '--repository', '--cwd'):
++            pos += 2
++        else:
++            printables.append(cmdline[pos])
++            pos += 1
++    printables.extend(cmdline[argcount:])
++
++    return ' '.join(_quotecmdarg(e) for e in printables)
++
+ class Core(QObject):
+     """Core functionality for running Mercurial command.
+     Do not attempt to instantiate and use this directly.
+@@ -220,7 +253,7 @@ class Core(QObject):
+             if display:
+                 cmd = '%% hg %s\n' % display
+             else:
+-                cmd = '%% hg %s\n' % ' '.join(cmdline)
++                cmd = '%% hg %s\n' % _prettifycmdline(cmdline)
+             self.output.emit(cmd, 'control')
+             proc.start(exepath, cmdline, QIODevice.ReadOnly)
+ 
+@@ -272,7 +305,8 @@ class Core(QObject):
+ 
+         cmdline = self.queue.pop(0)
+ 
+-        self.thread = thread.CmdThread(cmdline, self.display, self.parent())
++        display = self.display or _prettifycmdline(cmdline)
++        self.thread = thread.CmdThread(cmdline, display, self.parent())
+         self.thread.started.connect(self.onCommandStarted)
+         self.thread.commandFinished.connect(self.onThreadFinished)
+ 
-chunk-msg.diff
-mqlib.diff
-test-nodemand.diff
+prettycmd.diff
+ja-cmdname.diff
+unidiff.diff
+unidifftl.diff
+issue2256trace.diff
+issue1267trace.diff
 graph-exc.diff
 issue-2170-debug.diff
 docmake-sync.diff

File test-nodemand.diff

-# HG changeset patch
-# Parent 20b2de0b03591b25580ae9058f137b9d6b20be1c
-diff --git a/tests/nosehgenv.py b/tests/nosehgenv.py
---- a/tests/nosehgenv.py
-+++ b/tests/nosehgenv.py
-@@ -32,11 +32,6 @@ class HgEnvPlugin(plugins.Plugin):
-         self._setupmiscenv()
-         self._setupqapp()
- 
--        # TODO: workaround for "no module named comtypes" error
--        # https://bitbucket.org/tortoisehg/thg/issue/1726/
--        from mercurial import demandimport
--        demandimport.enable()
--
-     def _setupsyspath(self):
-         hgpath = os.environ.get('HGPATH')
-         if hgpath:

File unidiff.diff

+# HG changeset patch
+# Parent a035d3662028073f89a0cf1ab31c894169ab8249
+menu: unify "Diff to Parent" string
+
+- add &D shortcut
+- append "..."
+- Title Case
+
+diff --git a/tortoisehg/hgqt/filectxactions.py b/tortoisehg/hgqt/filectxactions.py
+--- a/tortoisehg/hgqt/filectxactions.py
++++ b/tortoisehg/hgqt/filectxactions.py
+@@ -60,7 +60,7 @@ class FilectxActions(QObject):
+              _('Show the history of the selected file'), self.filterfile),
+             ('diffnavigate', _('Compare file revisions'), 'compare-files', None,
+              _('Compare revisions of the selected file'), self.diffNavigate),
+-            ('diff', _('Diff to parent'), 'visualdiff', 'Ctrl+D',
++            ('diff', _('&Diff to Parent...'), 'visualdiff', 'Ctrl+D',
+              _('View file changes in external diff tool'), self.vdiff),
+             ('ldiff', _('Diff to local'), 'ldiff', 'Shift+Ctrl+D',
+              _('View changes to current in external diff tool'),
+diff --git a/tortoisehg/hgqt/filedialogs.py b/tortoisehg/hgqt/filedialogs.py
+--- a/tortoisehg/hgqt/filedialogs.py
++++ b/tortoisehg/hgqt/filedialogs.py
+@@ -750,7 +750,7 @@ class FileDiffDialog(_AbstractFileDialog
+             return
+         if self.menu is None:
+             self.menu = menu = QMenu(self)
+-            a = menu.addAction(_('Diff to parent...'))
++            a = menu.addAction(_('&Diff to Parent...'))
+             a.setIcon(qtlib.getmenuicon('visualdiff'))
+             a.triggered.connect(self.onVisualDiff)
+             a = menu.addAction(_('Diff to local...'))
+diff --git a/tortoisehg/hgqt/grep.py b/tortoisehg/hgqt/grep.py
+--- a/tortoisehg/hgqt/grep.py
++++ b/tortoisehg/hgqt/grep.py
+@@ -565,7 +565,7 @@ class MatchTree(QTableView):
+         for key, name, func, shortcut in (
+             ('edit',  _('View file'),      self.onViewFile,      'CTRL+E'),
+             ('ctx',   _('View Changeset'), self.onViewChangeset, 'CTRL+V'),
+-            ('vdiff', _('Diff to parent'), self.onVisualDiff,    'CTRL+D'),
++            ('vdiff', _('&Diff to Parent...'), self.onVisualDiff, 'CTRL+D'),
+             ('ann',   _('Annotate file'),  self.onAnnotateFile,  'CTRL+F')):
+             action = QAction(name, self)
+             action.triggered.connect(func)
+diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
+--- a/tortoisehg/hgqt/repowidget.py
++++ b/tortoisehg/hgqt/repowidget.py
+@@ -1224,7 +1224,7 @@ class RepoWidget(QWidget):
+         entry(menu, None, isrev, _('Update...'), 'hg-update',
+               self.updateToRevision)
+         entry(menu)
+-        entry(menu, None, isctx, _('Diff to parent...'), 'visualdiff',
++        entry(menu, None, isctx, _('&Diff to Parent...'), 'visualdiff',
+               self.visualDiffRevision)
+         entry(menu, None, isrev, _('Diff to local...'), 'ldiff',
+               self.visualDiffToLocal)
+diff --git a/tortoisehg/hgqt/wctxactions.py b/tortoisehg/hgqt/wctxactions.py
+--- a/tortoisehg/hgqt/wctxactions.py
++++ b/tortoisehg/hgqt/wctxactions.py
+@@ -37,7 +37,8 @@ class WctxActions(QObject):
+             parent.addAction(action)
+             allactions.append(action)
+ 
+-        make(_('&Diff to parent'), vdiff, frozenset('MAR!'), 'visualdiff', 'CTRL+D')
++        make(_('&Diff to Parent...'), vdiff, frozenset('MAR!'), 'visualdiff',
++             'CTRL+D')
+         make(_('Copy patch'), copyPatch, frozenset('MAR!'), 'copy-patch')
+         make(_('Edit'), edit, frozenset('MACI?'), 'edit-file', 'SHIFT+CTRL+E')
+         make(_('Open'), openfile, frozenset('MACI?'), '', 'SHIFT+CTRL+L')

File unidifftl.diff

+# HG changeset patch
+# Parent 3be142764c9962ed7f1fb605e8dd7a3d7a3c5951
+menu: unify "Diff to Local" string
+
+- add &L shortcut
+- append "..."
+- Title Case
+
+diff --git a/tortoisehg/hgqt/filectxactions.py b/tortoisehg/hgqt/filectxactions.py
+--- a/tortoisehg/hgqt/filectxactions.py
++++ b/tortoisehg/hgqt/filectxactions.py
+@@ -62,7 +62,7 @@ class FilectxActions(QObject):
+              _('Compare revisions of the selected file'), self.diffNavigate),
+             ('diff', _('&Diff to Parent...'), 'visualdiff', 'Ctrl+D',
+              _('View file changes in external diff tool'), self.vdiff),
+-            ('ldiff', _('Diff to local'), 'ldiff', 'Shift+Ctrl+D',
++            ('ldiff', _('Diff to &Local...'), 'ldiff', 'Shift+Ctrl+D',
+              _('View changes to current in external diff tool'),
+              self.vdifflocal),
+             ('edit', _('View at Revision'), 'view-at-revision', 'Shift+Ctrl+E',
+diff --git a/tortoisehg/hgqt/filedialogs.py b/tortoisehg/hgqt/filedialogs.py
+--- a/tortoisehg/hgqt/filedialogs.py
++++ b/tortoisehg/hgqt/filedialogs.py
+@@ -753,7 +753,7 @@ class FileDiffDialog(_AbstractFileDialog
+             a = menu.addAction(_('&Diff to Parent...'))
+             a.setIcon(qtlib.getmenuicon('visualdiff'))
+             a.triggered.connect(self.onVisualDiff)
+-            a = menu.addAction(_('Diff to local...'))
++            a = menu.addAction(_('Diff to &Local...'))
+             a.setIcon(qtlib.getmenuicon('ldiff'))
+             a.triggered.connect(self.onVisualDiffToLocal)
+             menu.addSeparator()
+diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
+--- a/tortoisehg/hgqt/repowidget.py
++++ b/tortoisehg/hgqt/repowidget.py
+@@ -1226,7 +1226,7 @@ class RepoWidget(QWidget):
+         entry(menu)
+         entry(menu, None, isctx, _('&Diff to Parent...'), 'visualdiff',
+               self.visualDiffRevision)
+-        entry(menu, None, isrev, _('Diff to local...'), 'ldiff',
++        entry(menu, None, isrev, _('Diff to &Local...'), 'ldiff',
+               self.visualDiffToLocal)
+         entry(menu, None, isctx, _('Browse at rev...'), 'hg-annotate',
+               self.manifestRevision)
+diff --git a/tortoisehg/hgqt/resolve.py b/tortoisehg/hgqt/resolve.py
+--- a/tortoisehg/hgqt/resolve.py
++++ b/tortoisehg/hgqt/resolve.py
+@@ -178,7 +178,7 @@ class ResolveDialog(QDialog):
+         cmedit.triggered.connect(self.edit)
+         cmv3way = self.rtreecmenu.addAction(_('3-Way Diff'))
+         cmv3way.triggered.connect(self.v3way)
+-        cmvp0 = self.rtreecmenu.addAction(_('Diff to Local'))
++        cmvp0 = self.rtreecmenu.addAction(_('Diff to &Local...'))
+         cmvp0.triggered.connect(self.vp0)
+         cmvp1 = self.rtreecmenu.addAction(_('Diff to Other'))
+         cmvp1.triggered.connect(self.vp1)