Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

merge with stable

Changeset 123d0de9e1d4

Parents 441c8397f498

Parents d8d82873ae14

by Steve Borho

Changes to 7 files · Browse files at 123d0de9e1d4 Showing diff from parent 441c8397f498 d8d82873ae14 Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​backout.py Stacked
 
92
93
94
95
96
97
98
 
 
 
 
99
100
101
 
102
103
 
104
105
106
 
110
111
112
113
 
114
115
116
 
92
93
94
 
 
 
 
95
96
97
98
99
100
 
101
102
 
103
104
105
106
 
110
111
112
 
113
114
115
116
@@ -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
7
 
8
9
10
 
417
418
419
 
420
421
422
 
616
617
618
 
619
620
621
622
 
623
 
5
6
7
8
9
10
11
 
418
419
420
421
422
423
424
 
618
619
620
621
622
623
624
625
626
627
@@ -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();  }
Change 1 of 1 Show Entire File win32/​shellext/​InitStatus.cpp Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@@ -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; +}
Change 1 of 1 Show Entire File win32/​shellext/​InitStatus.h Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@@ -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
7
 
8
9
10
 
5
6
7
8
9
10
11
@@ -5,6 +5,7 @@
  Winstat.o    OBJECTS_THGSGELL = $(OBJECTS_DIRSTATE) \ + InitStatus.o \   ContextMenu.o \   IconOverlay.o \   ShellExt.o \
 
5
6
7
 
8
9
10
 
5
6
7
8
9
10
11
@@ -5,6 +5,7 @@
  Winstat.obj    OBJECTS_THGSGELL = $(OBJECTS_DIRSTATE) \ + InitStatus.obj \   ContextMenu.obj \   IconOverlay.obj \   ShellExt.obj \
 
2
3
4
 
5
6
7
 
53
54
55
 
 
 
56
57
58
 
76
77
78
 
79
80
81
 
83
84
85
 
86
87
88
 
90
91
92
 
93
94
95
 
97
98
99
 
100
101
102
 
2
3
4
5
6
7
8
 
54
55
56
57
58
59
60
61
62
 
80
81
82
83
84
85
86
 
88
89
90
91
92
93
94
 
96
97
98
99
100
101
102
 
104
105
106
107
108
109
110
@@ -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);   }