by
Changes to 8 files · Browse files at ba04d623b63d Showing diff from parent 9acbd89ae4f1 46f94acbaedd Diff from another changeset...
@@ -352,9 +352,7 @@ '''See if an MQ patch is applied, switch to qrefresh mode'''
self.qheader = None
if self.mqmode:
- patch = self.repo.mq.lookup('qtip')
- ph = self.repo.mq.readheaders(patch)
- self.qheader = '\n'.join(ph.message)
+ self.qheader = self.repo['qtip'].description()
buf = self.text.get_buffer()
if buf.get_char_count() == 0 or not buf.get_modified():
if self.qnew:
|
@@ -575,7 +575,7 @@ cmdlist = cmdutil.findpossible(cmd, table)
if ui.verbose:
cmdlist = [' '.join(c[0]) for c in cmdlist.values()]
- ui.write("%s\n" % "\n".join(util.sort(cmdlist)))
+ ui.write("%s\n" % "\n".join(sorted(cmdlist)))
globalopts = [
('R', 'repository', '',
|
@@ -40,11 +40,9 @@ def hunk_markup(text):
'Format a diff hunk for display in a TreeView row with markup'
hunk = ""
- lines = text.splitlines()
+ lines = text.split('\n')
for line in lines:
- line = gobject.markup_escape_text(hglib.toutf(line[:512]))
- if line[-1] != '\n':
- line += '\n'
+ line = gobject.markup_escape_text(hglib.toutf(line[:512])) + '\n'
if line.startswith('---') or line.startswith('+++'):
hunk += '<span foreground="#000090">%s</span>' % line
elif line.startswith('-'):
@@ -60,11 +58,9 @@def hunk_unmarkup(text):
'Format a diff hunk for display in a TreeView row without markup'
hunk = ""
- lines = text.splitlines()
+ lines = text.split('\n')
for line in lines:
- line = gobject.markup_escape_text(hglib.toutf(line[:512]))
- if line[-1] != '\n':
- line += '\n'
+ line = gobject.markup_escape_text(hglib.toutf(line[:512])) + '\n'
hunk += line
return hunk
|
@@ -526,7 +526,6 @@ gdialog.Prompt(_('No visual editor configured'),
_('Please configure a visual editor.'), self).run()
self.focus_field('tortoisehg.editor')
- self.emit_stop_by_name('response')
return True
thread = threading.Thread(target=doedit, name='edit config')
thread.setDaemon(True)
@@ -539,10 +538,11 @@ def should_live(self, *args):
if self.dirty:
ret = gdialog.Confirm(_('Confirm quit without saving?'), [], self,
- _('Yes to abandon changes, No to continue')).run()
+ _('Yes to abandon changes, No to continue')).run()
if ret != gtk.RESPONSE_YES:
- self.emit_stop_by_name('response')
- return True
+ if len(args) != 0:
+ self.emit_stop_by_name('response')
+ return True
return False
def focus_field(self, focusfield):
|
@@ -48,6 +48,7 @@ if entry[FM_STATUS] in 'MAR':
entry[FM_CHECKED] = True
self.update_check_count()
+ self.opts['check'] = False
def save_settings(self):
@@ -180,6 +181,8 @@ hgshelve.filterpatch = filter_patch
# shelve them!
hgshelve.shelve(self.ui, self.repo, **opts)
+ self.opts['check'] = True # recheck MAR after commit
+ self.filechunks = {} # do not keep chunks
self.reload_status()
def unshelve(self):
|
@@ -101,11 +101,16 @@
def _get_path(self, appname):
if os.name == 'nt':
- return os.path.join(os.environ.get('APPDATA'), 'TortoiseHg',
- appname)
+ try:
+ import pywintypes
+ from win32com.shell import shell, shellcon
+ appdir = shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_APPDATA)
+ except (ImportError, pywintypes.com_error):
+ appdir = os.environ['APPDATA']
+ return os.path.join(appdir, 'TortoiseHg', appname)
else:
- return os.path.join(os.path.expanduser('~'), '.tortoisehg',
- appname)
+ home = os.path.expanduser('~')
+ return os.path.join(home, '.tortoisehg', appname)
def _audit(self):
if os.path.exists(os.path.dirname(self._path)):
|
|
|
@@ -10,7 +10,7 @@ std::string menuText;
std::string helpText;
std::string iconName;
- int idCmd;
+ UINT idCmd;
} MenuDescription;
MenuDescription menuDescList[] = {
@@ -111,12 +111,12 @@};
typedef std::map<std::string, MenuDescription> MenuDescriptionMap;
-typedef std::map<int, MenuDescription> MenuIdCmdMap;
+typedef std::map<UINT, MenuDescription> MenuIdCmdMap;
MenuDescriptionMap MenuDescMap;
MenuIdCmdMap MenuIdMap;
-void AddMenuList(int idCmd, const std::string& name)
+void AddMenuList(UINT idCmd, const std::string& name)
{
TDEBUG_TRACE("AddMenuList: idCmd = " << idCmd << " name = " << name);
MenuIdMap[idCmd] = MenuDescMap[name];
@@ -138,7 +138,7 @@ MenuIdMap.clear();
}
-void InsertMenuItemWithIcon(HMENU hMenu, int indexMenu, int idCmd,
+void InsertMenuItemWithIcon(HMENU hMenu, UINT indexMenu, UINT idCmd,
const std::string& menuText, const std::string& iconName)
{
MENUITEMINFO mi;
@@ -163,7 +163,7 @@ InsertMenuItem(hMenu, indexMenu, TRUE, &mi);
}
-void InsertSubMenuItemWithIcon(HMENU hMenu, HMENU hSubMenu, int indexMenu, int idCmd,
+void InsertSubMenuItemWithIcon(HMENU hMenu, HMENU hSubMenu, UINT indexMenu, UINT idCmd,
const std::string& menuText, const std::string& iconName)
{
MENUITEMINFO mi;
@@ -189,8 +189,8 @@ InsertMenuItem(hMenu, indexMenu, TRUE, &mi);
}
-void InsertMenuItemByName(HMENU hMenu, const std::string& name, int indexMenu,
- int idCmd, int idCmdFirst)
+void InsertMenuItemByName(HMENU hMenu, const std::string& name, UINT indexMenu,
+ UINT idCmd, UINT idCmdFirst)
{
TDEBUG_TRACE("InsertMenuItemByName: name = " << name);
MenuDescriptionMap::iterator iter = MenuDescMap.find(name);
@@ -200,7 +200,7 @@ return;
}
- MenuDescription md = MenuDescMap[name];
+ MenuDescription md = iter->second;
AddMenuList(idCmd - idCmdFirst, name);
InsertMenuItemWithIcon(hMenu, indexMenu, idCmd, md.menuText, md.iconName);
}
@@ -302,7 +302,7 @@ HMENU hSubMenu = CreatePopupMenu();
if (hSubMenu)
{
- int indexSubMenu = 0;
+ UINT indexSubMenu = 0;
for( walk = entries ; *walk != EndOfList ; walk++ )
{
if( *walk == Separator )
@@ -338,7 +338,7 @@ MenuIdCmdMap::iterator iter = MenuIdMap.find(idCmd);
if(iter != MenuIdMap.end())
{
- DoHgtk(MenuIdMap[idCmd].name);
+ DoHgtk(iter->second.name);
hr = NOERROR;
}
else
@@ -350,18 +350,18 @@}
STDMETHODIMP
-CShellExt::GetCommandString(UINT idCmd, UINT uFlags, UINT FAR *reserved,
+CShellExt::GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT FAR *reserved,
LPSTR pszName, UINT cchMax)
{
*pszName = 0;
char *psz;
TDEBUG_TRACE("CShellExt::GetCommandString: idCmd = " << idCmd);
- MenuIdCmdMap::iterator iter = MenuIdMap.find(idCmd);
+ MenuIdCmdMap::iterator iter = MenuIdMap.find(static_cast<UINT>(idCmd));
if (iter != MenuIdMap.end())
{
- TDEBUG_TRACE("CShellExt::GetCommandString: name = " << MenuIdMap[idCmd].name);
- psz = (char*)MenuIdMap[idCmd].helpText.c_str();
+ TDEBUG_TRACE("CShellExt::GetCommandString: name = " << iter->second.name);
+ psz = (char*)iter->second.helpText.c_str();
}
else
{
|
@@ -79,7 +79,7 @@ // IContextMenu3
STDMETHODIMP QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi);
- STDMETHODIMP GetCommandString(UINT idCmd, UINT uFlags, UINT FAR *reserved, LPSTR pszName, UINT cchMax);
+ STDMETHODIMP GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT FAR *reserved, LPSTR pszName, UINT cchMax);
STDMETHODIMP HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
STDMETHODIMP HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult);
|
Loading...