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

reporegistry: Mark suprepos opened with "Open repository" with a subrepo icon

Note that for speed reasons we do not really check if the repository is a
subrepo. Instead we simply check whether it is _inside_ a mercurial repository,
in which case we assume that it is a subrepo.

If we really wanted to check whether the added repo is a subrepo we would need
to create a repo object for the container repo. Also, this may fail because the
selected revision on the container repo may be such that the repo that is being
open is not a subrepo in that revision, but it may well be one on another
revision. That is why it makes more sense to always mark repos inside repos as
"potential" subrepos.

Changeset 8941935009e9

Parent 749692573295

by Angel Ezquerra

Changes to one file · Browse files at 8941935009e9 Showing diff from parent 749692573295 Diff from another changeset...

 
10
11
12
13
 
14
15
16
17
 
 
18
19
20
 
239
240
241
 
 
 
 
242
243
 
 
 
 
244
245
246
 
10
11
12
 
13
14
15
16
17
18
19
20
21
22
 
241
242
243
244
245
246
247
248
 
249
250
251
252
253
254
255
@@ -10,11 +10,13 @@
 from tortoisehg.hgqt import qtlib    from repotreeitem import undumpObject, AllRepoGroupItem, RepoGroupItem -from repotreeitem import RepoItem, RepoTreeItem +from repotreeitem import RepoItem, RepoTreeItem, SubrepoItem    from PyQt4.QtCore import *  from PyQt4.QtGui import *   +import os +    extractXmlElementName = 'reporegextract'  reporegistryXmlElementName = 'reporegistry' @@ -239,8 +241,15 @@
  rgi = grp.internalPointer()   if row < 0:   row = rgi.childCount() + + # Is the root of the repo that we want to add a subrepo contained + # within a repo or subrepo? If so, assume it is an hg subrepo + itemIsSubrepo = not paths.find_root(os.path.dirname(root)) is None   self.beginInsertRows(grp, row, row) - ri = RepoItem(root) + if itemIsSubrepo: + ri = SubrepoItem(root) + else: + ri = RepoItem(root)   rgi.insertChild(row, ri)     if not self.showSubrepos \