[Buildbot-commits] [SPAM] Re: [Buildbot] #640: Mercurial always clobbers if repo-url contains password

Buildbot buildbot-devel at lists.sourceforge.net
Sun Dec 27 19:55:50 UTC 2009


#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 miltondp):

 Great! Yesterday I wrote a solution too but I couldn't test it and I can't
 right now (I'll do it tomorroy). Using urlparse seems to be much better.
 Anyway, here it is:

 {{{
 --- /usr/share/pyshared/buildbot/slave/commands.py      2009-08-13
 12:53:17.000000000 -0300
 +++ commands.py 2009-12-27 16:49:29.783838053 -0300
 @@ -2665,6 +2665,16 @@
                  else:
                      repourl = self.repourl

 +                def _removeUserAndPasswordFromURL(url):
 +                    protocol_url = url.split('://')
 +                    protocol = protocol_url[0]
 +                    repo_url = protocol_url[1].split('@')[-1]
 +
 +                    return protocol + '://' + repo_url
 +
 +                oldurl = _removeUserAndPasswordFromURL(oldurl)
 +                repourl = _removeUserAndPasswordFromURL(repourl)
 +
                  if oldurl != repourl:
                      self.clobber = self._clobber
                      msg = "RepoURL changed from '%s' in wc to '%s' in
 update. Clobbering" % (oldurl, repourl)
 }}}

 I attach a test-case also (not for _checkRepoURL, but for
 _removeUserAndPasswordFromURL)

-- 
Ticket URL: <http://buildbot.net/trac/ticket/640#comment:11>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list