Bug 1247169 - remove bundle and mirror support for hgtool.py, r=rail FENNEC_51_0b15_BUILD1 FENNEC_51_0b15_RELEASE
authorNick Thomas <nthomas@mozilla.com>
Mon, 16 Jan 2017 10:55:39 +1300
changeset 7249 e1a40630a708
parent 7248 bbdd6d05a435
child 7250 f9159f0df17c
push id5400
push usernthomas@mozilla.com
push dateSun, 15 Jan 2017 22:17:37 +0000
reviewersrail
bugs1247169
Bug 1247169 - remove bundle and mirror support for hgtool.py, r=rail
buildfarm/maintenance/test_purge_builds.py
buildfarm/utils/hgtool.py
lib/python/mozilla_buildtools/test/test_util_hg.py
lib/python/util/hg.py
scripts/blocklist/sync-hg-blocklist.sh
scripts/hsts/update_hsts_preload_list.sh
scripts/spidermonkey_builds/spidermonkey.sh
scripts/valgrind/valgrind.sh
--- a/buildfarm/maintenance/test_purge_builds.py
+++ b/buildfarm/maintenance/test_purge_builds.py
@@ -9,18 +9,17 @@ class TestPurge(TestCase):
                      'mozilla-central-linux64-l10n-nightly',
                      'release-mozilla-1.9.2-linux64_build',
                      'release-mozilla-central-win32-opt-unittest-crashtest',
                      'release-mozilla-1.9.1-linux-opt-unittest-mochitests-3',
                      'release-mozilla-central-macosx64_repack_3',
                      'release-mozilla-central-android_update_verify',
                      'info',
                      ]
-    notImportantDirs = ['mozilla-central-bundle',
-                        'mozilla-1.9.2-linux-l10n-dep',
+    notImportantDirs = ['mozilla-1.9.2-linux-l10n-dep',
                         'mozilla-central-win32-xulrunner',
                         'nanojit-macosx64',
                         'fuzzer-linux',
                         'mozilla-central-linux64-debug',
                         ]
 
     def testImportantDirs(self):
         for d in self.importantDirs:
--- a/buildfarm/utils/hgtool.py
+++ b/buildfarm/utils/hgtool.py
@@ -21,18 +21,16 @@ if __name__ == '__main__':
     parser.set_defaults(
         revision=os.environ.get('HG_REV'),
         branch=os.environ.get('HG_BRANCH', None),
         outgoing=False,
         propsfile=os.environ.get('PROPERTIES_FILE'),
         loglevel=logging.INFO,
         shared_dir=os.environ.get('HG_SHARE_BASE_DIR'),
         clone_by_rev=False,
-        mirrors=None,
-        bundles=None,
     )
     parser.add_option(
         "-v", "--verbose", dest="loglevel", action="store_const",
         const=logging.DEBUG, help="verbose logging")
     parser.add_option(
         "-r", "--rev", dest="revision", help="which revision to update to")
     parser.add_option(
         "-b", "--branch", dest="branch", help="which branch to update to")
@@ -42,20 +40,16 @@ if __name__ == '__main__':
                       help="clone to a shared directory")
     parser.add_option("--check-outgoing", dest="outgoing", action="store_true",
                       help="check for and clobber outgoing changesets")
     parser.add_option(
         "--clone-by-revision", dest="clone_by_rev", action="store_true",
         help="do initial clone with -r <rev> instead of cloning the entire repo. "
              "This is slower but is useful when cloning repositories with many "
              "heads which may timeout otherwise.")
-    parser.add_option("--mirror", dest="mirrors", action="append",
-                      help="add a mirror to try cloning/pulling from before repo")
-    parser.add_option("--bundle", dest="bundles", action="append",
-                      help="add a bundle to try downloading/unbundling from before doing a full clone")
     parser.add_option("--purge", dest="auto_purge", action="store_true",
                       help="Purge the destination directory (if it exists).")
 
     options, args = parser.parse_args()
 
     logging.basicConfig(level=options.loglevel, format="%(message)s")
 
     if len(args) not in (1, 2):
@@ -84,13 +78,11 @@ if __name__ == '__main__':
         if out(dest, repo):
             remove_path(dest)
         if options.shared_dir and out(options.shared_dir, repo):
             remove_path(options.shared_dir)
 
     got_revision = mercurial(repo, dest, options.branch, options.revision,
                              shareBase=options.shared_dir,
                              clone_by_rev=options.clone_by_rev,
-                             mirrors=options.mirrors,
-                             bundles=options.bundles,
                              autoPurge=options.auto_purge)
 
     print "Got revision %s" % got_revision
--- a/lib/python/mozilla_buildtools/test/test_util_hg.py
+++ b/lib/python/mozilla_buildtools/test/test_util_hg.py
@@ -2,17 +2,17 @@ import unittest
 import tempfile
 import shutil
 import os
 import subprocess
 import time
 import util.hg as hg
 from util.hg import clone, pull, update, hg_ver, mercurial, _make_absolute, \
     share, push, apply_and_push, HgUtilError, make_hg_url, get_branch, purge, \
-    get_branches, path, init, unbundle, adjust_paths, is_hg_cset, commit, tag, \
+    get_branches, path, init, adjust_paths, is_hg_cset, commit, tag, \
     get_hg_output, has_rev
 from util.file import touch
 from util.commands import run_cmd, get_output
 
 from mock import patch
 
 
 def getRevisions(dest):
