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

reporegistry: show subrepos when adding a new repository to the repo registry

Changeset afa1e72ad25e

Parent 75b9529e56a9

by Angel Ezquerra

Changes to one file · Browse files at afa1e72ad25e Showing diff from parent 75b9529e56a9 Diff from another changeset...

 
7
8
9
 
10
11
12
 
222
223
224
 
 
 
 
 
 
 
 
 
 
 
225
226
227
 
7
8
9
10
11
12
13
 
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
@@ -7,6 +7,7 @@
   from tortoisehg.util import hglib  from tortoisehg.hgqt.i18n import _ +from tortoisehg.hgqt import thgrepo    from repotreeitem import undumpObject, AllRepoGroupItem, RepoGroupItem  from repotreeitem import RepoItem, RepoTreeItem @@ -222,6 +223,17 @@
  row = rgi.childCount()   self.beginInsertRows(grp, row, row)   rgi.insertChild(row, RepoItem(self, root)) + def addSubrepos(ri, repo): + for subpath in repo['.'].substate: + # For now we only support showing mercurial subrepos + if repo['.'].substate[subpath][2] == 'hg': + sctx = repo['.'].sub(subpath) + ri.insertChild(row, + RepoItem(self, sctx._repo.root)) + addSubrepos(ri.child(ri.childCount()-1), sctx._repo) + from mercurial import ui, hg + repo = hg.repository(ui.ui(), root) + addSubrepos(rgi.child(rgi.childCount()-1), repo)   self.endInsertRows()     def getRepoItem(self, reporoot):