#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
------------------------------------------------------------------------------
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

Reply via email to