by
Changes to 5 files · Browse files at 32f72ec98922 Showing diff from parent baafd54e400f 181a4945dbab Diff from another changeset...
@@ -14,6 +14,7 @@ import nautilus
import gnomevfs
import os
+import sys
try:
from mercurial import demandimport
@@ -26,7 +27,6 @@demandimport.enable()
import subprocess
-import sys
import urllib
from mercurial import hg, ui, match, util
|
@@ -846,10 +846,9 @@ return
wfile = self.filemodel[paths[0]][FM_PATH]
difftext = [_('===== Diff to first parent =====\n')]
- wfiles = [self.repo.wjoin(wfile)]
wctx = self.repo[None]
pctxs = wctx.parents()
- matcher = cmdutil.match(self.repo, wfiles, self.opts)
+ matcher = cmdutil.matchfiles(self.repo, [wfile])
for s in patch.diff(self.repo, pctxs[0].node(), None,
match=matcher, opts=patch.diffopts(self.ui, self.opts)):
difftext.extend(s.splitlines(True))
@@ -916,8 +915,7 @@ difftext.writelines(lines)
difftext.seek(0)
else:
- wfiles = [self.repo.wjoin(wfile)]
- matcher = cmdutil.match(self.repo, wfiles, self.opts)
+ matcher = cmdutil.matchfiles(self.repo, [wfile])
diffopts = mdiff.diffopts(git=True, nodates=True)
for s in patch.diff(self.repo, self._node1, self._node2,
match=matcher, opts=diffopts):
|
@@ -6,6 +6,7 @@ import sys
import time
import threading
+import cStringIO
import Queue
from win32api import *
@@ -22,7 +23,7 @@from mercurial import demandimport
demandimport.ignore.append('win32com.shell')
demandimport.enable()
-from mercurial import ui
+from mercurial import ui, error
from thgutil import thread2, paths, shlib
if hasattr(sys, "frozen"):
@@ -59,7 +60,7 @@ action = NIM_ADD
try:
Shell_NotifyIcon(action, nid)
- except error:
+ except e:
# This is common when windows is starting, and this code is hit
# before the taskbar has been created.
print "Failed to add the taskbar icon - is explorer running?"
@@ -238,20 +239,32 @@ if roots:
_ui = ui.ui();
failedroots = set()
- for r in sorted(roots):
- try:
- shlib.update_thgstatus(_ui, r, wait=False)
- shlib.shell_notify([r])
- logger.msg('Updated ' + r)
- except (IOError, OSError):
- print "IOError or OSError on updating %s (check permissions)" % r
- logger.msg('Failed updating %s (check permissions)' % r)
- failedroots.add(r)
- notifypaths -= failedroots
- if notifypaths:
- time.sleep(2)
- shlib.shell_notify(list(notifypaths))
- logger.msg('Shell notified')
+ errorstream = cStringIO.StringIO()
+ _stderr = sys.stderr
+ sys.stderr = errorstream
+ try:
+ for r in sorted(roots):
+ try:
+ shlib.update_thgstatus(_ui, r, wait=False)
+ shlib.shell_notify([r])
+ logger.msg('Updated ' + r)
+ except (IOError, OSError):
+ print "IOError or OSError on updating %s (check permissions)" % r
+ logger.msg('Failed updating %s (check permissions)' % r)
+ failedroots.add(r)
+ except (error.Abort, error.ConfigError, error.RepoError), e:
+ logger.msg('Failed updating %s (%s)' % (r, str(e)))
+ failedroots.add(r)
+ notifypaths -= failedroots
+ if notifypaths:
+ time.sleep(2)
+ shlib.shell_notify(list(notifypaths))
+ logger.msg('Shell notified')
+ errmsg = errorstream.getvalue()
+ if errmsg:
+ logger.msg('stderr: %s' % errmsg)
+ finally:
+ sys.stderr = _stderr
requests = Queue.Queue(0)
|
@@ -89,6 +89,9 @@ {"guess", "Guess Renames",
"Detect renames and copies",
"detect_rename.ico", 0},
+ {"grep", "Search History",
+ "Search file revisions for patterns",
+ "menurepobrowse.ico", 0},
/* Add new items here */
@@ -101,7 +104,7 @@{
Commit, Init, Clone, Status, Shelve, Add, Revert, Remove, Rename,
Log, Synch, Serve, Update, Recover, Thgstatus, Userconf, Repoconf,
- About, Datamine, VDiff, Ignore, Guess,
+ About, Datamine, VDiff, Ignore, Guess, Grep,
/* Add new items here */
Separator, EndOfList
};
@@ -109,7 +112,7 @@menuDescListEntries RepoNoFilesMenu[] =
{
Commit, Status, Shelve, VDiff, Separator,
- Log, Update, Datamine, Thgstatus, Separator,
+ Log, Update, Grep, Thgstatus, Separator,
Synch, Serve, Clone, Init, Separator,
Ignore, Guess, Recover, Separator,
Repoconf, Userconf, Separator,
|
|
|
Loading...