Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph

Merge with stable

Changeset acf33fe36841

Parents 3ea676a4bfc5

Parents 40846ddb2223

by Steve Borho

Changes to 22 files · Browse files at acf33fe36841 Showing diff from parent 3ea676a4bfc5 40846ddb2223 Diff from another changeset...

Change 1 of 1 Show Entire File thg Stacked
 
60
61
62
 
63
64
65
66
67
68
69
 
70
71
72
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
61
62
63
64
65
66
67
68
69
 
70
71
72
 
 
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
@@ -60,14 +60,46 @@
 from tortoisehg.util.hgversion import hgversion, checkhgversion  errmsg = checkhgversion(hgversion)  if errmsg: + from mercurial import ui   from tortoisehg.hgqt.bugreport import run   from tortoisehg.hgqt.run import qtrun   opts = {}   opts['cmd'] = ' '.join(sys.argv[1:])   opts['error'] = '\n' + errmsg + '\n'   opts['nofork'] = True - qtrun(run, ui, **opts) + qtrun(run, ui.ui(), **opts)   sys.exit(1)   -ret = tortoisehg.hgqt.run.dispatch(sys.argv[1:]) -sys.exit(ret) +if 'THGDEBUG' in os.environ or '--profile' in sys.argv: + sys.exit(tortoisehg.hgqt.run.dispatch(sys.argv[1:])) +else: + import cStringIO + mystderr = cStringIO.StringIO() + origstderr = sys.stderr + sys.stderr = mystderr + ret = 0 + try: + ret = tortoisehg.hgqt.run.dispatch(sys.argv[1:]) + sys.stderr = origstderr + stderrout = mystderr.getvalue() + errors = ('Traceback', 'TypeError', 'NameError', 'AttributeError', + 'NotImplementedError') + for l in stderrout.splitlines(): + if l.startswith(errors): + from mercurial import ui + from tortoisehg.hgqt.bugreport import run + from tortoisehg.hgqt.run import qtrun + opts = {} + opts['cmd'] = ' '.join(sys.argv[1:]) + opts['error'] = 'Recoverable error (stderr):\n' + stderrout + opts['nofork'] = True + qtrun(run, ui.ui(), **opts) + break + sys.exit(ret) + except: + if sys.exc_info()[0] not in [SystemExit, KeyboardInterrupt]: + import traceback + sys.stderr = origstderr + traceback.print_exc() + else: + raise SystemExit(ret)
 
542
543
544
 
545
546
547
 
542
543
544
545
546
547
548
@@ -542,6 +542,7 @@
  def __init__(self, repo, parent):   super(ResultPage, self).__init__(repo, parent)   self.setTitle(_('Finished')) + self.setSubTitle(' ')   self.setFinalPage(True)     self.setLayout(QVBoxLayout())
 
12
13
14
15
 
16
17
18
 
12
13
14
 
15
16
17
18
@@ -12,7 +12,7 @@
 #  # You should have received a copy of the GNU General Public License along with  # this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.    """  Qt4 widgets to display diffs as blocks
 
246
247
248
 
 
249
250
251
 
246
247
248
249
250
251
252
253
@@ -246,6 +246,8 @@
  self.proxy_chk.setVisible(visible)   self.insecure_chk.setVisible(visible)   self.qclone_chk.setVisible(visible) + self.qclone_txt.setVisible(visible) + self.qclone_btn.setVisible(visible)   self.remote_chk.setVisible(visible)   self.remote_text.setVisible(visible)   self.startrev_chk.setVisible(visible and self.startrev_available())
 
12
13
14
15
 
16
17
18
 
12
13
14
 
15
16
17
18
@@ -12,7 +12,7 @@
 #  # You should have received a copy of the GNU General Public License along with  # this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.  """  Qt4 dialogs to display hg revisions of a file  """
 
12
13
14
15
 
16
17
18
 
12
13
14
 
15
16
17
18
@@ -12,7 +12,7 @@
 #  # You should have received a copy of the GNU General Public License along with  # this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.    from tortoisehg.util import hglib, patchctx  
 