@@ -754,326 +754,16 @@ class TestHg(unittest.TestCase):
 
     def testInit(self):
         tmpdir = os.path.join(self.tmpdir, 'new')
         self.assertEquals(False, os.path.exists(tmpdir))
         init(tmpdir)
         self.assertEquals(True, os.path.exists(tmpdir))
         self.assertEquals(True, os.path.exists(os.path.join(tmpdir, '.hg')))
 
-    def testUnbundle(self):
-        # First create the bundle
-        bundle = os.path.join(self.tmpdir, 'bundle')
-        run_cmd(['hg', 'bundle', '-a', bundle], cwd=self.repodir)
-
-        # Now unbundle it in a new place
-        newdir = os.path.join(self.tmpdir, 'new')
-        init(newdir)
-        unbundle(bundle, newdir)
-
-        self.assertEquals(self.revisions, getRevisions(newdir))
-
-    def testCloneWithBundle(self):
-        # First create the bundle
-        bundle = os.path.join(self.tmpdir, 'bundle')
-        run_cmd(['hg', 'bundle', '-a', bundle], cwd=self.repodir)
-
-        # Wrap unbundle so we can tell if it got called
-        orig_unbundle = unbundle
-        try:
-            called = []
-
-            def new_unbundle(*args, **kwargs):
-                called.append(True)
-                return orig_unbundle(*args, **kwargs)
-            hg.unbundle = new_unbundle
-
-            # Now clone it using the bundle
-            clone(self.repodir, self.wc, bundles=[bundle])
-            self.assertEquals(self.revisions, getRevisions(self.wc))
-            self.assertEquals(called, [True])
-            self.assertEquals(path(self.wc), self.repodir)
-        finally:
-            hg.unbundle = orig_unbundle
-
-    def testCloneWithUnrelatedBundle(self):
-        # First create the bundle
-        bundle = os.path.join(self.tmpdir, 'bundle')
-        run_cmd(['hg', 'bundle', '-a', bundle], cwd=self.repodir)
-
-        # Create an unrelated repo
-        repo2 = os.path.join(self.tmpdir, 'repo2')
-        run_cmd(['%s/init_hgrepo.sh' % os.path.dirname(__file__),
-                 repo2], env={'extra': 'clone_unrelated'})
-
-        self.assertNotEqual(self.revisions, getRevisions(repo2))
-
-        # Clone repo2 using the unrelated bundle
-        clone(repo2, self.wc, bundles=[bundle])
-
-        # Make sure we don't have unrelated revisions
-        self.assertEquals(getRevisions(repo2), getRevisions(self.wc))
-        self.assertEquals(set(),
-                          set(getRevisions(self.repodir)).intersection(set(getRevisions(self.wc))))
-
-    def testCloneWithBadBundle(self):
-        # First create the bad bundle
-        bundle = os.path.join(self.tmpdir, 'bundle')
-        open(bundle, 'w').write('ruh oh!')
-
-        # Wrap unbundle so we can tell if it got called
-        orig_unbundle = unbundle
-        try:
-            called = []
-
-            def new_unbundle(*args, **kwargs):
-                called.append(True)
-                return orig_unbundle(*args, **kwargs)
-            hg.unbundle = new_unbundle
-
-            # Now clone it using the bundle
-            clone(self.repodir, self.wc, bundles=[bundle])
-            self.assertEquals(self.revisions, getRevisions(self.wc))
-            self.assertEquals(called, [True])
-        finally:
-            hg.unbundle = orig_unbundle
-
-    def testCloneWithBundleMissingRevs(self):
-        # First create the bundle
-        bundle = os.path.join(self.tmpdir, 'bundle')
-        run_cmd(['hg', 'bundle', '-a', bundle], cwd=self.repodir)
-
-        # Create a commit
-        open(os.path.join(self.repodir, 'test.txt'), 'w').write('hello!')
-        run_cmd(['hg', 'add', 'test.txt'], cwd=self.repodir)
-        run_cmd(['hg', 'commit', '-m', 'adding changeset'], cwd=self.repodir)
-
-        # Wrap unbundle so we can tell if it got called
-        orig_unbundle = unbundle
-        try:
-            called = []
-
-            def new_unbundle(*args, **kwargs):
-                called.append(True)
-                return orig_unbundle(*args, **kwargs)
-            hg.unbundle = new_unbundle
-
-            # Now clone it using the bundle
-            clone(self.repodir, self.wc, bundles=[bundle])
-            self.assertEquals(
-                getRevisions(self.repodir), getRevisions(self.wc))
-            self.assertEquals(called, [True])
-        finally:
-            hg.unbundle = orig_unbundle
-
-    def testCloneWithMirror(self):
-        mirror = os.path.join(self.tmpdir, 'repo2')
-        clone(self.repodir, mirror)
-
-        # Create a commit in the original repo
-        open(os.path.join(self.repodir, 'test.txt'), 'w').write('hello!')
-        run_cmd(['hg', 'add', 'test.txt'], cwd=self.repodir)
-        run_cmd(['hg', 'commit', '-m', 'adding changeset'], cwd=self.repodir)
-
-        # Now clone from the mirror
-        clone(self.repodir, self.wc, mirrors=[mirror])
-
-        # We'll be missing the new revision from repodir
-        self.assertNotEquals(getRevisions(self.repodir), getRevisions(self.wc))
-        # But we should have everything from the mirror
-        self.assertEquals(getRevisions(mirror), getRevisions(self.wc))
-        # Our default path should point to the original repo though.
-        self.assertEquals(self.repodir, path(self.wc))
-
-    def testCloneWithBadMirror(self):
-        mirror = os.path.join(self.tmpdir, 'repo2')
-
-        # Now clone from the mirror
-        clone(self.repodir, self.wc, mirrors=[mirror])
-
-        # We still end up with a valid repo
-        self.assertEquals(self.revisions, getRevisions(self.wc))
-        self.assertEquals(self.repodir, path(self.wc))
-
-    def testCloneWithOneBadMirror(self):
-        mirror1 = os.path.join(self.tmpdir, 'mirror1')
-        mirror2 = os.path.join(self.tmpdir, 'mirror2')
-
-        # Mirror 2 is ok
-        clone(self.repodir, mirror2)
-
-        # Create a commit in the original repo
-        open(os.path.join(self.repodir, 'test.txt'), 'w').write('hello!')
-        run_cmd(['hg', 'add', 'test.txt'], cwd=self.repodir)
-        run_cmd(['hg', 'commit', '-m', 'adding changeset'], cwd=self.repodir)
-
-        # Now clone from the mirror
-        clone(self.repodir, self.wc, mirrors=[mirror1, mirror2])
-
-        # We'll be missing the new revision from repodir
-        self.assertNotEquals(getRevisions(self.repodir), getRevisions(self.wc))
-        # But we should have everything from the mirror
-        self.assertEquals(getRevisions(mirror2), getRevisions(self.wc))
-        # Our default path should point to the original repo though.
-        self.assertEquals(self.repodir, path(self.wc))
-
-    def testCloneWithRevAndMirror(self):
-        mirror = os.path.join(self.tmpdir, 'repo2')
-        clone(self.repodir, mirror)
-
-        # Create a commit in the original repo
-        open(os.path.join(self.repodir, 'test.txt'), 'w').write('hello!')
-        run_cmd(['hg', 'add', 'test.txt'], cwd=self.repodir)
-        run_cmd(['hg', 'commit', '-m', 'adding changeset'], cwd=self.repodir)
-
-        # Now clone from the mirror
-        revisions = getRevisions(self.repodir)
-        clone(self.repodir, self.wc, revision=revisions[0],
-              mirrors=[mirror], clone_by_rev=True)
-
-        # We'll be missing the middle revision (on another branch)
-        self.assertEquals(revisions[:2] + revisions[3:], getRevisions(self.wc))
-        # But not from the mirror
-        self.assertNotEquals(getRevisions(mirror), getRevisions(self.wc))
-        # Our default path should point to the original repo though.
-        self.assertEquals(self.repodir, path(self.wc))
-
-    def testPullWithMirror(self):
-        mirror = os.path.join(self.tmpdir, 'repo2')
-        clone(self.repodir, mirror)
-
-        # Create a new commit in the mirror repo
-        open(os.path.join(mirror, 'test.txt'), 'w').write('hello!')
-        run_cmd(['hg', 'add', 'test.txt'], cwd=mirror)
-        run_cmd(['hg', 'commit', '-m', 'adding changeset'], cwd=mirror)
-
-        # Now clone from the original
-        clone(self.repodir, self.wc)
-
-        # Pull using the mirror
-        pull(self.repodir, self.wc, mirrors=[mirror])
-
-        self.assertEquals(getRevisions(self.wc), getRevisions(mirror))
-
-        # Our default path should point to the original repo
-        self.assertEquals(self.repodir, path(self.wc))
-
-    def testPullWithBadMirror(self):
-        mirror = os.path.join(self.tmpdir, 'repo2')
-
-        # Now clone from the original
-        clone(self.repodir, self.wc)
-
-        # Create a new commit in the original repo
-        open(os.path.join(self.repodir, 'test.txt'), 'w').write('hello!')
-        run_cmd(['hg', 'add', 'test.txt'], cwd=self.repodir)
-        run_cmd(['hg', 'commit', '-m', 'adding changeset'], cwd=self.repodir)
-
-        # Pull using the mirror
-        pull(self.repodir, self.wc, mirrors=[mirror])
-
-        self.assertEquals(getRevisions(self.wc), getRevisions(self.repodir))
-
-        # Our default path should point to the original repo
-        self.assertEquals(self.repodir, path(self.wc))
-
-    def testPullWithUnrelatedMirror(self):
-        mirror = os.path.join(self.tmpdir, 'repo2')
-        run_cmd(['%s/init_hgrepo.sh' % os.path.dirname(__file__), mirror],
-                env={'extra': 'pull_unrealted'})
-
-        # Now clone from the original
-        clone(self.repodir, self.wc)
-
-        # Create a new commit in the original repo
-        open(os.path.join(self.repodir, 'test.txt'), 'w').write('hello!')
-        run_cmd(['hg', 'add', 'test.txt'], cwd=self.repodir)
-        run_cmd(['hg', 'commit', '-m', 'adding changeset'], cwd=self.repodir)
-
-        # Pull using the mirror
-        pull(self.repodir, self.wc, mirrors=[mirror])
-
-        self.assertEquals(getRevisions(self.wc), getRevisions(self.repodir))
-        # We shouldn't have anything from the unrelated mirror
-        self.assertEquals(set(),
-                          set(getRevisions(mirror)).intersection(set(getRevisions(self.wc))))
-
-        # Our default path should point to the original repo
-        self.assertEquals(self.repodir, path(self.wc))
-
-    def testMercurialWithShareAndBundle(self):
-        # First create the bundle
-        bundle = os.path.join(self.tmpdir, 'bundle')
-        run_cmd(['hg', 'bundle', '-a', bundle], cwd=self.repodir)
-
-        # Create a commit
-        open(os.path.join(self.repodir, 'test.txt'), 'w').write('hello!')
-        run_cmd(['hg', 'add', 'test.txt'], cwd=self.repodir)
-        run_cmd(['hg', 'commit', '-m', 'adding changeset'], cwd=self.repodir)
-
-        # Wrap unbundle so we can tell if it got called
-        orig_unbundle = unbundle
-        try:
-            called = []
-
-            def new_unbundle(*args, **kwargs):
-                called.append(True)
-                return orig_unbundle(*args, **kwargs)
-            hg.unbundle = new_unbundle
-
-            shareBase = os.path.join(self.tmpdir, 'share')
-            sharerepo = os.path.join(shareBase, self.repodir.lstrip("/"))
-            os.mkdir(shareBase)
-            mercurial(
-                self.repodir, self.wc, shareBase=shareBase, bundles=[bundle])
-
-            self.assertEquals(called, [True])
-            self.assertEquals(
-                getRevisions(self.repodir), getRevisions(self.wc))
-            self.assertEquals(
-                getRevisions(self.repodir), getRevisions(sharerepo))
-        finally:
-            hg.unbundle = orig_unbundle
-
-    def testMercurialWithShareAndMirror(self):
-        # First create the mirror
-        mirror = os.path.join(self.tmpdir, 'repo2')
-        clone(self.repodir, mirror)
-
-        # Create a commit
-        open(os.path.join(self.repodir, 'test.txt'), 'w').write('hello!')
-        run_cmd(['hg', 'add', 'test.txt'], cwd=self.repodir)
-        run_cmd(['hg', 'commit', '-m', 'adding changeset'], cwd=self.repodir)
-
-        shareBase = os.path.join(self.tmpdir, 'share')
-        sharerepo = os.path.join(shareBase, self.repodir.lstrip("/"))
-        os.mkdir(shareBase)
-        mercurial(self.repodir, self.wc, shareBase=shareBase, mirrors=[mirror])
-
-        # Since we used the mirror, we should be missing a commit
-        self.assertNotEquals(getRevisions(self.repodir), getRevisions(self.wc))
-        self.assertNotEquals(
-            getRevisions(self.repodir), getRevisions(sharerepo))
-        self.assertEquals(getRevisions(mirror), getRevisions(self.wc))
-
-    def testMercurialByRevWithShareAndMirror(self):
-        # First create the mirror
-        mirror = os.path.join(self.tmpdir, 'repo2')
-        clone(self.repodir, mirror)
-
-        shareBase = os.path.join(self.tmpdir, 'share')
-        sharerepo = os.path.join(shareBase, self.repodir.lstrip("/"))
-        os.mkdir(shareBase)
-        mercurial(self.repodir, self.wc, shareBase=shareBase, mirrors=[
-                  mirror], clone_by_rev=True, revision=self.revisions[-1])
-
-        # We should only have the one revision
-        self.assertEquals(getRevisions(sharerepo), self.revisions[-1:])
-        self.assertEquals(getRevisions(self.wc), self.revisions[-1:])
-
     def testMercurialSkipPull(self):
         # Clone once into our working copy
         mercurial(self.repodir, self.wc)
 
         # The second clone should avoid calling pull()
         with patch('util.hg.pull') as patched_pull:
             mercurial(self.repodir, self.wc, revision=self.revisions[-1])
             self.assertEquals(patched_pull.call_count, 0)
