Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0.1, 1.0.2, and 1.0.3

stable thgconfig: use constant values instead of magic numbers

Changeset c53595812426

Parent dc08b8f0e129

by Yuki KODAMA

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

 
536
537
538
 
 
 
539
540
541
 
593
594
595
 
596
597
598
 
690
691
692
693
694
695
696
697
698
 
699
700
701
 
708
709
710
711
712
713
714
715
 
716
717
718
 
769
770
771
772
 
773
774
775
 
536
537
538
539
540
541
542
543
544
 
596
597
598
599
600
601
602
 
694
695
696
 
 
697
698
699
 
700
701
702
703
 
710
711
712
 
713
714
715
 
716
717
718
719
 
770
771
772
 
773
774
775
776
@@ -536,6 +536,9 @@
  ret += netloc + '/' + folder   return ret   +CONF_GLOBAL = 0 +CONF_REPO = 1 +  class ConfigDialog(gtk.Dialog):   def __init__(self, configrepo=False):   """ Initialize the Dialog. """ @@ -593,6 +596,7 @@
  if repo:   combo.append_text(_('%s repository settings') % hglib.toutf(name))   combo.connect('changed', self.fileselect) + self.confcombo = combo     hbox = gtk.HBox()   hbox.pack_start(combo, False, False) @@ -690,12 +694,10 @@
  descframe.add(scrolled)   self.descbuffer = desctext.get_buffer()   - self.configrepo = configrepo -   # Force dialog into clean state in the beginning   self._btn_apply.set_sensitive(False)   self.dirty = False - combo.set_active(configrepo and 1 or 0) + combo.set_active(configrepo and CONF_REPO or CONF_GLOBAL)     # activate first config page   self.confview.set_cursor(self.confmodel[0].path) @@ -708,11 +710,10 @@
  _('Lose changes and switch files?.')).run()   if ret != gtk.RESPONSE_YES:   return - self.configrepo = combo.get_active() and True or False   self.refresh()     def refresh(self): - if self.configrepo: + if self.confcombo.get_active() == CONF_REPO:   repo = hg.repository(ui.ui(), self.root)   name = hglib.get_reponame(repo)   self.rcpath = [os.sep.join([repo.root, '.hg', 'hgrc'])] @@ -769,7 +770,7 @@
    def edit_clicked(self, button):   # reload configs, in case they have been written since opened - if self.configrepo: + if self.confcombo.get_active() == CONF_REPO:   repo = hg.repository(ui.ui(), self.root)   u = repo.ui   else: