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

repotreemodel: reload subrepos on drag-and-drop

It needs to load recursively in case RepoGroupItem is dropped.

Changeset 820bb1f31310

Parent 4e298fe5bb6c

by Yuya Nishihara

Changes to one file · Browse files at 820bb1f31310 Showing diff from parent 4e298fe5bb6c Diff from another changeset...

 
60
61
62
63
 
 
64
65
66
67
68
69
70
71
 
 
 
72
73
74
 
213
214
215
 
 
216
217
218
 
60
61
62
 
63
64
65
 
 
 
 
 
 
 
66
67
68
69
70
71
 
210
211
212
213
214
215
216
217
@@ -60,15 +60,12 @@
  yield undumpObject(xr)    def getRepoItemList(root): - repoItemList = [] + if isinstance(root, RepoItem): + return [root]   if not isinstance(root, RepoTreeItem): - return repoItemList - for c in root.childs: - if isinstance(c, RepoItem): - repoItemList.append(c) - else: - repoItemList += getRepoItemList(c) - return repoItemList + return [] + return reduce(lambda a, b: a + b, + (getRepoItemList(c) for c in root.childs), [])      class RepoTreeModel(QAbstractItemModel): @@ -213,6 +210,8 @@
  return False   if row < 0:   row = 0 + if self.showSubrepos: + self.loadSubrepos(itemread)   self.beginInsertRows(parent, row, row)   group.insertChild(row, itemread)   self.endInsertRows()