@@ -1094,38 +784,16 @@ class TestHg(unittest.TestCase):
         # Add a path, and the comment goes away
         adjust_paths(self.wc, test=self.repodir)
         self.assert_("Hello world" not in open(hgrc).read())
 
         # Make sure our paths are correct
         self.assertEquals(path(self.wc), self.repodir)
         self.assertEquals(path(self.wc, 'test'), self.repodir)
 
-    def testOutofSyncMirrorFailingMaster(self):
-        # First create the mirror
-        mirror = os.path.join(self.tmpdir, 'repo2')
-        clone(self.repodir, mirror)
-
-        shareBase = os.path.join(self.tmpdir, 'share')
-        os.mkdir(shareBase)
-        mercurial(self.repodir, self.wc, shareBase=shareBase, mirrors=[mirror])
-
-        # Create a bundle
-        bundle = os.path.join(self.tmpdir, 'bundle')
-        run_cmd(['hg', 'bundle', '-a', bundle], cwd=self.repodir)
-
-        # Move our repodir out of the way so that pulling/cloning from it fails
-        os.rename(self.repodir, self.repodir + "-bad")
-
-        # Try and update to a non-existent revision using our mirror and
-        # bundle, with the master failing. We should fail
-        self.assertRaises(subprocess.CalledProcessError, mercurial,
-                          self.repodir, self.wc, shareBase=shareBase,
-                          mirrors=[mirror], bundles=[bundle],
-                          revision="1234567890")
 
     def testCommit(self):
         newfile = os.path.join(self.repodir, 'newfile')
         touch(newfile)
         run_cmd(['hg', 'add', 'newfile'], cwd=self.repodir)
         rev = commit(self.repodir, user='unittest', msg='gooooood')
         info = getRevInfo(self.repodir, rev)
         self.assertEquals(info['msg'], 'gooooood')
