Commits

Yuya Nishihara committed 9ee9227

repotreemodel: have addRepo() return index of new item like other model APIs

  • Participants
  • Parent commits c8058e5

Comments (0)

Files changed (1)

tortoisehg/hgqt/repotreemodel.py

 
         if not self.showNetworkSubrepos and paths.netdrive_status(root):
             self.endInsertRows()
-            return
+            return self._indexFromItem(ri)
 
         invalidRepoList = ri.appendSubrepos()
 
                     '<br><br><i>%s</i>')  %
                     (root, "<br>".join(invalidRepoList)))
 
+        return self._indexFromItem(ri)
+
     # TODO: merge getRepoItem() to indexFromRepoRoot()
     def getRepoItem(self, reporoot, lookForSubrepos=False):
         reporoot = os.path.normcase(reporoot)