Repository Access and Command Execution
RepoManagermanages life-cycle of
RepoAgentand its filesystem monitor.
repositoryobject instead of extending it to thgrepository.
CmdAgent) will receive all command requests and run them in sequence.
- Provides consistent unicode APIs
RepoAgent and its backend,
CmdAgent, provide the same APIs to execute
Mercurial commands asynchronously.
runCommandSequence([cmdline, ...]) start or queue
the specified command and return new
CmdSession object which will provide
def __init__(self, ...): ... self._cmdsession = cmdcore.nullCmdSession() def runUpdate(self): if not self._cmdsession.isFinished(): return # command still running cmdline = hglib.buildcmdargs('update', rev='.') self._cmdsession = sess = self._repoagent.runCommand(cmdline, self) sess.commandFinished.connect(self._onUpdateFinished) @pyqtSlot(int) def _onUpdateFinished(self, ret): if ret != 0: cmdui.errorMessageBox(self._cmdsession, self) ...
The relation between
CmdSession is similar to the one
By default, all command outputs are propagated through
This is very inefficient for transferring large chunks.
There are two alternative APIs:
sess.setCaptureOutput(True)enables in-memory output buffer. All data outputs (excluding ui messages) are buffered by
CmdSessionand can later be read by
sess.setOutputDevice(device)redirects all data outputs to the specified
QIODevice. It can be used to write outputs to
CmdThread (default < 3.1, removed at 3.2)
- lightweight and feature-rich
- cannot abort on I/O stall, #1507
- has several thread issues like
- high overhead (especially on Windows)
- no interactive prompt
CmdServer (default >= 3.1)
- need to manage server process
CmdControlDialogfor one-shot command with configurable parameters
(e.g. "archive", "clone", "update")
CmdSessionDialogfor log window of started command
(e.g. "verify", hidden log window of "quickop")
CmdSessionControlWidgetto implement dialog which needs unusual handling
(e.g. "compress", "import", "rebase")
(e.g. "commit", "sync")
TODO: add utility for tag-like dialogs?
RepoManagerand stub for
- redesign command API of
#1783- thg keeps a ref to a folderrepo for too long ? #1571- disable filesystem monitor while command running
- new per-repository command runner which manages busy state and command queue
cmdui.Dialoghas been replaced by the new command runner
- run web server in separate process
cmdui.Widgetby new command runner
- remove manual busy counting,
- almost all widgets receive
RepoAgentin place of raw
- move shortname and displayname to
cmdcore.CmdAgentso that it can read user configuration
#2208- Support --config argument for 'thg workbench'
RepoAgentof subrepo through main's
- extract reusable
- add experimental command server client which uses
ui.errorlabel in command server
- use command server by default
#3343- Blackbox extension not working when using hg from within TortoiseHg #1661- "abort: Interrupted system" call during push with subrepos #2071- crash when pushing with mercurial_keyring #2614-
util.hgexecutable()returns wrong path
- 074fd0fde0b6 - worker.py of Mercurial 2.6 only works in main thread
#484- Can't update to any revision (SVN subrepo) #788- Can't use git repo #3637- Redirect hook stdout, stderr to Output log
#3370- Workbench UI getting dispresponsive on certain operations
- switch bundlerepo (and unionrepo) globally by RepoAgent
--hiddenflag globally by RepoAgent
#3735- obosoleted changeset appears as "Child:" field unexpectedly
- add API to capture raw command output without emitting
outputReceived()(for email preview, revset query, export to clipboard, etc.)
- replace threaded revset query
- reimplement wctxactions by using command APIs
movemqpatchesas extension command,
factor out change notification signals
global abort button (
hg initin command server
- shutdown app gracefully by
- stop command server before closing clone/init dialog
- busy progress (
hg annotate -Tpicklefor thread safety
In 3.3.1 (unreleased):
better handling of unicode error
short-term (in 3.4?):
- fine-tune change notification for MQ
- add API to connect
QIODeviceto "I" channel of command server (in order to replace use of temporary files)
ui.edit()for histedit or rebase --edit?
command runner for clone, init and bulk sync operation
fetch log and calculate revision graph asynchronously
- template-based log columns (e.g.
purge.CheckThreadwhich isn't thread-safe
visdiff.visualdiffwhich isn't thread-safe
hg grepin command process
ManifestModelfetch status asynchronously
- remove global cache of
- keep dirstate/wctx up-to-date by RepoAgent?
- better control of
- provide read/write config API
- reload root ui object when global setting is changed?
- how to call workbench from sub dialogs?
- don't propagate data output by slow signal (always send data through
- command server over ssh link
- show command to be executed in log widget instead of separate "Hg command" text box
Issues to Consider
- #1469 - RevlogError on strip, rebase, collapse, etc.
hidden, union repo:
- #2552 - compare branch from different repos
- #3226 - IOError while trying to commit
- #532 - Long operations block UI (Qt)
- #1738 - Add option to hide close branch commit
- #1991 - Highlight parents of merge
- #2038 - Local Time log column should be MY local time
- #2264 - Allow to export the log view content to file/clipboard
- #4033 - graph: highlight ancestors of selected revision
- #4099 - Updated dynamic tags not updating in GUI (hg-git)
- #4139 - Crash when stripping last changeset of branch included in filter
- #4173 - fetch revset results per batch size ...
auto-refresh working status:
#3706- No automatic refresh after Import to working copy #3981- No refresh after undo/rollback ...
- #3621 - Shelve tool does not always know about added/removed files
- #3670 - WindowsError 6 in pipe decode/encode filter
child to workbench:
- #2354 - "Folder History" in revision browser does nothing
bulk push/pull and polling:
- #456 - Allow multiple push/pull in Hg Workbench
- #799 - Workbench: Check each repo for new incoming changelists
- #1348 - Mark repositories with uncommited/unpushed changes in repository registry
#1951- Add to the toolbar visible number of incoming and outgoing revisions