#640: Mercurial always clobbers if repo-url contains password
---------------------+------------------------------------------------------
Reporter: miltondp | Owner:
Type: defect | Status: new
Priority: critical | Milestone: 0.8.+
Version: 0.7.11 | Resolution:
Keywords: |
---------------------+------------------------------------------------------
Comment(by marcusl):
How about this:
{{{
#!diff
diff --git a/buildbot/slave/commands.py b/buildbot/slave/commands.py
index 69fb37c..c9b8184 100755
--- a/buildbot/slave/commands.py
+++ b/buildbot/slave/commands.py
@@ -2799,6 +2799,22 @@ class Mercurial(SourceBase):
else:
repourl = self.repourl
+ def _remove_userpassword(url):
+ if '@' not in url:
+ return url
+
+ from urlparse import urlparse
+ p = urlparse(url)
+ netloc = p[1].split('@')
+
+ if len(netloc) > 1:
+ return p[0] + '://' + netloc[1] + p[2]
+ else:
+ return p[0] + '://' + p[1]
+
+ oldurl = _remove_userpassword(oldurl)
+ repourl = _remove_userpassword(repourl)
+
if oldurl != repourl:
self.clobber = self._clobber
msg = "RepoURL changed from '%s' in wc to '%s' in
update. Clobbering" % (oldurl, repourl)
}}}
--
Ticket URL: <http://buildbot.net/trac/ticket/640#comment:8>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Buildbot-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/buildbot-commits