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

history: keep previously selected path after refresh

Fixes the side effect of <89e8498bf597>.

Changeset b0bcc8f675f9

Parent 7478ed357642

by Yuki KODAMA

Changes to one file · Browse files at b0bcc8f675f9 Showing diff from parent 7478ed357642 Diff from another changeset...

 
1940
1941
1942
 
 
 
1943
 
 
 
 
 
 
 
 
1944
 
1945
1946
1947
1948
1949
 
 
 
 
 
 
 
 
 
 
 
1950
1951
1952
 
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
@@ -1940,13 +1940,36 @@
  def update_urllist(self):   if self.bfile:   return + + # save current selection & default path + oldurl = self.pathentry.get_text()   urllist = self.urlcombo.get_model() + for path, alias in urllist: + if alias == 'default': + defurl = path + break + else: + defurl = None + + # update URL list   urllist.clear() + new_defurl = None   for alias, path in self.repo.ui.configitems('paths'):   path = url.hidepassword(path)   urllist.append((hglib.toutf(path), hglib.toutf(alias)))   if alias == 'default':   self.urlcombo.set_active(len(urllist) - 1) + new_defurl = path + + # restore previous selection + if oldurl and defurl == new_defurl: + for row in urllist: + path, alias = row + if oldurl == path: + self.urlcombo.set_active_iter(row.iter) + break + else: + self.pathentry.set_text(oldurl)     def update_postpull(self, ppull=None):   if ppull is None: