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

fogcreek Merge with stable

Changeset dccecd4275b3

Parents d74af1d325e1

Parents 9cd2c612d391

by David Golub

Changes to 12 files · Browse files at dccecd4275b3 Showing diff from parent d74af1d325e1 9cd2c612d391 Diff from another changeset...

 
214
215
216
217
 
218
219
220
 
485
486
487
488
 
489
490
491
 
495
496
497
498
 
499
500
501
 
214
215
216
 
217
218
219
220
 
485
486
487
 
488
489
490
491
 
495
496
497
 
498
499
500
501
@@ -214,7 +214,7 @@
  _('Open the selected subrepository in a file browser'),   self.explore),   ('terminal', _('Open terminal in subrepository'), - 'utilities-terminal', 'Alt+Ctrl+T', + 'utilities-terminal', 'Alt+Ctrl+T',   _('Open a shell terminal in the selected subrepository root'),   self.terminal),   ]: @@ -485,7 +485,7 @@
  def setPath(self, path):   """Change path to show"""   self._treeview.setCurrentIndex(self._treemodel.indexFromPath(path)) - +   def displayFile(self):   ctx, path = self._treemodel.fileSubrepoCtxFromPath(self.path)   if ctx is None: @@ -495,7 +495,7 @@
  ctx._repo.maxdiff = self._repo.maxdiff   self._fileview.setContext(ctx)   self._fileview.displayFile(path, self.status) - +   @pyqtSlot()   def _updatecontent(self):   self.displayFile()
 
62
63
64
65
 
66
67
68
 
313
314
315
316
 
317
318
 
319
320
321
 
62
63
64
 
65
66
67
68
 
313
314
315
 
316
317
 
318
319
320
321
@@ -62,7 +62,7 @@
  """Return the subrepo context of the specified index"""   path = self.filePath(index)   return self.fileSubrepoCtxFromPath(path) - +   def fileSubrepoCtxFromPath(self, path):   """Return the subrepo context of the specified file"""   if not path: @@ -313,9 +313,9 @@
  srepo = sub._repo   if srev in srepo:   sctx = srepo[srev] - +   self._subinfo[toprelpath]['ctx'] = sctx - +   # Add the subrepo contents to the tree   e = addrepocontentstotree(e, sctx, toprelpath)  
 
31
32
33
34
 
 
 
35
36
37
 
48
49
50
 
51
52
53
 
143
144
145
 
 
 
 
 
 
 
 
 
 
31
32
33
 
34
35
36
37
38
39
 
50
51
52
53
54
55
56
 
146
147
148
149
150
151
152
153
154
155
156
157
@@ -31,7 +31,9 @@
  self.setAutoCompletionSource(QsciScintilla.AcsAPIs)   self.setAutoCompletionFillupsEnabled(True)   self.setLexer(QsciLexerMakefile(self)) - self.lexer().setFont(qtlib.getfont('fontcomment').font()) + font = qtlib.getfont('fontcomment').font() + self.fontHeight = QFontMetrics(font).height() + self.lexer().setFont(font)   self.lexer().setColor(QColor(Qt.red), QsciLexerMakefile.Error)   self.setMatchedBraceBackgroundColor(Qt.yellow)   self.setIndentationsUseTabs(False) @@ -48,6 +50,7 @@
  self.setContextMenuPolicy(Qt.CustomContextMenu)   self.customContextMenuRequested.connect(self.menuRequested)   +   def menuRequested(self, point):   line = self.lineAt(point)   point = self.viewport().mapToGlobal(point) @@ -143,3 +146,12 @@
  super(MessageEntry, self).keyPressEvent(newev)   else:   super(MessageEntry, self).keyPressEvent(event) + + def resizeEvent(self, event): + super(MessageEntry, self).resizeEvent(event) + self.showHScrollBar(self.frameGeometry().height() > self.fontHeight * 3) + + def minimumSizeHint(self): + size = super(MessageEntry, self).minimumSizeHint() + size.setHeight(self.fontHeight * 3 / 2) + return size
 
305
306
307
 
 
 
308
309
310
 
305
306
307
308
309
310
311
312
313
@@ -305,6 +305,9 @@
  self.SendScintilla(self.SCI_INDICSETALPHA, id, 100)   return id   + def showHScrollBar(self, show=True): + self.SendScintilla(self.SCI_SETHSCROLLBAR, show) +  class SearchToolBar(QToolBar):   conditionChanged = pyqtSignal(unicode, bool, bool)   """Emitted (pattern, icase, wrap) when search condition changed"""
 
224
225
226
 
227
228
229
 
224
225
226
227
228
229
230
@@ -224,6 +224,7 @@
  self.portentry.setAcceptDrops(False)   self.portentry.setToolTip(_('Port'))   self.portentry.setFixedWidth(8 * fontm.width('9')) + self.portentry.setValidator(QIntValidator(0, 65536, self.portentry))   self.portentry.textChanged.connect(self.refreshUrl)   tbar.addWidget(self.portentry)   tbar.addWidget(qtlib.Spacer(2, 2))
 
