Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable sync: search related repos in thg-reporegistry.xml

Since eba9fe3ae102, sync widget cannot list up related repository.
This fixes it by searching related basenode in thg-reporegistry.xml.

Changeset 7a2300236a3a

Parent 5bd340383171

by Yuya Nishihara

Changes to one file · Browse files at 7a2300236a3a Showing diff from parent 5bd340383171 Diff from another changeset...

 
19
20
21
22
 
 
23
24
25
 
339
340
341
342
343
344
345
346
347
348
349
350
351
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
353
354
 
19
20
21
 
22
23
24
25
26
 
340
341
342
 
 
 
 
 
 
 
 
 
 
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
@@ -19,7 +19,8 @@
   from tortoisehg.util import hglib, wconfig  from tortoisehg.hgqt.i18n import _ -from tortoisehg.hgqt import qtlib, cmdui, thgrepo, rebase, resolve +from tortoisehg.hgqt import qtlib, cmdui, thgrepo, rebase, resolve, \ + reporegistry, repotreemodel    # TODO  # Write keyring help, connect to help button @@ -339,16 +340,25 @@
  known.add(self.repo.root)   related = {}   repoid = self.repo[0].node() - for repo in thgrepo._repocache.values(): - if repo[0].node() != repoid: - continue - if repo.root not in known: - related[repo.root] = repo.shortname - known.add(repo.root) - for alias, path in repo.ui.configitems('paths'): - if path not in known: - related[path] = alias - known.add(path) + f = QFile(reporegistry.settingsfilename()) + f.open(QIODevice.ReadOnly) + try: + for e in repotreemodel.iterRepoItemFromXml(f): + if e.basenode() != repoid: + continue + try: + repo = thgrepo.repository(path=e.rootpath()) + except error.RepoError: + continue + if repo.root not in known: + related[repo.root] = repo.shortname + known.add(repo.root) + for alias, path in repo.ui.configitems('paths'): + if path not in known: + related[path] = alias + known.add(path) + finally: + f.close()   pairs = [(alias, path) for path, alias in related.items()]   tm = PathsModel(pairs, self)   self.reltv.setModel(tm)