--- a/lib/python/util/hg.py
+++ b/lib/python/util/hg.py
@@ -209,90 +209,39 @@ def update(dest, branch=None, revision=N
         if branch and branch != local_branch:
             cmd.append(branch)
 
         run_cmd(cmd, cwd=dest)
     return get_revision(dest)
 
 
 def clone(repo, dest, branch=None, revision=None, update_dest=True,
-          clone_by_rev=False, mirrors=None, bundles=None, timeout=1800):
+          clone_by_rev=False, timeout=1800):
     """Clones hg repo and places it at `dest`, replacing whatever else is
     there.  The working copy will be empty.
 
     If `revision` is set, only the specified revision and its ancestors will
     be cloned.
 
     If `update_dest` is set, then `dest` will be updated to `revision` if
     set, otherwise to `branch`, otherwise to the head of default.
 
-    If `mirrors` is set, will try and clone from the mirrors before
-    cloning from `repo`.
-
-    If `bundles` is set, will try and download the bundle first and
-    unbundle it. If successful, will pull in new revisions from mirrors or
-    the master repo. If unbundling fails, will fall back to doing a regular
-    clone from mirrors or the master repo.
-
     Regardless of how the repository ends up being cloned, the 'default' path
     will point to `repo`.
 
     If this function runs for more than `timeout` seconds, the hg clone
     subprocess will be terminated. This features allows to terminate hung clones
     before buildbot kills the full jobs. When a timeout terminates the process,
     the exception is caught by `retrier`.
 
     Default timeout is 1800 seconds
     """
     if os.path.exists(dest):
         remove_path(dest)
 