12
13
14
15
 
16
17
18
 
12
13
14
 
15
16
17
18
@@ -12,7 +12,7 @@
 #  # You should have received a copy of the GNU General Public License along with  # this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.    import os  
 
12
13
14
15
 
16
17
18
 
12
13
14
 
15
16
17
18
@@ -12,7 +12,7 @@
 #  # You should have received a copy of the GNU General Public License along with  # this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.    from tortoisehg.hgqt.repomodel import HgRepoListModel, COLUMNHEADERS  from tortoisehg.hgqt.graph import Graph, filelog_grapher
 
490
491
492
493
494
 
495
496
497
 
490
491
492
 
 
493
494
495
496
@@ -490,8 +490,7 @@
  if self._fd:   self._fd = None   self._diffs = [] - self._linestoprocess = \ - hglib.fromunicode(self.sci.text()).splitlines() + self._linestoprocess = unicode(self.sci.text()).splitlines()   self._firstlinetoprocess = 0   self._opcodes = True   # Process linesPerBlock lines at a time
 
12
13
14
15
 
16
17
18
 
12
13
14
 
15
16
17
18
@@ -12,7 +12,7 @@
 #  # You should have received a copy of the GNU General Public License along with  # this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.    """helper functions and classes to ease hg revision graph building  
 
12
13
14
15
 
16
17
18
 
12
13
14
 
15
16
17
18
@@ -12,7 +12,7 @@
 #  # You should have received a copy of the GNU General Public License along with  # this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.  """  Qt4 QToolBar-based class for quick bars XXX  """
 
12
13
14
15
 
16
17
18
 
12
13
14
 
15
16
17
18
@@ -12,7 +12,7 @@
 #  # You should have received a copy of the GNU General Public License along with  # this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.    from mercurial import util, error  from mercurial.util import propertycache
 
12
13
14
15
 
16
17
18
 
12
13
14
 
15
16
17
18
@@ -12,7 +12,7 @@
 #  # You should have received a copy of the GNU General Public License along with  # this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.    from mercurial import error  
 
265
266
267
268
269
 
270
271
272
 
265
266
267
 
 
268
269
270
271
@@ -265,8 +265,7 @@
  qtlib.ErrorMsgBox(_('File already exists'),   _('A shelf file of that name already exists'))   return - f = open(shelfpath, "wb") - f.close() + self.repo.makeshelf(shelve)   self.showMessage(_('New shelf created'))   self.refreshCombos()   if shelfpath in self.shelves:
 
476
477
478
 
 
 
 
 
 
479
480
481
 
476
477
478
479
480
481
482
483
484
485
486
487
@@ -476,6 +476,12 @@
  os.path.isfile(os.path.join(self.shelfdir, s))]   return []   + def makeshelf(self, patch): + if not os.path.exists(self.shelfdir): + os.mkdir(self.shelfdir) + f = open(os.path.join(self.shelfdir, patch), "wb") + f.close() +   def thginvalidate(self):   'Should be called when mtime of repo store/dirstate are changed'   self.dirstate.invalidate()
 
308
309
310
311
 
 
312
313
314
 
544
545
546
547
 
548
549
550
 
308
309
310
 
311
312
313
314
315
 
545
546
547
 
548
549
550
551
@@ -308,7 +308,8 @@
  nullfile = os.path.join(qtlib.gettempdir(), 'empty')   fp = open(nullfile, 'w')   fp.close() - return _nonexistant+label, nullfile + return (hglib.fromunicode(_nonexistant, 'replace') + label, + nullfile)     # If only one change, diff the files instead of the directories   # Handle bogus modifies correctly by checking if the files exist @@ -544,7 +545,7 @@
  nullfile = os.path.join(qtlib.gettempdir(), 'empty')   fp = open(nullfile, 'w')   fp.close() - return _nonexistant, nullfile + return hglib.fromunicode(_nonexistant, 'replace'), nullfile     local, file1a = getfile(ctx1a, dir1a, fname, source)   if ctx1b:
 