519
520
521
522
 
523
524
525
 
519
520
521
 
522
523
524
525
@@ -519,7 +519,7 @@
  for u in d.urls():   root = self.find_root(u)   if root: - self.showRepo(root) + self.showRepo(hglib.tounicode(root))   accept = True   if accept:   event.setDropAction(Qt.LinkAction)
 
158
159
160
161
 
162
163
164
 
192
193
194
195
 
196
197
198
 
335
336
337
338
 
339
340
341
 
478
479
480
481
 
482
483
484
 
620
621
622
623
 
624
625
626
 
639
640
641
642
 
643
644
645
646
647
 
648
649
650
 
673
674
675
676
 
677
678
679
 
896
897
898
899
 
900
901
902
 
921
922
923
924
 
925
926
927
 
931
932
933
934
 
935
936
937
 
938
939
940
 
953
954
955
956
 
957
958
959
 
158
159
160
 
161
162
163
164
 
192
193
194
 
195
196
197
198
 
335
336
337
 
338
339
340
341
 
478
479
480
 
481
482
483
484
 
620
621
622
 
623
624
625
626
 
639
640
641
 
642
643
644
645
646
 
647
648
649
650
 
673
674
675
 
676
677
678
679
 
896
897
898
 
899
900
901
902
 
921
922
923
 
924
925
926
927
 
931
932
933
 
934
935
936
 
937
938
939
940
 
953
954
955
 
956
957
958
959
@@ -158,7 +158,7 @@
  else   {   TDEBUG_TRACEW( - L"GetCMenuTranslation: RegOpenKeyExW(\"" + L"GetCMenuTranslation: RegOpenKeyExW(\""   << subkey << "\") failed"   );   } @@ -192,7 +192,7 @@
    myDescMap[md.name] = md;   } - +   }     myMenuIdMap.clear(); @@ -335,7 +335,7 @@
  {   memset(&mii, 0, sizeof(MENUITEMINFOW));   mii.cbSize = sizeof(MENUITEMINFOW); - +   // first GetMenuItemInfoW call: get size of menu item string   mii.fMask = MIIM_STRING;   BOOL res = ::GetMenuItemInfoW(hMenu, i, true, &mii); @@ -478,7 +478,7 @@
  }     TDEBUG_TRACE( - "CShellExtCMenu::QueryContextMenu: isHgrepo = " + "CShellExtCMenu::QueryContextMenu: isHgrepo = "   << isHgrepo << ", fileMenu = " << fileMenu   );   @@ -620,7 +620,7 @@
  }     TDEBUG_TRACE( - "CShellExtCMenu::GetCommandString: idCmd = " << idCmd + "CShellExtCMenu::GetCommandString: idCmd = " << idCmd   << ", uFlags = " << uFlags << " (" << sflags << ")"   << ", cchMax = " << cchMax   ); @@ -639,12 +639,12 @@
  {   pszw = iter->second.helpText.c_str();   res = S_OK; - +   size_t size = iter->second.helpText.size();   if (size >= 40)   {   TDEBUG_TRACE( - "***** CShellExtCMenu::GetCommandString: warning:" + "***** CShellExtCMenu::GetCommandString: warning:"   << " length of help text is " << size   << ", which is not reasonably short (<40)");   } @@ -673,7 +673,7 @@
    if (cchMax < 1)   { - TDEBUG_TRACE("CShellExtCMenu::GetCommandString: cchMax = " + TDEBUG_TRACE("CShellExtCMenu::GetCommandString: cchMax = "   << cchMax << " (is <1)");   return res;   } @@ -896,7 +896,7 @@
  }     TDEBUG_TRACEW( - L"---- TortoiseHg shell extension version " + L"---- TortoiseHg shell extension version "   << ThgVersion::get() << L"----"   );   @@ -921,7 +921,7 @@
  if (SUCCEEDED(pDataObj->GetData(&fmt, &stg)) && stg.hGlobal)   {   HDROP hDrop = (HDROP) GlobalLock(stg.hGlobal); - +   if (hDrop)   {   UINT uNumFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0); @@ -931,10 +931,10 @@
  {   TDEBUG_TRACE(" DragQueryFile [" << i << "] = " << name);   myFiles.push_back(name); - } + }   }   } - else + else   {   TDEBUG_TRACE(" hDrop is NULL ");   } @@ -953,7 +953,7 @@
  }     // if a directory background - if (pIDFolder) + if (pIDFolder)   {   SHGetPathFromIDList(pIDFolder, name);   TDEBUG_TRACE(" Folder " << name);
 
37
38
39
40
41
 
 
42
43
44
 
37
38
39
 
 
40
41
42
43
44
@@ -37,8 +37,8 @@
  void PrintDebugHeader(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj);   void InitMenuMaps(const MenuDescription *menuDescs, std::size_t sz);   void InsertMenuItemByName( - HMENU hMenu, const std::string& name, UINT indexMenu, - UINT idCmd, UINT idCmdFirst, const std::wstring& prefix); + HMENU hMenu, const std::string& name, UINT indexMenu, + UINT idCmd, UINT idCmdFirst, const std::wstring& prefix);   void AddMenuList(UINT idCmd, const std::string& name);    public:
 
