Commits

Yuya Nishihara  committed bdf3e5b

sync: fix unicode handling of setEditUrl()

Unlike the original docstring, it expects unicode or QString.

  • Participants
  • Parent commits 0065f69
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/sync.py

         self.reload()
         if 'default' in self.paths:
             self.curalias = 'default'
-            self.setEditUrl(self.paths['default'])
+            self.setEditUrl(hglib.tounicode(self.paths['default']))
         else:
             self.curalias = None
             self.setEditUrl('')
         alias = aliasindex.data(Qt.DisplayRole).toString()
         self.curalias = hglib.fromunicode(alias)
         path = index.model().realUrl(index)
-        self.setEditUrl(path)
+        self.setEditUrl(hglib.tounicode(path))
 
     def setEditUrl(self, newurl):
-        'User has selected a new URL: newurl is expected in local encoding'
+        'Set the current URL without changing the alias [unicode]'
         self.urlentry.setText(newurl)
         self.refreshUrl()
 
             return
         if lurl.startswith('file:///'):
             lurl = lurl[8:]
-        self.setEditUrl(lurl)
+        self.setEditUrl(hglib.tounicode(lurl))
 
     def canExit(self):
         return not self.cmd.core.running()
         dlg.setWindowModality(Qt.WindowModal)
         if dlg.exec_() == QDialog.Accepted:
             self.curalias = hglib.fromunicode(dlg.aliasentry.text())
-            self.setEditUrl(hglib.fromunicode(dlg.urlentry.text()))
+            self.setEditUrl(dlg.urlentry.text())
             self.reload()
 
     def removeurl(self):
                               'this host and inside this URL.  Remove '
                               'authentication info from this URL?'),
                             parent=self):
-                            self.setEditUrl(cleanurl)
+                            self.setEditUrl(hglib.tounicode(cleanurl))
                             self.saveclicked()
 
         safeurl = util.hidepassword(lurl)
             return
         save = self.currentUrl()
         orev = self.opts.get('rev')
-        self.setEditUrl(bundle)
+        self.setEditUrl(hglib.tounicode(bundle))
         if rev is not None:
             self.opts['rev'] = str(rev)
         self.pullclicked(bsource)