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 in repository registry, but do not save them

Changeset 75b9529e56a9

Parent 17999dda8297

by Angel Ezquerra

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

 
8
9
10
 
11
12
13
14
 
15
16
17
 
189
190
191
192
193
194
195
 
198
199
200
 
 
 
 
 
 
 
 
 
 
 
 
201
202
203
 
8
9
10
11
12
13
14
15
16
17
18
19
 
191
192
193
 
194
195
196
 
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
@@ -8,10 +8,12 @@
 import sys, os    from mercurial import node +from mercurial import ui, hg    from tortoisehg.util import hglib  from tortoisehg.hgqt.i18n import _  from tortoisehg.hgqt import qtlib +from tortoisehg.hgqt import thgrepo    from PyQt4.QtCore import *  from PyQt4.QtGui import * @@ -189,7 +191,6 @@
  xw.writeAttribute('root', hglib.tounicode(self._root))   xw.writeAttribute('shortname', self.shortname())   xw.writeAttribute('basenode', node.hex(self.basenode())) - RepoTreeItem.dump(self, xw)     def undump(self, xr):   a = xr.attributes() @@ -198,6 +199,18 @@
  self._basenode = node.bin(str(a.value('', 'basenode').toString()))   RepoTreeItem.undump(self, xr)   + def addSubrepos(ri): + repo = hg.repository(ui.ui(), ri.rootpath()) + for subpath in repo['.'].substate: + # For now we only support showing mercurial subrepos + if repo['.'].substate[subpath][2] == 'hg': + sctx = repo['.'].sub(subpath) + ri.appendChild(RepoItem(self.model, sctx._repo.root)) + if ri.childCount(): + addSubrepos(ri.child(ri.childCount()-1)) + + addSubrepos(self) +   def details(self):   return _('Local Repository %s') % hglib.tounicode(self._root)