73
74
75
76
 
77
78
79
 
80
81
82
 
94
95
96
97
 
98
99
100
 
73
74
75
 
76
77
78
 
79
80
81
82
 
94
95
96
 
97
98
99
100
@@ -73,10 +73,10 @@
 {   std::string base;   std::string rest; - +   std::string n = n_in;   Directory* cur = this; - +   for (;;)   {   @@ -94,7 +94,7 @@
  }     Directory* d = 0; - for (DirsT::iterator i = cur->subdirs_.begin(); + for (DirsT::iterator i = cur->subdirs_.begin();   i != cur->subdirs_.end(); ++i)   {   if ((*i)->name_ == base) {
 
95
96
97
98
 
99
100
101
 
102
103
104
 
109
110
111
112
113
 
 
114
115
116
 
95
96
97
 
98
99
100
 
101
102
103
104
 
109
110
111
 
 
112
113
114
115
116
@@ -95,10 +95,10 @@
  new_stat = true;   }   - if (iter->dstate) + if (iter->dstate)   {   unset = iter->unset; - +   if (!new_stat)   return iter->dstate;   @@ -109,8 +109,8 @@
  }     TDEBUG_TRACE("Dirstatecache::get: refreshing " << hgroot); - } - else + } + else   {   TDEBUG_TRACE("Dirstatecache::get: reading " << hgroot);   }
 
36
37
38
39
40
41
42
 
 
 
 
43
44
45
46
 
47
48
49
 
36
37
38
 
 
 
 
39
40
41
42
43
44
45
 
46
47
48
49
@@ -36,14 +36,14 @@
  bool unset;   bool usekbfiles;   - E(): - dstate(0), - dstate_mtime(0), - dstate_size(0), + E(): + dstate(0), + dstate_mtime(0), + dstate_size(0),   tickcount(0),   unset(false),   usekbfiles(false) - {} + {}   };     static std::list<E>& cache();
 
79
80
81
82
 
83
84
85
 
106
107
108
109
 
110
111
112
 
156
157
158
159
 
160
161
162
 
188
189
190
191
 
192
193
194
 
202
203
204
205
 
206
207
208
 
213
214
215
216
 
217
218
219
220
 
221
222
223
 
231
232
233
234
 
235
236
237
 
298
299
300
301
 
302
303
304
 
367
368
369
370
 
371
372
373
 
79
80
81
 
82
83
84
85
 
106
107
108
 
109
110
111
112
 
156
157
158
 
159
160
161
162
 
188
189
190
 
191
192
193
194
 
202
203
204
 
205
206
207
208
 
213
214
215
 
216
217
218
219
 
220
221
222
223
 
231
232
233
 
234
235
236
237
 
298
299
300
 
301
302
303
304
 
367
368
369
 
370
371
372
373
@@ -79,7 +79,7 @@
   int findHgRoot(char cls, QueryState& cur, QueryState& last, bool outdated)  { - std::string dp = "["; dp += cls; dp += "] findHgRoot"; + std::string dp = "["; dp += cls; dp += "] findHgRoot";     {   std::string p = cur.path; @@ -106,7 +106,7 @@
  }   }   - if (!outdated && !last.hgroot.empty() + if (!outdated && !last.hgroot.empty()   && cur.path.size() >= last.hgroot.size()   && StartsWith(cur.path, last.hgroot + "\\"))   { @@ -156,7 +156,7 @@
  goto exit;   }   - if (has_hg) + if (has_hg)   {   cur.hgroot = p;   TDEBUG_TRACE( @@ -188,7 +188,7 @@
     int get_relpath( - const std::string& hgroot, + const std::string& hgroot,   const std::string& path,   std::string& res  ) @@ -202,7 +202,7 @@
    if (path[offset] == '\\')   offset++; - +   const char* relpathptr = path.c_str() + offset;     res = relpathptr; @@ -213,11 +213,11 @@
 int HgQueryDirstate(   const char cls,   const std::string& path, - const char& filterStatus, + const char& filterStatus,   char& outStatus  )  { - std::string dp = "["; dp += cls; dp += "] HgQueryDirstate: "; + std::string dp = "["; dp += cls; dp += "] HgQueryDirstate: ";     static QueryState last;   @@ -231,7 +231,7 @@
    const bool outdated = cur.tickcount - last.tickcount > 2000;   - if (!outdated && last.path == path) + if (!outdated && last.path == path)   {   outStatus = last.status;   if (outStatus == 'P') @@ -298,7 +298,7 @@
  }     Winstat stat; - if (0 != stat.lstat(path.c_str())) + if (0 != stat.lstat(path.c_str()))   {   TDEBUG_TRACE(dp << "lstat(" << path << ") failed");   last = cur; @@ -367,7 +367,7 @@
    if (basedir_status != 'M')   update = true; - } + }   }   else if (outStatus == 'P')   {