Plugins/VcsPlugins/vcsMercurial/HgUserConfigHostFingerprintDialog.py

changeset 5441
cd5343be7d72
parent 5389
9b1c800daff3
child 5588
6ba512d9f46a
--- a/Plugins/VcsPlugins/vcsMercurial/HgUserConfigHostFingerprintDialog.py	Mon Jan 23 11:54:21 2017 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgUserConfigHostFingerprintDialog.py	Mon Jan 23 17:53:07 2017 +0100
@@ -117,12 +117,21 @@
         @param txt current text
         @type str
         """
+        if txt != txt.strip():
+            # get rid of whitespace
+            txt = txt.strip()
+            self.fingerprintEdit.setText(txt)
+        
         if txt.startswith(tuple(
             [h + ":" for h in
              HgUserConfigHostFingerprintDialog.supportedHashes])):
             parts = txt.split(":", 1)
             if len(parts) == 2:
                 self.fingerprintEdit.setText(parts[1])
+                hashIndex = self.hashComboBox.findText(parts[0].strip())
+                if hashIndex > -1:
+                    self.hashComboBox.setCurrentIndex(hashIndex)
+        
         self.__updateOkButton()
     
     def getData(self):
@@ -137,7 +146,7 @@
         else:
             fingerprint = "{0}:{1}".format(
                 self.hashComboBox.currentText(),
-                self.fingerprintEdit.text()
+                self.fingerprintEdit.text().strip()
             )
         
-        return self.hostEdit.text(), fingerprint
+        return self.hostEdit.text().strip(), fingerprint

eric ide

mercurial