-    if bundles:
-        log.info("Attempting to initialize clone with bundles")
-        for bundle in bundles:
-            if os.path.exists(dest):
-                remove_path(dest)
-            init(dest)
-            log.info("Trying to use bundle %s", bundle)
-            try:
-                if not unbundle(bundle, dest):
-                    remove_path(dest)
-                    continue
-                adjust_paths(dest, default=repo)
-                # Now pull / update
-                return pull(repo, dest, update_dest=update_dest,
-                            mirrors=mirrors, revision=revision, branch=branch)
-            except Exception:
-                remove_path(dest)
-                log.exception("Problem unbundling/pulling from %s", bundle)
-                continue
-        else:
-            log.info("Using bundles failed; falling back to clone")
-
-    if mirrors:
-        log.info("Attempting to clone from mirrors")
-        for mirror in mirrors:
-            log.info("Cloning from %s", mirror)
-            try:
-                retval = clone(mirror, dest, branch, revision,
-                               update_dest=update_dest, clone_by_rev=clone_by_rev)
-                adjust_paths(dest, default=repo)
-                return retval
-            except:
-                log.exception("Problem cloning from mirror %s", mirror)
-                continue
-        else:
-            log.info("Pulling from mirrors failed; falling back to %s", repo)
-            # We may have a partial repo here; mercurial() copes with that
-            # We need to make sure our paths are correct though
-            if os.path.exists(os.path.join(dest, '.hg')):
-                adjust_paths(dest, default=repo)
-            return mercurial(repo, dest, branch, revision, autoPurge=True,
-                             update_dest=update_dest, clone_by_rev=clone_by_rev)
-
     cmd = ['clone', '--traceback']
     if not update_dest:
         cmd.append('-U')
 
     if clone_by_rev:
         if revision:
             cmd.extend(['-r', revision])
         elif branch:
