Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

manifest: add subrepo support

Changeset 2fc9cb409d47

Parent b18ca97eac6c

by Angel Ezquerra

Changes to 3 files · Browse files at 2fc9cb409d47 Showing diff from parent b18ca97eac6c Diff from another changeset...

 
159
160
161
162
 
163
164
165
 
159
160
161
 
162
163
164
165
@@ -159,7 +159,7 @@
    def _initactions(self):   self._statusfilter = status.StatusFilterButton( - statustext='MAC', text=_('Status')) + statustext='MASC', text=_('Status'))   self._toolbar.addWidget(self._statusfilter)     self._actions = {}
 
26
27
28
29
 
30
31
32
33
34
35
 
36
37
38
 
79
80
81
82
 
 
 
 
 
83
84
85
 
155
156
157
158
 
159
160
 
161
162
163
 
181
182
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
185
186
 
258
259
260
261
 
262
263
264
 
26
27
28
 
29
30
31
32
33
34
 
35
36
37
38
 
79
80
81
 
82
83
84
85
86
87
88
89
 
159
160
161
 
162
163
 
164
165
166
167
 
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
 
281
282
283
 
284
285
286
287
@@ -26,13 +26,13 @@
  StatusRole = Qt.UserRole + 1   """Role for file change status"""   - def __init__(self, repo, rev, statusfilter='MAC', parent=None): + def __init__(self, repo, rev, statusfilter='MASC', parent=None):   QAbstractItemModel.__init__(self, parent)     self._repo = repo   self._rev = rev   - assert util.all(c in 'MARC' for c in statusfilter) + assert util.all(c in 'MARSC' for c in statusfilter)   self._statusfilter = statusfilter     def data(self, index, role=Qt.DisplayRole): @@ -79,7 +79,11 @@
  if not index.isValid():   return True # root entry must be a directory   e = index.internalPointer() - return len(e) != 0 + if e.status == 'S': + # Consider subrepos as dirs as well + return True + else: + return len(e) != 0     def mimeData(self, indexes):   def preparefiles(): @@ -155,9 +159,9 @@
    @pyqtSlot(str)   def setStatusFilter(self, status): - """Filter file tree by change status 'MARC'""" + """Filter file tree by change status 'MARSC'"""   status = str(status) - assert util.all(c in 'MARC' for c in status) + assert util.all(c in 'MARSC' for c in status)   if self._statusfilter == status:   return # for performance reason   self._statusfilter = status @@ -181,6 +185,25 @@
  roote = _Entry()   ctx = self._repo[self._rev]   + # Add subrepos to the tree + subpaths = ctx.substate.keys() + for path in subpaths: + if not 'S' in self._statusfilter: + break + e = roote + pathelements = hglib.tounicode(path).split('/') + for p in pathelements[:-1]: + if not p in e: + e.addchild(p) + e = e[p] + + p = pathelements[-1] + if not p in e: + e.addchild(p) + e = e[p] + e.setstatus('S') + + # Add regular files to the tree   status = dict(zip(('M', 'A', 'R'),   (set(a) for a in self._repo.status(ctx.parents()[0],   ctx)[:3]))) @@ -258,7 +281,7 @@
  return self._status     def setstatus(self, status): - assert status in 'MARC' + assert status in 'MARSC'   self._status = status     def __len__(self):
 
782
783
784
785
 
786
787
788
 
782
783
784
 
785
786
787
788
@@ -782,7 +782,7 @@
  statusChanged = pyqtSignal(str)     def __init__(self, statustext, types=None, parent=None, **kwargs): - self._TYPES = 'MARC' + self._TYPES = 'MARSC'   if types is not None:   self._TYPES = types   #if 'text' not in kwargs: