testing: grab mercurial URL from state, not file
authorGregory Szorc <gps@mozilla.com>
Sat, 24 Jan 2015 14:17:01 -0800
changeset 360249 b6b821618fe13e819c8bef4c2c1c09655a33c5e0
parent 360248 03af105e5b4ebb3be533244e7c67cd0174074a0a
child 360250 4ce900443d4b6b2160760c2faa1b59162826aaf2
push id16998
push userrwood@mozilla.com
push dateMon, 02 May 2016 19:42:03 +0000
testing: grab mercurial URL from state, not file We recently consolidated state for MozReview instances in a JSON file. Rip out the old code utilizing a dedicated file for storing the Mercurial URL.
testing/vcttesting/mozreview.py
--- a/testing/vcttesting/mozreview.py
+++ b/testing/vcttesting/mozreview.py
@@ -124,19 +124,16 @@ class MozReview(object):
         self.admin_username = bugzilla.username
         self.admin_password = bugzilla.password
         self.pulse_host = mr_info['pulse_host']
         self.pulse_port = mr_info['pulse_port']
 
         mercurial_pid = self._start_mercurial_server(mercurial_port)
 
         self.mercurial_url = 'http://localhost:%s/' % mercurial_port
-        with open(self._hg_url_path, 'w') as fh:
-            fh.write(self.mercurial_url)
-
         self.mercurial_pid = mercurial_pid
 
         state = {
             'bugzilla_url': bugzilla_url,
             'reviewboard_url': reviewboard_url,
             'reviewboard_pid': reviewboard_pid,
             'mercurial_url': self.mercurial_url,
             'mercurial_pid': mercurial_pid,
@@ -159,19 +156,17 @@ class MozReview(object):
             os.unlink(self._hg_pid_path)
 
         rb = MozReviewBoard(self._path)
         rb.stop()
 
         self._docker.stop_bmo(self._name)
 
     def create_repository(self, path):
-        with open(self._hg_url_path, 'rb') as fh:
-            url = '%s%s' % (fh.read(), path)
-
+        url = '%s%s' % (self.mercurial_url, path)
         full_path = os.path.join(self._path, 'repos', path)
 
         env = dict(os.environ)
         env['HGRCPATH'] = '/dev/null'
         subprocess.check_call([self._hg, 'init', full_path], env=env)
 
         rb = MozReviewBoard(self._path)
         rbid = rb.add_repository(os.path.dirname(path), url)
@@ -189,20 +184,16 @@ class MozReview(object):
         b = self.get_bugzilla()
         return b.create_user(email, password, fullname)
 
     @property
     def _hg_pid_path(self):
         return os.path.join(self._path, 'hg.pid')
 
     @property
-    def _hg_url_path(self):
-        return os.path.join(self._path, 'hg.url')
-
-    @property
     def _hg(self):
         return os.path.join(ROOT, 'venv', 'bin', 'hg')
 
     def _start_mercurial_server(self, port):
         repos_path = os.path.join(self._path, 'repos')
         if not os.path.exists(repos_path):
             os.mkdir(repos_path)