12
13
14
15
 
16
17
18
 
12
13
14
 
15
16
17
18
@@ -12,7 +12,7 @@
 #  # You should have received a copy of the GNU General Public License  # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    import gtk  from tortoisehg.util.i18n import _
 
12
13
14
15
 
16
17
18
 
94
95
96
97
 
98
99
100
 
12
13
14
 
15
16
17
18
 
94
95
96
 
97
98
99
100
@@ -12,7 +12,7 @@
   # You should have received a copy of the GNU General Public License  # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA  import sys, math    def _days(ctx, now): @@ -94,7 +94,7 @@
    def saturate_v(self, saturation, hv):   return int(255 - (saturation/3*(1-hv))) - +   def committer_angle(self, committer):   angle = float(abs(hash(committer))) / sys.maxint * 360.0   if self._maxhues is None:
 
27
28
29
30
 
31
32
33
 
27
28
29
 
30
31
32
33
@@ -27,7 +27,7 @@
  if vers == reqver or len(vers) < 2:   return   nextver = list(reqver) - nextver[1] = chr(ord(reqver[1])+1) + nextver[1] = str(int(reqver[1])+1)   if vers == nextver:   return   return (('This version of TortoiseHg requires Mercurial '
 
45
46
47
48
49
50
 
 
 
 
 
 
 
 
 
 
 
 
 
51
52
53
 
45
46
47
 
 
 
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@@ -45,9 +45,19 @@
    std::string path = WideToMultibyte(lowerpath.c_str());   - if (GetRegistryConfig("LocalDisksOnly", cval) != 0 && cval != "0" - && PathIsNetworkPath(path.c_str())) - return S_FALSE; + if (GetRegistryConfig("LocalDisksOnly", cval) != 0 && cval != "0") + { + if (::PathIsNetworkPath(path.c_str())) + return S_FALSE; + + if (path.size() > 2 && path[1] == ':') + { + std::string t = "C:\\"; + t[0] = path[0]; + if (::GetDriveType(t.c_str()) == 4) + return S_FALSE; + } + }     char filterStatus = 0;   if (myTortoiseClass == 'A')
 
13
14
15
16
 
17
18
19
 
36
37
38
39
 
40
41
42
 
49
50
51
52
 
53
54
55
56
 
57
58
59
 
13
14
15
 
16
17
18
19
 
36
37
38
 
39
40
41
42
 
49
50
51
 
52
53
54
55
 
56
57
58
59
@@ -13,7 +13,7 @@
   // You should have received a copy of the GNU General Public License  // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.    #include "StringUtils.h"   @@ -36,7 +36,7 @@
  CodePage, 0, wide.c_str(), static_cast<int>(wide.length()),   NULL, 0, NULL, NULL   ); - +   std::vector<CHAR> narrow(ret + 1);     ret = WideCharToMultiByte( @@ -49,11 +49,11 @@
 }     -// Convert multibyte string to Unicode string +// Convert multibyte string to Unicode string  std::wstring MultibyteToWide(const std::string& multibyte, UINT CodePage)  {   int ret = MultiByteToWideChar( - CodePage, 0, multibyte.c_str(), + CodePage, 0, multibyte.c_str(),   static_cast<int>(multibyte.length()), 0, 0   );  
 
13
14
15
16
 
17
18
19
 
27
28
29
30
 
31
32
33
 
13
14
15
 
16
17
18
19
 
27
28
29
 
30
31
32
33
@@ -13,7 +13,7 @@
   // You should have received a copy of the GNU General Public License  // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.    #ifndef _STRING_UTILS_H  #define _STRING_UTILS_H @@ -27,7 +27,7 @@
 // Convert Unicode string to multibyte string  std::string WideToMultibyte(const std::wstring& wide, UINT CodePage = CP_ACP);   -// Convert multibyte string to Unicode string +// Convert multibyte string to Unicode string  std::wstring MultibyteToWide(const std::string& multibyte, UINT CodePage = CP_ACP);