@@ -345,34 +294,22 @@ def common_args(revision=None, branch=No
     if revision:
         args.extend(['-r', revision])
     elif branch:
         if hg_ver() >= (1, 6, 0):
             args.extend(['-b', branch])
     return args
 
 
-def pull(repo, dest, update_dest=True, mirrors=None, **kwargs):
+def pull(repo, dest, update_dest=True, **kwargs):
     """Pulls changes from hg repo and places it in `dest`.
 
     If `update_dest` is set, then `dest` will be updated to `revision` if
     set, otherwise to `branch`, otherwise to the head of default.
-
-    If `mirrors` is set, will try and pull from the mirrors first before
-    `repo`."""
-
-    if mirrors:
-        for mirror in mirrors:
-            try:
-                return pull(mirror, dest, update_dest=update_dest, **kwargs)
-            except:
-                log.exception("Problem pulling from mirror %s", mirror)
-                continue
-        else:
-            log.info("Pulling from mirrors failed; falling back to %s", repo)
+    """
 
     # Convert repo to an absolute path if it's a local repository
     repo = _make_absolute(repo)
     cmd = ['pull', '--traceback']
     # Don't pass -r to "hg pull", except when it's a valid HG revision.
     # Pulling using tag names is dangerous: it uses the local .hgtags, so if
     # the tag has moved on the remote side you won't pull the new revision the
     # remote tag refers to.
@@ -451,33 +388,26 @@ def push(src, remote, push_new_branches=
         cmd.append('-f')
     if push_new_branches:
         cmd.append('--new-branch')
     cmd.append(remote)
     run_cmd(cmd, cwd=src)
 
 
 def mercurial(repo, dest, branch=None, revision=None, update_dest=True,
-              shareBase=DefaultShareBase, clone_by_rev=False, mirrors=None,
-              bundles=None, autoPurge=False):
+              shareBase=DefaultShareBase, clone_by_rev=False, 
+              autoPurge=False):
     """Makes sure that `dest` is has `revision` or `branch` checked out from
     `repo`.
 
     Do what it takes to make that happen, including possibly clobbering
     dest.
 
     If `clone_by_rev` is True, use 'hg clone -r <rev>' instead of 'hg clone'.
     This is slower, but useful when cloning repos with lots of heads.
-
-    If `mirrors` is set, will try and use the mirrors before `repo`.
-
-    If `bundles` is set, will try and download the bundle first and
-    unbundle it instead of doing a full clone. If successful, will pull in
-    new revisions from mirrors or the master repo. If unbundling fails, will
-    fall back to doing a regular clone from mirrors or the master repo.
     """
     dest = os.path.abspath(dest)
     if shareBase is DefaultShareBase:
         shareBase = os.environ.get("HG_SHARE_BASE_DIR", None)
 
     log.info("Reporting hg version in use")
     cmd = ['hg', '-q', 'version']
     run_cmd(cmd, cwd='.')
@@ -522,18 +452,17 @@ def mercurial(repo, dest, branch=None, r
                 if autoPurge:
                     purge(dest)
                 if revision is not None and is_hg_cset(revision) and has_rev(dest, revision):
                     log.info("skipping pull since we already have %s", revision)
                     if update_dest:
                         return update(dest, branch=branch, revision=revision)
                     return revision
                 return pull(repo, dest, update_dest=update_dest, branch=branch,
-                            revision=revision,
-                            mirrors=mirrors)
+                            revision=revision)
             except subprocess.CalledProcessError:
                 log.warning("Error pulling changes into %s from %s; clobbering", dest, repo)
                 log.debug("Exception:", exc_info=True)
                 remove_path(dest)
 
     # If that fails for any reason, and sharing is requested, we'll try to
     # update the shared repository, and then update the working directory from
     # that.
@@ -563,17 +492,17 @@ def mercurial(repo, dest, branch=None, r
                 log.info("We're currently shared from %s, but are being requested to pull from %s (%s); clobbering",
                          dest_sharedPath_data, repo, norm_sharedRepo)
                 remove_path(dest)
 
         try:
             log.info("Updating shared repo")
             mercurial(repo, sharedRepo, branch=branch, revision=revision,
                       update_dest=False, shareBase=None, clone_by_rev=clone_by_rev,
-                      mirrors=mirrors, bundles=bundles, autoPurge=False)
+                      autoPurge=False)
             if os.path.exists(dest):
 
                 # Bug 969689: Check to see if the dest repo is still on a valid
                 # commit. It is possible that the shared repo was cloberred out
                 # from under us, effectively stripping our active commit. This
                 # can cause 'hg status', 'hg purge', and the like to do
                 # incorrect things. If we detect this situation, then it's best
                 # to clobber and re-create dest.
@@ -596,18 +525,17 @@ def mercurial(repo, dest, branch=None, r
             remove_path(dest)
     # end if shareBase
 
     if not os.path.exists(os.path.dirname(dest)):
         os.makedirs(os.path.dirname(dest))
 
     # Share isn't available or has failed, clone directly from the source
     return clone(repo, dest, branch, revision,
-                 update_dest=update_dest, mirrors=mirrors,
-                 bundles=bundles, clone_by_rev=clone_by_rev)
+                 update_dest=update_dest, clone_by_rev=clone_by_rev)
 
 
 def apply_and_push(localrepo, remote, changer, max_attempts=10,
                    ssh_username=None, ssh_key=None, force=False):
     """This function calls `changer' to make changes to the repo, and tries
        its hardest to get them to the origin repo. `changer' must be a
        callable object that receives two arguments: the directory of the local
        repository, and the attempt number. This function will push ALL
@@ -682,28 +610,16 @@ def path(src, name='default'):
         return None
 
 
 def init(dest):
     """Initializes an empty repo in `dest`"""
     run_cmd(['hg', 'init', dest])
 
 
-def unbundle(bundle, dest):
-    """Unbundles the bundle located at `bundle` into `dest`.
-
-    `bundle` can be a local file or remote url."""
-    try:
-        get_hg_output(['unbundle', '--traceback', bundle], timeout=3600,
-                      cwd=dest, include_stderr=True)
-        return True
-    except subprocess.CalledProcessError:
-        return False
-
-
 def adjust_paths(dest, **paths):
     """Adjusts paths in `dest`/.hg/hgrc so that names in `paths` are set to
     paths[name].
 
     Note that any comments in the hgrc will be lost if changes are made to the
     file."""
     hgrc = os.path.join(dest, '.hg', 'hgrc')
     config = RawConfigParser()
--- a/scripts/blocklist/sync-hg-blocklist.sh
+++ b/scripts/blocklist/sync-hg-blocklist.sh
@@ -9,17 +9,16 @@
 USAGE()
 {
 cat <<EOF
  DEPRECATED: use tools/scripts/periodic_file_updates/periodic_file_updates.sh instead.
 
  usage: `basename $0` [-n] [-c] [-d] [-a]
            [-p product]
            [--hgtool hgtool_location]
-           [--mirror hg_mirror --bundle bundle_location]
            [-u hg_ssh_user]
            [-k hg_ssh_key]
            [-r existing_repo_dir]
            -b branch
 
 EOF
 }
 
@@ -28,33 +27,29 @@ BRANCH=""
 CLOSED_TREE=false
 DONTBUILD=false
 APPROVAL=false
 HG_SSH_USER='ffxbld'
 HG_SSH_KEY='~cltbld/.ssh/ffxbld_rsa'
 PRODUCT='firefox'
 REPODIR='blocklist'
 HGTOOL=''
-MIRROR=''
-BUNDLE=''
 
 while [ $# -gt 0 ]; do
     case "$1" in
         -p) PRODUCT="$2"; shift;;
         -b) BRANCH="$2"; shift;;
         -n) DRY_RUN=true;;
         -c) CLOSED_TREE=true;;
         -d) DONTBUILD=true;;
         -a) APPROVAL=true;;
         -u) HG_SSH_USER="$2"; shift;;
         -k) HG_SSH_KEY="$2"; shift;;
         -r) REPODIR="$2"; shift;;
         --hgtool) HGTOOL="$2"; shift;;
