by
Changes to 7 files · Browse files at 123d0de9e1d4 Showing diff from parent 441c8397f498 d8d82873ae14 Diff from another changeset...
@@ -92,15 +92,15 @@ summary = ctx.description().replace('\0', '')
summary = summary.split('\n')[0]
escape = gtklib.markup_escape_text
- desc = '<b>' + _('rev') + '</b>\t\t: %s\n' % escape(revstr)
- desc += '<b>' + _('summary') + '</b>\t: %s\n' % escape(summary[:80])
- desc += '<b>' + _('user') + '</b>\t\t: %s\n' % escape(ctx.user())
- desc += '<b>' + _('date') + '</b>\t\t: %s\n' % escape(hglib.displaytime(ctx.date()))
+ desc = '<b>' + hglib.fromutf(_('rev')) + '</b>\t\t: %s\n' % escape(revstr)
+ desc += '<b>' + hglib.fromutf(_('summary')) + '</b>\t: %s\n' % escape(summary[:80])
+ desc += '<b>' + hglib.fromutf(_('user')) + '</b>\t\t: %s\n' % escape(ctx.user())
+ desc += '<b>' + hglib.fromutf(_('date')) + '</b>\t\t: %s\n' % escape(hglib.displaytime(ctx.date()))
node = repo.lookup(revid)
tags = repo.nodetags(node)
- desc += '<b>' + _('branch') + '</b>\t: ' + escape(ctx.branch())
+ desc += '<b>' + hglib.fromutf(_('branch')) + '</b>\t: ' + escape(ctx.branch())
if tags:
- desc += '\n<b>' + _('tags') + '</b>\t\t: ' + escape(', '.join(tags))
+ desc += '\n<b>' + hglib.fromutf(_('tags')) + '</b>\t\t: ' + escape(', '.join(tags))
return hglib.toutf(desc)
def set_notify_func(self, func, *args):
@@ -110,7 +110,7 @@ def backout(self, button, buf, revstr):
start, end = buf.get_bounds()
msg = buf.get_text(start, end)
- cmdline = ['hg', 'backout', '--rev', revstr, '--message', msg]
+ cmdline = ['hg', 'backout', '--rev', revstr, '--message', hglib.fromutf(msg)]
dlg = hgcmd.CmdDialog(cmdline)
dlg.show_all()
dlg.run()
|
@@ -5,6 +5,7 @@ #include "Dirstatecache.h"
#include "Thgstatus.h"
#include "Winstat.h"
+#include "InitStatus.h"
#include <map>
@@ -417,6 +418,7 @@
InsertMenu(hMenu, indexMenu++, MF_SEPARATOR | MF_BYPOSITION, 0, NULL);
+ InitStatus::check();
return ResultFromShort(idCmd - idCmdFirst);
}
@@ -616,8 +618,10 @@ if (cmd == "thgstatus")
{
Thgstatus::remove(cwd);
+ InitStatus::check();
return;
}
LaunchCommand(hgcmd, cwd);
+ InitStatus::check();
}
|
|
@@ -0,0 +1,58 @@ +
+// Copyright (C) 2009 Adrian Buehlmann
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+#include "stdafx.h"
+
+#include "InitStatus.h"
+
+
+InitStatus& InitStatus::inst()
+{
+ static InitStatus s;
+ return s;
+}
+
+
+void InitStatus::add(std::string& s, const char* missing)
+{
+ if (!s.empty())
+ s += ", ";
+ s += missing;
+}
+
+
+std::string InitStatus::check()
+{
+ const InitStatus& self = inst();
+ std::string missing;
+
+ if (self.unchanged_ == 0)
+ add(missing, "unchanged");
+ if (self.added_ == 0)
+ add(missing, "added");
+ if (self.modified_ == 0)
+ add(missing, "modified");
+ if (self.notinrepo_ == 0)
+ add(missing, "notinrepo");
+
+ if (missing.empty())
+ return "";
+
+ std::string res = "InitStatus: error: uninitialized handlers: ";
+ res += missing;
+ TDEBUG_TRACE("***** " << res);
+ return res;
+}
|
|
@@ -0,0 +1,35 @@ +
+// Copyright (C) 2009 Adrian Buehlmann
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+#include <string>
+
+class InitStatus
+{
+public:
+ int unchanged_;
+ int added_;
+ int modified_;
+ int notinrepo_;
+
+ static InitStatus& inst();
+ static std::string check();
+
+private:
+ InitStatus()
+ : unchanged_(0), added_(0), modified_(0), notinrepo_(0) {}
+
+ static void add(std::string& s, const char* missing);
+};
|
@@ -5,6 +5,7 @@ Winstat.o
OBJECTS_THGSGELL = $(OBJECTS_DIRSTATE) \
+ InitStatus.o \
ContextMenu.o \
IconOverlay.o \
ShellExt.o \
|
@@ -5,6 +5,7 @@ Winstat.obj
OBJECTS_THGSGELL = $(OBJECTS_DIRSTATE) \
+ InitStatus.obj \
ContextMenu.obj \
IconOverlay.obj \
ShellExt.obj \
|
@@ -2,6 +2,7 @@ #include "ShellExt.h"
#include "TortoiseUtils.h"
#include "StringUtils.h"
+#include "InitStatus.h"
#include <olectl.h>
#define INITGUID
@@ -53,6 +54,9 @@ _UnloadResources();
}
+ if (g_cRefThisDll > 0)
+ InitStatus::check();
+
return 1;
}
@@ -76,6 +80,7 @@ CDllRegSxClassFactory *pcf =
new CDllRegSxClassFactory(TORTOISE_OLE_UNCHANGED);
TDEBUG_TRACE("DllGetClassObject clsname = " << "CLSID_TortoiseHg0");
+ ++InitStatus::inst().unchanged_;
return pcf->QueryInterface(riid, ppvOut);
}
else if (IsEqualIID(rclsid, CLSID_TortoiseHg1))
@@ -83,6 +88,7 @@ CDllRegSxClassFactory *pcf =
new CDllRegSxClassFactory(TORTOISE_OLE_ADDED);
TDEBUG_TRACE("DllGetClassObject clsname = " << "CLSID_TortoiseHg1");
+ ++InitStatus::inst().added_;
return pcf->QueryInterface(riid, ppvOut);
}
else if (IsEqualIID(rclsid, CLSID_TortoiseHg2))
@@ -90,6 +96,7 @@ CDllRegSxClassFactory *pcf =
new CDllRegSxClassFactory(TORTOISE_OLE_MODIFIED);
TDEBUG_TRACE("DllGetClassObject clsname = " << "CLSID_TortoiseHg2");
+ ++InitStatus::inst().modified_;
return pcf->QueryInterface(riid, ppvOut);
}
else if (IsEqualIID(rclsid, CLSID_TortoiseHg6))
@@ -97,6 +104,7 @@ CDllRegSxClassFactory *pcf =
new CDllRegSxClassFactory(TORTOISE_OLE_NOTINREPO);
TDEBUG_TRACE("DllGetClassObject clsname = " << "CLSID_TortoiseHg6");
+ ++InitStatus::inst().notinrepo_;
return pcf->QueryInterface(riid, ppvOut);
}
|
Loading...