Git Interface: changed code to cope with 'scp like' repository URLs.

Wed, 06 Feb 2019 19:21:41 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 06 Feb 2019 19:21:41 +0100
changeset 6703
31b0306f0ecc
parent 6702
793af5761910
child 6704
772563b2eb0a
child 6707
30f0ac20df50

Git Interface: changed code to cope with 'scp like' repository URLs.

Plugins/VcsPlugins/vcsGit/GitNewProjectOptionsDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsGit/GitSubmoduleAddDialog.py file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsGit/GitNewProjectOptionsDialog.py	Wed Feb 06 19:14:50 2019 +0100
+++ b/Plugins/VcsPlugins/vcsGit/GitNewProjectOptionsDialog.py	Wed Feb 06 19:21:41 2019 +0100
@@ -117,8 +117,17 @@
         @param txt current text of the combo box
         @type str
         """
-        url = QUrl.fromUserInput(txt)
-        enable = url.isValid() and url.scheme() in ConfigGitSchemes
+        enable = False
+        
+        if txt:
+            url = QUrl.fromUserInput(txt)
+            if url.isValid():
+                if url.scheme() in ConfigGitSchemes:
+                    enable = True
+            elif ':' in txt:
+                # assume scp like repository URL
+                enable = True
+        
         self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable)
         
         self.vcsUrlButton.setEnabled(url.scheme() == "file" or len(txt) == 0)
--- a/Plugins/VcsPlugins/vcsGit/GitSubmoduleAddDialog.py	Wed Feb 06 19:14:50 2019 +0100
+++ b/Plugins/VcsPlugins/vcsGit/GitSubmoduleAddDialog.py	Wed Feb 06 19:21:41 2019 +0100
@@ -77,8 +77,17 @@
         @param txt current text of the combo box
         @type str
         """
-        url = QUrl.fromUserInput(txt)
-        enable = url.isValid() and url.scheme() in ConfigGitSchemes
+        enable = False
+        
+        if txt:
+            url = QUrl.fromUserInput(txt)
+            if url.isValid():
+                if url.scheme() in ConfigGitSchemes:
+                    enable = True
+            elif ':' in txt:
+                # assume scp like repository URL
+                enable = True
+        
         self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable)
         
         self.submoduleUrlButton.setEnabled(url.scheme() == "file" or

eric ide

mercurial