-        --mirror) MIRROR="$2"; shift;;
-        --bundle) BUNDLE="$2"; shift;;
         -*) USAGE
             exit 1;;
         *)  break;; # terminate while loop
     esac
     shift
 done
 
 if [ "$BRANCH" == "" ]; then
@@ -155,22 +150,16 @@ compare_blocklists()
 update_blocklist_in_hg()
 {
     if [ ! -d ${REPODIR} ]; then
         CLONE_CMD=""
         if [ -f "${HGTOOL}" ]; then
 	    # Need to pass the default branch here to avoid pollution from buildprops.json
 	    # when hgtool.py is run in production.
 	    CLONE_CMD="${HGTOOL} --branch default"
-            if [ "${MIRROR}" != "" ]; then
-                CLONE_CMD="${CLONE_CMD} --mirror ${MIRROR}"
-            fi
-            if [ "${BUNDLE}" != "" ]; then
-                CLONE_CMD="${CLONE_CMD} --bundle ${BUNDLE}"
-	    fi
         else
 	    # Fallback on vanilla hg
 	    echo "hgtool.py not found. Falling back to vanilla hg."
             CLONE_CMD="${HG} clone"
         fi
         CLONE_CMD="${CLONE_CMD} ${HGREPO} ${REPODIR}"
 
         echo ${CLONE_CMD}
--- a/scripts/hsts/update_hsts_preload_list.sh
+++ b/scripts/hsts/update_hsts_preload_list.sh
@@ -3,17 +3,16 @@
 USAGE()
 {
 cat <<EOF
  DEPRECATED: use tools/scripts/periodic_file_updates/periodic_file_updates.sh instead.
 
  usage: `basename $0` [-n] [-c] [-d] [-a]
            [-p product]
            [--hgtool hgtool_location]
-           [--mirror hg_mirror --bundle bundle_location]
            [-u hg_ssh_user]
            [-k hg_ssh_key]
            [-r existing_repo_dir]
            -b branch
 
 EOF
 }
 
@@ -26,18 +25,16 @@ PLATFORM_EXT="tar.bz2"
 UNPACK_CMD="tar jxf"
 CLOSED_TREE=false
 DONTBUILD=false
 APPROVAL=false
 HG_SSH_USER='ffxbld'
 HG_SSH_KEY='~cltbld/.ssh/ffxbld_rsa'
 REPODIR='hsts'
 HGTOOL=''
-MIRROR=''
-BUNDLE=''
 APP_DIR="browser"
 LOCALHOST=`/bin/hostname -s`
 HGHOST="hg.mozilla.org"
 STAGEHOST="stage.mozilla.org"
 HG=hg
 WGET=wget
 UNZIP="unzip -q"
 DIFF="diff -up"
@@ -53,18 +50,16 @@ while [ $# -gt 0 ]; do
         -n) DRY_RUN=true;;
         -c) CLOSED_TREE=true;;
         -d) DONTBUILD=true;;
         -a) APPROVAL=true;;
         -u) HG_SSH_USER="$2"; shift;;
         -k) HG_SSH_KEY="$2"; shift;;
         -r) REPODIR="$2"; shift;;
         --hgtool) HGTOOL="$2"; shift;;
-        --mirror) MIRROR="$2"; shift;;
-        --bundle) BUNDLE="$2"; shift;;
         -*) USAGE
             exit 1;;
         *)  break;; # terminate while loop
     esac
     shift
 done
 
 if [ "$BRANCH" == "" ]; then
@@ -174,22 +169,16 @@ compare_preload_lists()
 update_preload_list_in_hg()
 {
     if [ ! -d ${REPODIR} ]; then
         CLONE_CMD=""
         if [ -f "${HGTOOL}" ]; then
 	    # Need to pass the default branch here to avoid pollution from buildprops.json
 	    # when hgtool.py is run in production.
 	    CLONE_CMD="${HGTOOL} --branch default"
-            if [ "${MIRROR}" != "" ]; then
-                CLONE_CMD="${CLONE_CMD} --mirror ${MIRROR}"
-            fi
-            if [ "${BUNDLE}" != "" ]; then
-                CLONE_CMD="${CLONE_CMD} --bundle ${BUNDLE}"
-	    fi
         else
 	    # Fallback on vanilla hg
 	    echo "hgtool.py not found. Falling back to vanilla hg."
             CLONE_CMD="${HG} clone"
         fi
         CLONE_CMD="${CLONE_CMD} ${HGREPO} ${REPODIR}"
 
         echo ${CLONE_CMD}
--- a/scripts/spidermonkey_builds/spidermonkey.sh
+++ b/scripts/spidermonkey_builds/spidermonkey.sh
@@ -6,35 +6,27 @@ SCRIPTS_DIR=$PWD
 popd > /dev/null
 
 SPIDERDIR=$SCRIPTS_DIR/scripts/spidermonkey_builds
 ROBUSTCHECKOUT=${SCRIPTS_DIR}/hgext/robustcheckout.py
 
 DEFAULT_REPO="https://hg.mozilla.org/integration/mozilla-inbound"
 
 function usage() {
-  echo "Usage: $0 [-m mirror_url] [-b bundle_url] [-r revision] [--dep] variant"
+  echo "Usage: $0 [-r revision] [--dep] variant"
   if [ -z "$PROPERTIES_FILE" ]; then
     echo "PROPERTIES_FILE must be set for an automation build"
   fi
 }
 
 HG_REV=
 noclean=""
 VARIANT=""
 while [ $# -gt 0 ]; do
     case "$1" in
-        -m|--mirror)
-            shift
-            shift
-            ;;
-        -b|--bundle)
-            shift
-            shift
-            ;;
         --ttserver)
             # Note that this script (and tooltool_wrapper.sh, and tooltool.py)
             # only accepts a single tooltool server, so all but the last will
             # be ignored.
             shift
             TT_SERVER="$1"
             shift
             ;;
