[MediaWiki-commits] [Gerrit] pywikibot...FLOSSbot[master]: repository: add cvs support

2016-10-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: repository: add cvs support
..


repository: add cvs support

Change-Id: Ied2516c4cee2ec6c70f8c9100ad822329aa92eed
Signed-off-by: Loic Dachary 
---
M FLOSSbot/repository.py
1 file changed, 17 insertions(+), 0 deletions(-)

Approvals:
  Dachary: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/FLOSSbot/repository.py b/FLOSSbot/repository.py
index 220d317..8b2036a 100644
--- a/FLOSSbot/repository.py
+++ b/FLOSSbot/repository.py
@@ -17,6 +17,7 @@
 import argparse
 import logging
 import re
+from urllib.parse import urlparse
 
 import pywikibot
 import requests
@@ -232,7 +233,21 @@
 return self.Q_Subversion
 if url.startswith('ftp://'):
 return self.Q_File_Transfer_Protocol
+if url.startswith('cvs://'):
+return self.Q_Concurrent_Versions_System
 return None
+
+def verify_cvs(self, url, credentials):
+parsed = urlparse(url)
+cvsroot = ':pserver:' + parsed.netloc + ':' + parsed.path
+return util.sh_bool("""
+set -e
+rm -fr /tmp/tmpclone
+mkdir -p /tmp/tmpclone
+cd /tmp/tmpclone
+timeout 30 cvs -d {cvsroot} -z3 get . || true
+test -d CVSROOT
+""".format(cvsroot=cvsroot))
 
 def verify_git(self, url):
 return util.sh_bool("timeout 30 git ls-remote " + url + " HEAD")
@@ -309,6 +324,8 @@
 return self.verify_http(url)
 elif protocol == self.Q_File_Transfer_Protocol:
 return self.verify_ftp(url)
+elif protocol == self.Q_Concurrent_Versions_System:
+return self.verify_cvs(url, credentials)
 return None
 
 def try_protocol(self, url, credentials):

-- 
To view, visit https://gerrit.wikimedia.org/r/316699
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ied2516c4cee2ec6c70f8c9100ad822329aa92eed
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/bots/FLOSSbot
Gerrit-Branch: master
Gerrit-Owner: Dachary 
Gerrit-Reviewer: Dachary 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] pywikibot...FLOSSbot[master]: repository: add cvs support

2016-10-18 Thread Dachary (Code Review)
Dachary has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316699

Change subject: repository: add cvs support
..

repository: add cvs support

Change-Id: Ied2516c4cee2ec6c70f8c9100ad822329aa92eed
Signed-off-by: Loic Dachary 
---
M FLOSSbot/repository.py
1 file changed, 17 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/FLOSSbot 
refs/changes/99/316699/1

diff --git a/FLOSSbot/repository.py b/FLOSSbot/repository.py
index 220d317..8b2036a 100644
--- a/FLOSSbot/repository.py
+++ b/FLOSSbot/repository.py
@@ -17,6 +17,7 @@
 import argparse
 import logging
 import re
+from urllib.parse import urlparse
 
 import pywikibot
 import requests
@@ -232,7 +233,21 @@
 return self.Q_Subversion
 if url.startswith('ftp://'):
 return self.Q_File_Transfer_Protocol
+if url.startswith('cvs://'):
+return self.Q_Concurrent_Versions_System
 return None
+
+def verify_cvs(self, url, credentials):
+parsed = urlparse(url)
+cvsroot = ':pserver:' + parsed.netloc + ':' + parsed.path
+return util.sh_bool("""
+set -e
+rm -fr /tmp/tmpclone
+mkdir -p /tmp/tmpclone
+cd /tmp/tmpclone
+timeout 30 cvs -d {cvsroot} -z3 get . || true
+test -d CVSROOT
+""".format(cvsroot=cvsroot))
 
 def verify_git(self, url):
 return util.sh_bool("timeout 30 git ls-remote " + url + " HEAD")
@@ -309,6 +324,8 @@
 return self.verify_http(url)
 elif protocol == self.Q_File_Transfer_Protocol:
 return self.verify_ftp(url)
+elif protocol == self.Q_Concurrent_Versions_System:
+return self.verify_cvs(url, credentials)
 return None
 
 def try_protocol(self, url, credentials):

-- 
To view, visit https://gerrit.wikimedia.org/r/316699
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied2516c4cee2ec6c70f8c9100ad822329aa92eed
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/bots/FLOSSbot
Gerrit-Branch: master
Gerrit-Owner: Dachary 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits