by
Changes to 10 files · Browse files at ca666161b014 Showing diff from parent e548b87269a0 b5fbaedfb641 Diff from another changeset...
@@ -4,7 +4,7 @@ * Pull latest translations from Launchpad
* update url in qtlib.openhelpcontents() (major release only)
* set revision number in doc/source/conf.py
-* tag stable branch of repository, push
+* tag stable branches of thg and shellext repos, push
* build pdf hgbook, check into thg-winbuild (major release only)
* build release installer
* commit extension versions, tag, push thg-winbuild
|
@@ -1152,7 +1152,8 @@ def run(ui, *pats, **opts):
from tortoisehg.util import paths
from tortoisehg.hgqt import thgrepo
- repo = thgrepo.repository(ui, path=paths.find_root())
+ root = opts.get('root', paths.find_root())
+ repo = thgrepo.repository(ui, path=root)
pats = hglib.canonpaths(pats)
os.chdir(repo.root)
return CommitDialog(repo, pats, opts)
|
@@ -288,7 +288,7 @@ if ':' in link:
scheme, param = link.split(':', 1)
if scheme == 'cset':
- rev = self.repo[param].rev()
+ rev = self.repo[hglib.fromunicode(param)].rev()
return self.goto(rev)
QDesktopServices.openUrl(QUrl(link))
|
|
|
@@ -10,15 +10,15 @@
import os
-from mercurial import util
-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
+from mercurial import error
+
from tortoisehg.util import paths, hglib
from tortoisehg.hgqt.i18n import _
-from tortoisehg.hgqt import qtlib, qscilib, fileview, status, thgrepo
+from tortoisehg.hgqt import qtlib, fileview, status, thgrepo
from tortoisehg.hgqt import visdiff, revert, revpanel, workbench
from tortoisehg.hgqt.filedialogs import FileLogDialog, FileDiffDialog
from tortoisehg.hgqt.manifestmodel import ManifestModel
@@ -243,7 +243,7 @@ def vdiff(self):
if self.path is None:
return
- pats = [self.path]
+ pats = [hglib.fromunicode(self.path)]
opts = {'change':self.rev}
dlg = visdiff.visualdiff(self._repo.ui, self._repo, pats, opts)
if dlg:
@@ -252,7 +252,7 @@ def vdifflocal(self):
if self.path is None:
return
- pats = [self.path]
+ pats = [hglib.fromunicode(self.path)]
assert type(self.rev) is int
opts = {'rev':['rev(%d)' % self.rev]}
dlg = visdiff.visualdiff(self._repo.ui, self._repo, pats, opts)
@@ -263,17 +263,20 @@ if self.path is None:
return
if self.rev is None:
- qtlib.editfiles(self._repo, [self.path], parent=self)
+ qtlib.editfiles(self._repo, [hglib.fromunicode(self.path)],
+ parent=self)
else:
- base, _ = visdiff.snapshot(self._repo, [self.path],
+ base, _ = visdiff.snapshot(self._repo,
+ [hglib.fromunicode(self.path)],
self._repo[self.rev])
- files = [os.path.join(base, self.path)]
+ files = [os.path.join(base, hglib.fromunicode(self.path))]
qtlib.editfiles(self._repo, files, parent=self)
def editlocal(self):
if self.path is None:
return
- qtlib.editfiles(self._repo, [self.path], parent=self)
+ qtlib.editfiles(self._repo, [hglib.fromunicode(self.path)],
+ parent=self)
def revertfile(self):
if self.path is None:
@@ -281,12 +284,13 @@ rev = self.rev
if rev is None:
rev = self._repo['.'].rev()
- dlg = revert.RevertDialog(self._repo, [self.path], rev, self)
+ dlg = revert.RevertDialog(self._repo, [hglib.fromunicode(self.path)],
+ rev, self)
dlg.exec_()
def _navigate(self, filename, dlgclass, dlgdict):
if not filename:
- filename = self.path
+ filename = hglib.fromunicode(self.path)
if filename not in dlgdict:
repoviewer = self.window()
if not isinstance(repoviewer, workbench.Workbench):
@@ -302,7 +306,7 @@ dlg.activateWindow()
def opensubrepo(self):
- path = self._repo.wjoin(self.path)
+ path = self._repo.wjoin(hglib.fromunicode(self.path))
if os.path.isdir(path):
self.linkActivated.emit(u'subrepo:'+hglib.tounicode(path))
else:
@@ -311,14 +315,14 @@ _("The selected subrepository does not exist on the working directory"))
def explore(self):
- root = self._repo.wjoin(self.path)
+ root = self._repo.wjoin(hglib.fromunicode(self.path))
if os.path.isdir(root):
- QDesktopServices.openUrl(QUrl.fromLocalFile(root))
+ QDesktopServices.openUrl(QUrl.fromLocalFile(hglib.tounicode(root)))
def terminal(self):
- root = self._repo.wjoin(self.path)
+ root = self._repo.wjoin(hglib.fromunicode(self.path))
if os.path.isdir(root):
- qtlib.openshell(root, self.path)
+ qtlib.openshell(root, hglib.fromunicode(self.path))
def showEvent(self, event):
QWidget.showEvent(self, event)
@@ -445,7 +449,7 @@ self.revChanged.emit(rev)
self._setupmodel()
ctx = self._repo[rev]
- if path and path in ctx:
+ if path and hglib.fromunicode(path) in ctx:
# recover file selection after reloading the model
self.setPath(path)
self._fileview.setContext(ctx)
@@ -468,7 +472,7 @@ if path != self.path:
self.setPath(path)
ctx = self._repo[rev]
- if self.path in ctx:
+ if hglib.fromunicode(self.path) in ctx:
self._fileview.displayFile(path, self.status)
if line:
self._fileview.showLine(int(line) - 1)
@@ -477,7 +481,7 @@
@property
def path(self):
- """Return currently selected path"""
+ """Return currently selected path [unicode]"""
return self._treemodel.filePath(self._treeview.currentIndex())
@property
@@ -524,7 +528,14 @@
def run(ui, *pats, **opts):
repo = opts.get('repo') or thgrepo.repository(ui, paths.find_root())
- dlg = ManifestDialog(repo, opts.get('rev'))
+ try:
+ # ManifestWidget expects integer revision
+ rev = repo[opts.get('rev')].rev()
+ except error.RepoLookupError, e:
+ qtlib.ErrorMsgBox(_('Failed to open Manifest dialog'),
+ hglib.tounicode(e.message))
+ return
+ dlg = ManifestDialog(repo, rev)
# set initial state after dialog visible
def init():
@@ -536,7 +547,7 @@ else:
return
line = opts.get('line') and int(opts['line']) or None
- dlg.setSource(path, opts.get('rev'), line)
+ dlg.setSource(path, rev, line)
if opts.get('pattern'):
dlg.setSearchPattern(opts['pattern'])
if dlg._manifest_widget._fileview.actionAnnMode.isEnabled():
|
@@ -9,6 +9,7 @@ from PyQt4.QtCore import *
from PyQt4.QtGui import *
+from tortoisehg.util import hglib
from tortoisehg.hgqt.i18n import _
from tortoisehg.hgqt import revset, qtlib
@@ -40,7 +41,7 @@
#Check if the font contains the glyph needed by the branch combo
if not QFontMetrics(self.font()).inFont(QString(u'\u2605').at(0)):
- self._allBranchesLabel = u'*** %s ***' % _('Show all')
+ self._allBranchesLabel = u'*** %s ***' % _('Show all')
self.entrydlg = revset.RevisionSetQuery(repo, self)
self.entrydlg.progress.connect(self.progress)
@@ -246,8 +247,10 @@ self._branchCombo.clear()
self._branchCombo.addItem(self._allBranchesLabel)
for branch in branches:
- self._branchCombo.addItem(branch)
- self._branchCombo.setItemData(self._branchCombo.count() - 1, branch, Qt.ToolTipRole)
+ self._branchCombo.addItem(hglib.tounicode(branch))
+ self._branchCombo.setItemData(self._branchCombo.count() - 1,
+ hglib.tounicode(branch),
+ Qt.ToolTipRole)
self._branchLabel.setEnabled(self.filterEnabled and (len(branches) > 1 or self._abranchAction.isChecked()))
self._branchCombo.setEnabled(self.filterEnabled and (len(branches) > 1 or self._abranchAction.isChecked()))
self._branchReloading = False
|
@@ -123,13 +123,16 @@ self.setBranch(branch)
def setBranch(self, branch=None, allparents=True):
- self.filterbranch = branch
+ self.filterbranch = branch # unicode
self.invalidateCache()
if self.revset and self.filterbyrevset:
- grapher = revision_grapher(self.repo, branch=branch, revset=self.revset)
+ grapher = revision_grapher(self.repo,
+ branch=hglib.fromunicode(branch),
+ revset=self.revset)
self.graph = Graph(self.repo, grapher, include_mq=False)
else:
- grapher = revision_grapher(self.repo, branch=branch,
+ grapher = revision_grapher(self.repo,
+ branch=hglib.fromunicode(branch),
allparents=allparents)
self.graph = Graph(self.repo, grapher, include_mq=True)
self.rowcount = 0
|
@@ -16,9 +16,6 @@ from PyQt4.QtCore import *
from PyQt4.QtGui import *
-import qtlib
-
-
def settingsfilename():
"""Return path to thg-reporegistry.xml as unicode"""
s = QSettings()
@@ -50,7 +47,8 @@ self.setDragDropMode(QAbstractItemView.DragDrop)
self.setDefaultDropAction(Qt.MoveAction)
self.setDropIndicatorShown(True)
- self.setEditTriggers(QAbstractItemView.DoubleClicked)
+ self.setEditTriggers(QAbstractItemView.DoubleClicked
+ | QAbstractItemView.EditKeyPressed)
self.setSelectionBehavior(QAbstractItemView.SelectRows)
QShortcut('Return', self, self.showFirstTabOrOpen).setContext(
Qt.WidgetShortcut)
@@ -58,8 +56,6 @@ Qt.WidgetShortcut)
QShortcut('Delete', self, self.removeSelected).setContext(
Qt.WidgetShortcut)
- QShortcut('F2', self, self.renameSelected).setContext(
- Qt.WidgetShortcut)
def contextMenuEvent(self, event):
if not self.selitem:
@@ -208,6 +204,8 @@ 'remove selected repository'
s = self.selitem
item = s.internalPointer()
+ if 'remove' not in item.menulist(): # check capability
+ return
if not item.okToDelete():
labels = [(QMessageBox.Yes, _('&Delete')),
(QMessageBox.No, _('Cancel'))]
@@ -222,10 +220,6 @@ self.selectionChanged(None, None)
self.updateSettingsFile.emit()
- def renameSelected(self):
- 'rename selected repository'
- self.edit(self.selitem)
-
class RepoRegistryView(QDockWidget):
showMessage = pyqtSignal(QString)
@@ -278,6 +272,8 @@ # Note that we must make sure that the settings file exists before
# setting thefile watcher
if not os.path.exists(sfile):
+ if not os.path.exists(os.path.dirname(sfile)):
+ os.makedirs(os.path.dirname(sfile))
tv.model().write(sfile)
self.watcher = QFileSystemWatcher(self)
self.watcher.addPath(sfile)
@@ -642,7 +638,7 @@ clip.setText(self.selitem.internalPointer().rootpath())
def startRename(self):
- self.tview.renameSelected()
+ self.tview.edit(self.tview.currentIndex())
def newGroup(self):
self.tview.model().addGroup(_('New Group'))
|
@@ -268,8 +268,8 @@ """
Select revision 'rev' (can be anything understood by repo.changectx())
"""
- if type(rev) is QString:
- rev = str(rev)
+ if isinstance(rev, (unicode, QString)):
+ rev = hglib.fromunicode(rev)
try:
rev = self.repo.changectx(rev).rev()
except error.RepoError:
|
@@ -245,6 +245,10 @@ idx = self.namedTabs[tabname]
self.taskTabsWidget.setCurrentIndex(idx)
+ # restore default splitter position if task tab is invisible
+ if self.repotabs_splitter.sizes()[1] == 0:
+ self.repotabs_splitter.setSizes([1, 1])
+
def title(self):
"""Returns the expected title for this widget [unicode]"""
if self.bundle:
@@ -705,9 +709,8 @@ def setupModels(self):
# Filter revision set in case revisions were removed
self.revset = [r for r in self.revset if r < len(self.repo)]
- branch = hglib.fromunicode(self.ubranch)
self.repomodel = HgRepoListModel(self.repo, self.repoview.colselect[0],
- branch, self.revset,
+ self.ubranch, self.revset,
self.revsetfilter, self)
self.repomodel.filled.connect(self.modelFilled)
self.repomodel.loaded.connect(self.modelLoaded)
|
Loading...