deleted file mode 100755
--- a/scripts/valgrind/valgrind.sh
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/bash
-set -e
-set -x
-SCRIPTS_DIR="$(readlink -f $(dirname $0)/../..)"
-
-if [ -f "$PROPERTIES_FILE" ]; then
-    PYTHON="/tools/python/bin/python"
-    [ -x $PYTHON ] || PYTHON="${PYTHON}2.7"
-    [ -x $PYTHON ] || PYTHON=$(which python2.7)
-    [ -x $PYTHON ] || PYTHON=python
-    JSONTOOL="$PYTHON $SCRIPTS_DIR/buildfarm/utils/jsontool.py"
-
-    builder=$($JSONTOOL -k properties.buildername $PROPERTIES_FILE)
-    slavename=$($JSONTOOL -k properties.slavename $PROPERTIES_FILE)
-    master=$($JSONTOOL -k properties.master $PROPERTIES_FILE)
-    branch=$($JSONTOOL -k properties.branch $PROPERTIES_FILE)
-    REVISION=$($JSONTOOL -k properties.revision $PROPERTIES_FILE)
-
-    BRANCHES_JSON=$SCRIPTS_DIR/buildfarm/maintenance/production-branches.json
-
-    HG_REPO=$($JSONTOOL -k ${branch}.repo $BRANCHES_JSON)
-    HG_BUNDLE="http://ftp.mozilla.org/pub/mozilla.org/firefox/bundles/${branch}.hg"
-
-    builddir=$(basename $(readlink -f .))
-
-    # Clobbering
-    if [ -z "$CLOBBERER_URL" ]; then
-        export CLOBBERER_URL="https://api.pub.build.mozilla.org/clobberer/lastclobber"
-    fi
-
-    (cd $SCRIPTS_DIR/../..
-    $PYTHON $SCRIPTS_DIR/clobberer/clobberer.py -s scripts -s $(basename $PROPERTIES_FILE) \
-        $CLOBBERER_URL $branch "$builder" $builddir $slavename $master)
-
-    # Purging
-    (cd $SCRIPTS_DIR/..
-    $PYTHON -u $SCRIPTS_DIR/buildfarm/maintenance/purge_builds.py \
-        -s 8 -n info -n 'rel-*' -n 'tb-rel-*' -n $builddir)
-fi
-if [ -z "$HG_REPO" ]; then
-    export HG_REPO="https://hg.mozilla.org/mozilla-central"
-    export HG_BUNDLE="https://ftp.mozilla.org/pub/mozilla.org/firefox/bundles/mozilla-central.hg"
-fi
-if [ -z "$REVISION" ]; then
-    export REVISION="default"
-fi
-
-$PYTHON $SCRIPTS_DIR/buildfarm/utils/retry.py -s 1 -r 5 -t 3660 \
-     $PYTHON $SCRIPTS_DIR/buildfarm/utils/hgtool.py --rev $REVISION \
-          --bundle $HG_BUNDLE $HG_REPO src || exit 2
-
-# Put our short revisions into the properties directory for consumption by buildbot.
-if [ ! -d properties ]; then
-    mkdir properties
-fi
-pushd src; GOT_REVISION=`hg parent --template={node} | cut -c1-12`; popd
-echo "revision: $GOT_REVISION" > properties/revision
-echo "got_revision: $GOT_REVISION" > properties/got_revision
-
-if [ -f src/build/valgrind/valgrind.sh ]; then
-    bash src/build/valgrind/valgrind.sh
-    exit $?
-fi
-
-srcdir=$PWD/src
-objdir=${MOZ_OBJDIR-objdir}
-
-# If the objdir is a relative path, it is relative to the srcdir.
-case "$objdir" in
-    /*)
-	;;
-    *)
-        objdir="$srcdir/$objdir"
-	;;
-esac
-
-if [ ! -d $objdir ]; then
-    mkdir $objdir
-fi
-cd $objdir
-
-if [ "`uname -m`" = "x86_64" ]; then
-    export LD_LIBRARY_PATH=/tools/gcc-4.5-0moz3/installed/lib64
-    _arch=64
-else
-    export LD_LIBRARY_PATH=/tools/gcc-4.5-0moz3/installed/lib
-    _arch=32
-fi
-
-# Note: an exit code of 2 turns the job red on TBPL.
-MOZCONFIG=$srcdir/browser/config/mozconfigs/linux${_arch}/valgrind make -f $srcdir/client.mk configure || exit 2
-make -j4 || exit 2
-make package || exit 2
-
-# We need to set MOZBUILD_STATE_PATH so that |mach| skips its first-run
-# initialization step and actually runs the |valgrind-test| command.
-export MOZBUILD_STATE_PATH=.
-
-# |mach valgrind-test|'s exit code will be 1 (which turns the job orange on
-# TBPL) if Valgrind finds errors, and 2 (which turns the job red) if something
-# else goes wrong, such as Valgrind crashing.
-python2.7 $srcdir/mach valgrind-test
-exit $?