Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

settings: fix behavior when repo does not exist

Changeset 3d485b6f3604

Parent 2be57bdb50d2

by Steve Borho

Changes to one file · Browse files at 3d485b6f3604 Showing diff from parent 2be57bdb50d2 Diff from another changeset...

 
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
 
526
527
528
 
 
 
 
 
 
 
 
 
 
 
 
 
529
530
531
 
490
491
492
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
493
494
495
 
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
@@ -490,21 +490,6 @@
  self.setWindowTitle(_('TortoiseHg Settings'))   self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint)   - try: - if root is None: - root = paths.find_root() - if root: - repo = hg.repository(ui.ui(), root) - else: - repo = None - except error.RepoError: - repo = None - if configrepo: - qtlib.ErrorMsgBox(_('No repository found'), - _('no repo at ') + root, parent=self) - self.reject() - return -   if not hasattr(wconfig.config(), 'write'):   qtlib.ErrorMsgBox(_('Iniparse package not found'),   _("Can't change settings without iniparse package - " @@ -526,6 +511,19 @@
  self.conftabs.addTab(SettingsForm(rcpath=util.user_rcpath(), focus=focus),   qtlib.geticon('settings_user'),   _("%s's global settings") % username()) + try: + if root is None: + root = paths.find_root() + if root: + repo = hg.repository(ui.ui(), root) + else: + repo = None + except error.RepoError: + repo = None + if configrepo: + qtlib.ErrorMsgBox(_('No repository found'), + _('no repo at ') + root, parent=self) +   if repo:   reporcpath = os.sep.join([repo.root, '.hg', 'hgrc'])   reponame = hglib.tounicode(os.path.basename(repo.root))