Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

thgconfig: fix operation outside of a repository

Changeset db4ffe12a0aa

Parent a31b4f8823ab

by Steve Borho

Changes to one file · Browse files at db4ffe12a0aa Showing diff from parent a31b4f8823ab Diff from another changeset...

 
366
367
368
369
370
371
 
 
 
 
 
 
 
 
372
373
374
 
460
461
462
463
 
464
465
466
467
468
469
470
471
472
473
474
475
476
 
491
492
493
494
 
495
496
497
 
366
367
368
 
 
 
369
370
371
372
373
374
375
376
377
378
379
 
465
466
467
 
468
469
470
471
472
 
473
474
475
476
 
477
478
479
 
494
495
496
 
497
498
499
500
@@ -366,9 +366,14 @@
    self.ui = ui.ui()   try: - repo = hg.repository(self.ui, path=paths.find_root()) - name = repo.ui.config('web', 'name') or os.path.basename(repo.root) - self.ui = repo.ui + root = paths.find_root() + if root: + repo = hg.repository(self.ui, root) + name = repo.ui.config('web', 'name') or os.path.basename(root) + self.ui = repo.ui + else: + repo = None + self.root = root   except hglib.RepoError:   repo = None   if configrepo: @@ -460,17 +465,15 @@
    def refresh(self):   if self.configrepo: - repo = hg.repository(ui.ui(), path=paths.find_root()) + repo = hg.repository(ui.ui(), self.root)   name = repo.ui.config('web', 'name') or os.path.basename(repo.root)   self.rcpath = [os.sep.join([repo.root, '.hg', 'hgrc'])]   self.set_title(_('TortoiseHg Configure Repository - ') + name)   gtklib.set_tortoise_icon(self, 'settings_repo.ico') - self.root = repo.root   else:   self.rcpath = util.user_rcpath()   self.set_title(_('TortoiseHg Configure User-Global Settings'))   gtklib.set_tortoise_icon(self, 'settings_user.ico') - self.root = None   if self.shellframe:   self.shellframe.set_sensitive(not self.configrepo)   self.ini = self.load_config(self.rcpath) @@ -491,7 +494,7 @@
  util.system("%s \"%s\"" % (editor, self.fn))   # reload configs, in case they have been written since opened   if self.configrepo: - repo = hg.repository(ui.ui(), path=paths.find_root()) + repo = hg.repository(ui.ui(), self.root)   u = repo.ui   else:   u = ui.ui()