• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python hg.make_hg_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中util.hg.make_hg_url函数的典型用法代码示例。如果您正苦于以下问题:Python make_hg_url函数的具体用法?Python make_hg_url怎么用?Python make_hg_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了make_hg_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: verify_configs

def verify_configs(configs_dir, revision, hghost, configs_repo, changesets,
                   filename):
    """Check the release_configs and l10n-changesets against tagged
    revisions"""

    release_config_file = path.join(configs_dir, 'mozilla', filename)
    l10n_changesets_file = path.join(configs_dir, 'mozilla', changesets)
    configs_url = make_hg_url(hghost, configs_repo, revision=revision,
                              filename=path.join('mozilla', filename))
    l10n_url = make_hg_url(hghost, configs_repo, revision=revision,
                           filename=path.join('mozilla', changesets))

    success = True
    try:
        official_configs = urllib2.urlopen(configs_url)
        log.info("Comparing tagged revision %s to on-disk %s ..." % (
            configs_url, filename))
        if not compare(official_configs, release_config_file):
            log.error("local configs do not match tagged revisions in repo")
            success = False
            error_tally.add('verify_configs')
        l10n_changesets = urllib2.urlopen(l10n_url)
        log.info("Comparing tagged revision %s to on-disk %s ..." % (
            l10n_url, changesets))
        if not compare(l10n_changesets, l10n_changesets_file):
            log.error("local l10n-changesets do not match tagged revisions"
                      " in repo")
            success = False
            error_tally.add('verify_configs')
    except urllib2.HTTPError:
        log.error("cannot find configs in repo %s" % configs_url)
        log.error("cannot find configs in repo %s" % l10n_url)
        success = False
        error_tally.add('verify_configs')
    return success
开发者ID:magnyld,项目名称:build-tools,代码行数:35,代码来源:release_sanity.py


示例2: tagOtherRepo

def tagOtherRepo(config, repo, reponame, revision, pushAttempts):
    remote = make_hg_url(HG, repo)
    mercurial(remote, reponame)

    def tagRepo(repo, attempt, config, revision, tags):
        # set totalChangesets=1 because tag() generates exactly 1 commit
        totalChangesets = 1
        # update to the desired revision first, then to the tip of revision's
        # branch to avoid new head creation
        update(repo, revision=revision)
        update(repo)
        tag(repo, revision, tags, config['hgUsername'])
        outgoingRevs = retry(out, kwargs=dict(src=reponame, remote=remote,
                                              ssh_username=config[
                                                  'hgUsername'],
                                              ssh_key=config['hgSshKey']))
        if len(outgoingRevs) != totalChangesets:
            raise Exception("Wrong number of outgoing revisions")

    pushRepo = make_hg_url(HG, repo, protocol='ssh')

    def tag_wrapper(r, n):
        tagRepo(r, n, config, revision, tags)

    def cleanup_wrapper():
        cleanOutgoingRevs(reponame, pushRepo, config['hgUsername'],
                          config['hgSshKey'])
    retry(apply_and_push, cleanup=cleanup_wrapper,
          args=(reponame, pushRepo, tag_wrapper, pushAttempts),
          kwargs=dict(ssh_username=config['hgUsername'],
                      ssh_key=config['hgSshKey']))
开发者ID:SergiosLen,项目名称:browser-f,代码行数:31,代码来源:tag-release.py


示例3: testMakeHGUrlNoRevisionNoFilename

 def testMakeHGUrlNoRevisionNoFilename(self):
     repo_url = make_hg_url(
         "hg.mozilla.org",
         "/build/tools"
     )
     expected_url = "https://hg.mozilla.org/build/tools"
     self.assertEquals(repo_url, expected_url)
开发者ID:bdacode,项目名称:build-tools,代码行数:7,代码来源:test_util_hg.py


示例4: testMakeHGUrl

 def testMakeHGUrl(self):
     # construct an hg url specific to revision, branch and filename and try
     # to pull it down
     file_url = make_hg_url(
         "hg.mozilla.org", "//build/tools/", revision="FIREFOX_3_6_12_RELEASE", filename="/lib/python/util/hg.py"
     )
     expected_url = "https://hg.mozilla.org/build/tools/raw-file/FIREFOX_3_6_12_RELEASE/lib/python/util/hg.py"
     self.assertEquals(file_url, expected_url)
开发者ID:B-Rich,项目名称:build-tools,代码行数:8,代码来源:test_util_hg.py


示例5: testMakeHGUrlDifferentProtocol

 def testMakeHGUrlDifferentProtocol(self):
     repo_url = make_hg_url(
         "hg.mozilla.org",
         "/build/tools",
         protocol='ssh'
     )
     expected_url = "ssh://hg.mozilla.org/build/tools"
     self.assertEquals(repo_url, expected_url)
开发者ID:bdacode,项目名称:build-tools,代码行数:8,代码来源:test_util_hg.py


示例6: testMakeHGUrlNoFilename

 def testMakeHGUrlNoFilename(self):
     file_url = make_hg_url(
         "hg.mozilla.org",
         "/build/tools",
         revision="default"
     )
     expected_url = "https://hg.mozilla.org/build/tools/rev/default"
     self.assertEquals(file_url, expected_url)
开发者ID:bdacode,项目名称:build-tools,代码行数:8,代码来源:test_util_hg.py


示例7: bump_configs

def bump_configs(server, username, sshKey, repo, repoPath, configsToBump,
                 configsToOverride):
    reponame = get_repo_name(repo)
    repo_url = make_hg_url(server, '%s/%s' % (repoPath, reponame))
    pushRepo = make_hg_url(server, '%s/%s' % (repoPath, reponame),
                               protocol='ssh')
    retry(mercurial, args=(repo_url, reponame))

    def bump(repo, configsToBump, configsToOverride):
        """Process dynamic (version, buildNumber, etc.) variables in
        configsToBump, then append overrides files to both configsToBump and
        configsToOverride."""
        # First pass. Bump variables in configsToBump.
        configs = ['%s/%s' % (repo, x) for x in configsToBump.keys()]
        cmd = ['python', BUMP_SCRIPT, '--bump-version', '--revision=tip']
        cmd.extend(configs)
        run_cmd(cmd)
        # Second pass. Append override files to configsToBump and
        # configsToOverride.
        for config, overrides in \
            configsToBump.items() + configsToOverride.items():
            newContent = cat([path.join(repo, config)] +
                          [path.join(repo, x) for x in overrides])
            fh = open(path.join(repo, config), 'wb')
            fh.write(newContent)
            fh.close()
        run_cmd(['hg', 'commit', '-m', 'Automatic config bump'],
                cwd=repo)

    def bump_wrapper(r, n):
        bump(r, configsToBump, configsToOverride)

    def cleanup_wrapper():
        cleanOutgoingRevs(reponame, pushRepo, username, sshKey)

    retry(apply_and_push, cleanup=cleanup_wrapper,
          args=(reponame, pushRepo, bump_wrapper),
          kwargs=dict(ssh_username=username, ssh_key=sshKey))

    tags = []
    for configfile in configsToBump.keys():
        config = readReleaseConfig(path.join(reponame, configfile))
        tags.extend(getTags(config['baseTag'], config['buildNumber'],
                            buildTag=True))
    return tags
开发者ID:EkkiD,项目名称:build-tools,代码行数:45,代码来源:repo_setup.py


示例8: tagRepo

def tagRepo(config, repo, reponame, revision, tags, bumpFiles, relbranch,
            pushAttempts, defaultBranch='default'):
    remote = make_hg_url(HG, repo)
    mercurial(remote, reponame)

    def bump_and_tag(repo, attempt, config, relbranch, revision, tags,
                     defaultBranch):
        # set relbranchChangesets=1 because tag() generates exactly 1 commit
        relbranchChangesets = 1
        defaultBranchChangesets = 0

        if relbranch in get_branches(reponame):
            update(reponame, revision=relbranch)
        else:
            update(reponame, revision=revision)
            run_cmd(['hg', 'branch', relbranch], cwd=reponame)

        if len(bumpFiles) > 0:
            # Bump files on the relbranch, if necessary
            bump(reponame, bumpFiles, 'version')
            run_cmd(['hg', 'diff'], cwd=repo)
            try:
                get_output(['hg', 'commit', '-u', config['hgUsername'],
                            '-m', getBumpCommitMessage(config['productName'], config['version'])],
                           cwd=reponame)
                relbranchChangesets += 1
            except subprocess.CalledProcessError, e:
                # We only want to ignore exceptions caused by having nothing to
                # commit, which are OK. We still want to raise exceptions caused
                # by any other thing.
                if e.returncode != 1 or "nothing changed" not in e.output:
                    raise

        # We always want our tags pointing at the tip of the relbranch
        # so we need to grab the current revision after we've switched
        # branches and bumped versions.
        revision = get_revision(reponame)
        # Create the desired tags on the relbranch
        tag(repo, revision, tags, config['hgUsername'])

        # This is the bump of the version on the default branch
        # We do it after the other one in order to get the tip of the
        # repository back on default, thus avoiding confusion.
        if len(bumpFiles) > 0:
            update(reponame, revision=defaultBranch)
            bump(reponame, bumpFiles, 'nextVersion')
            run_cmd(['hg', 'diff'], cwd=repo)
            try:
                get_output(['hg', 'commit', '-u', config['hgUsername'],
                            '-m', getBumpCommitMessage(config['productName'], config['version'])],
                           cwd=reponame)
                defaultBranchChangesets += 1
            except subprocess.CalledProcessError, e:
                if e.returncode != 1 or "nothing changed" not in e.output:
                    raise
开发者ID:SergiosLen,项目名称:browser-f,代码行数:55,代码来源:tag-release.py


示例9: tag_repo

def tag_repo(server, username, sshKey, repo, repoPath, tags):
    reponame = get_repo_name(repo)
    repo_url = make_hg_url(server, '%s/%s' % (repoPath, reponame))
    pushRepo = make_hg_url(server, '%s/%s' % (repoPath, reponame),
                               protocol='ssh')
    mercurial(repo_url, reponame)

    def do_tag(repo, tags):
        cmd = ['hg', 'tag', '-f', '-m', 'Automatic preproduction tag'] + tags
        run_cmd(cmd, cwd=repo)

    def do_tag_wrapper(r, n):
        do_tag(r, tags)

    def cleanup_wrapper():
        cleanOutgoingRevs(reponame, pushRepo, username, sshKey)

    retry(apply_and_push, cleanup=cleanup_wrapper,
          args=(reponame, pushRepo, do_tag_wrapper),
          kwargs=dict(ssh_username=username, ssh_key=sshKey))
开发者ID:EkkiD,项目名称:build-tools,代码行数:20,代码来源:repo_setup.py


示例10: maybe_delete_repo

def maybe_delete_repo(server, username, sshKey, repo, repoPath):
    reponame = get_repo_name(repo)
    repo_url = make_hg_url(server, '%s/%s' % (repoPath, reponame))
    try:
        log.info("Trying to open %s" % repo_url)
        urlopen(repo_url)
    except URLError:
        log.info("%s doesn't exist, not deleting" % reponame)
    else:
        log.info('Deleting %s' % reponame)
        retry(run_remote_cmd, args=('edit %s delete YES' % reponame, server,
                                    username, sshKey))
开发者ID:EkkiD,项目名称:build-tools,代码行数:12,代码来源:repo_setup.py


示例11: tagOtherRepo

def tagOtherRepo(config, repo, reponame, revision, pushAttempts):
    remote = make_hg_url(HG, repo)
    retry(mercurial, args=(remote, reponame))

    def tagRepo(repo, attempt, config, revision, tags):
        totalChangesets = len(tags)
        tag(repo, revision, tags, config['hgUsername'])
        outgoingRevs = retry(out, kwargs=dict(src=reponame, remote=remote,
                                              ssh_username=config['hgUsername'],
                                              ssh_key=config['hgSshKey']))
        if len(outgoingRevs) != totalChangesets:
            raise Exception("Wrong number of outgoing revisions")
    
    pushRepo = make_hg_url(HG, repo, protocol='ssh')
    def tag_wrapper(r, n):
        tagRepo(r, n, config, revision, tags)
    def cleanup_wrapper():
        cleanOutgoingRevs(reponame, pushRepo, config['hgUsername'],
                          config['hgSshKey'])
    retry(apply_and_push, cleanup=cleanup_wrapper,
          args=(reponame, pushRepo, tag_wrapper, pushAttempts),
          kwargs=dict(ssh_username=config['hgUsername'],
                      ssh_key=config['hgSshKey']))
开发者ID:EkkiD,项目名称:build-tools,代码行数:23,代码来源:tag-release.py


示例12: verify_repo

def verify_repo(branch, revision, hghost):
    """Poll the hgweb interface for a given branch and revision to
       make sure it exists"""
    repo_url = make_hg_url(hghost, branch, revision=revision)
    log.info("Checking for existence of %s..." % repo_url)
    success = True
    try:
        repo_page = urllib2.urlopen(repo_url)
        log.info("Got: %s !" % repo_page.geturl())
    except urllib2.HTTPError:
        log.error("Repo does not exist with required revision. Check again, or use -b to bypass")
        success = False
        error_tally.add('verify_repo')
    return success
开发者ID:mjessome,项目名称:tools,代码行数:14,代码来源:release_sanity.py


示例13: verify_mozconfigs

def verify_mozconfigs(branch, revision, hghost, product, mozconfigs, appName, whitelist=None):
    """Compare nightly mozconfigs for branch to release mozconfigs and compare to whitelist of known differences"""
    if whitelist:
        mozconfigWhitelist = readConfig(whitelist, ['whitelist'])
    else:
        mozconfigWhitelist = {}
    log.info("Comparing %s mozconfigs to nightly mozconfigs..." % product)
    success = True
    types = {'+': 'release', '-': 'nightly'}
    for platform,mozconfig in mozconfigs.items():
        urls = []
        mozconfigs = []
        # Create links to the two mozconfigs.
        releaseConfig = make_hg_url(hghost, branch, 'http', revision, mozconfig)
        urls.append(releaseConfig)
        # The nightly one is the exact same URL, with the file part changed.
        urls.append(releaseConfig.rstrip('release') + 'nightly')
        for url in urls:
            try:
                mozconfigs.append(urllib2.urlopen(url).readlines())
            except urllib2.HTTPError as e:
                log.error("MISSING: %s - ERROR: %s" % (url, e.msg))
        diffInstance = difflib.Differ()
        if len(mozconfigs) == 2:
            diffList = list(diffInstance.compare(mozconfigs[0],mozconfigs[1]))
            for line in diffList:
                clean_line = line[1:].strip()
                if (line[0] == '-'  or line[0] == '+') and len(clean_line) > 1:
                    # skip comment lines
                    if clean_line.startswith('#'):
                        continue
                    # compare to whitelist
                    if line[0] == '-' and mozconfigWhitelist.get(branch, {}).has_key(platform) \
                        and clean_line in mozconfigWhitelist[branch][platform]:
                            continue
                    if line[0] == '+' and mozconfigWhitelist.get('nightly', {}).has_key(platform) \
                        and clean_line in mozconfigWhitelist['nightly'][platform]:
                            continue
                    if line[0] == '-':
                        opposite = 'release'
                    else:
                        opposite = 'nightly'
                    log.error("not in %s mozconfig's whitelist (%s/%s/%s) : %s" % (opposite, branch, platform, types[line[0]], clean_line))
                    success = False
                    error_tally.add('verify_mozconfig')
        else:
            log.info("Missing mozconfigs to compare for %s" % platform)
            error_tally.add("verify_mozconfigs: Confirm that %s does not have release/nightly mozconfigs to compare" % platform)
    return success
开发者ID:mjessome,项目名称:tools,代码行数:49,代码来源:release_sanity.py


示例14: verify_mozconfigs

def verify_mozconfigs(branch, version, hghost, product, platforms, whitelist=None):
    """Compare nightly mozconfigs for branch to release mozconfigs and compare to whitelist of known differences"""
    if whitelist:
        mozconfigWhitelist = readConfig(whitelist, ['whitelist'])
    else:
        mozconfigWhitelist = {}
    log.info("Comparing %s mozconfigs to nightly mozconfigs..." % product)
    success = True
    types = {'+': 'release', '-': 'nightly'}
    tag = ''.join([product.upper(), "_",  version.replace('.','_'), "_RELEASE"])
    for platform in platforms:
        urls = []
        mozconfigs = []
        for type in types.values():
            urls.append(make_hg_url(hghost, 'build/buildbot-configs', 'http', 
                                tag, os.path.join('mozilla2', platform, 
                                branch, type,'mozconfig')))
        for url in urls:
            try:
                mozconfigs.append(urllib2.urlopen(url).readlines())
            except urllib2.HTTPError as e:
                log.error("MISSING: %s - ERROR: %s" % (url, e.msg))
        diffInstance = difflib.Differ()
        if len(mozconfigs) == 2:
            diffList = list(diffInstance.compare(mozconfigs[0],mozconfigs[1]))
            for line in diffList:
                clean_line = line[1:].strip()
                if (line[0] == '-'  or line[0] == '+') and len(clean_line) > 1:
                    # skip comment lines
                    if clean_line.startswith('#'):
                        continue
                    # compare to whitelist
                    if line[0] == '-' and mozconfigWhitelist.get(branch, {}).has_key(platform) \
                        and clean_line in mozconfigWhitelist[branch][platform]:
                            continue
                    if line[0] == '+' and mozconfigWhitelist.get('nightly', {}).has_key(platform) \
                        and clean_line in mozconfigWhitelist['nightly'][platform]:
                            continue
                    if line[0] == '-':
                        opposite = 'release'
                    else:
                        opposite = 'nightly'
                    log.error("not in %s mozconfig's whitelist (%s/%s/%s) : %s" % (opposite, branch, platform, types[line[0]], clean_line))
                    success = False
                    error_tally.add('verify_mozconfig')
        else:
            log.info("Missing mozconfigs to compare for %s" % platform)
            error_tally.add("verify_mozconfigs: Confirm that %s does not have release/nightly mozconfigs to compare" % platform)
    return success
开发者ID:EkkiD,项目名称:build-tools,代码行数:49,代码来源:release_sanity.py


示例15: tagRepo

def tagRepo(config, repo, reponame, revision, tags, bumpFiles, relbranch,
            pushAttempts):
    remote = make_hg_url(HG, repo)
    mercurial(remote, reponame)

    def bump_and_tag(repo, attempt, config, relbranch, revision, tags):
        # set relbranchChangesets=1 because tag() generates exactly 1 commit
        relbranchChangesets = 1

        if relbranch in get_branches(reponame):
            update(reponame, revision=relbranch)
        else:
            update(reponame, revision=revision)
            run_cmd(['hg', 'branch', relbranch], cwd=reponame)

        if len(bumpFiles) > 0:
            # Bump files on the relbranch, if necessary
            bump(reponame, bumpFiles, 'version')
            run_cmd(['hg', 'diff'], cwd=repo)
            try:
                get_output(['hg', 'commit', '-u', config['hgUsername'],
                            '-m', getBumpCommitMessage(config['productName'], config['version'])],
                           cwd=reponame)
                relbranchChangesets += 1
            except subprocess.CalledProcessError, e:
                # We only want to ignore exceptions caused by having nothing to
                # commit, which are OK. We still want to raise exceptions caused
                # by any other thing.
                if e.returncode != 1 or "nothing changed" not in e.output:
                    raise

        # We always want our tags pointing at the tip of the relbranch
        # so we need to grab the current revision after we've switched
        # branches and bumped versions.
        revision = get_revision(reponame)
        # Create the desired tags on the relbranch
        tag(repo, revision, tags, config['hgUsername'])

        # Validate that the repository is only different from the remote in
        # ways we expect.
        outgoingRevs = out(src=reponame, remote=remote,
                           ssh_username=config['hgUsername'],
                           ssh_key=config['hgSshKey'])

        if len([r for r in outgoingRevs if r[BRANCH] == relbranch]) != relbranchChangesets:
            raise Exception("Incorrect number of revisions on %s" % relbranch)
        if len(outgoingRevs) != relbranchChangesets:
            raise Exception("Wrong number of outgoing revisions")
开发者ID:MihaiTabara,项目名称:build-tools,代码行数:48,代码来源:tag-release.py


示例16: verify_build

def verify_build(sourceRepo, hghost):
    """ Ensure that the bumpFiles match what the release config wants them to be"""
    success = True
    for filename, versions in sourceRepo['bumpFiles'].iteritems():
        try:
            url = make_hg_url(hghost, sourceRepo['path'],
                              revision=sourceRepo['revision'],
                              filename=filename)
            found_version = urllib2.urlopen(url).read()
            if not findVersion(found_version, versions['version']):
                log.error("%s has incorrect version '%s' (expected '%s')" % \
                  (filename, found_version, versions['version']))
                success = False
                error_tally.add('verify_build')
        except urllib2.HTTPError, inst:
            log.error("cannot find %s. Check again, or -b to bypass" % inst.geturl())
            success = False
            error_tally.add('verify_build')
开发者ID:mjessome,项目名称:tools,代码行数:18,代码来源:release_sanity.py


示例17: verify_l10n_changesets

def verify_l10n_changesets(hgHost, l10n_changesets):
    """Checks for the existance of all l10n changesets"""
    success = True
    locales = query_locale_revisions(l10n_changesets)
    for locale in sorted(locales.keys()):
        revision = locales[locale]
        localePath = '%(repoPath)s/%(locale)s/file/%(revision)s' % {
            'repoPath': releaseConfig['l10nRepoPath'].strip('/'),
            'locale': locale,
            'revision': revision,
        }
        locale_url = make_hg_url(hgHost, localePath, protocol='https')
        log.info("Checking for existence l10n changeset %s %s in repo %s ..."
                 % (locale, revision, locale_url))
        try:
            urllib2.urlopen(locale_url)
        except urllib2.HTTPError, e:
            log.error("error checking l10n changeset %s: %d %s" % (locale_url, e.code, e.reason))
            success = False
            error_tally.add('verify_l10n')
开发者ID:magnyld,项目名称:build-tools,代码行数:20,代码来源:release_sanity.py


示例18: verify_l10n_changesets

def verify_l10n_changesets(hgHost, l10n_changesets):
    """Checks for the existance of all l10n changesets"""
    success = True
    locales = query_locale_revisions(l10n_changesets)
    for locale in sorted(locales.keys()):
        revision = locales[locale]
        localePath = '%(repoPath)s/%(locale)s/file/%(revision)s' % {
            'repoPath': releaseConfig['l10nRepoPath'].strip('/'),
            'locale': locale,
            'revision': revision,
        }
        locale_url = make_hg_url(hgHost, localePath, protocol='https')
        log.info("Checking for existence l10n changeset %s %s in repo %s ..."
                 % (locale, revision, locale_url))

        success = retry(get_l10n_changesets,
                        kwargs=dict(locale_url=locale_url), attempts=3,
                        sleeptime=1, retry_exceptions=(urllib2.HTTPError,))
        if not success:
            error_tally.add('verify_l10n')
    return success
开发者ID:Callek,项目名称:build-tools,代码行数:21,代码来源:release_sanity.py


示例19: __init__

    def __init__(self, rmConfig, **kwargs):
        BuildFactory.__init__(self, **kwargs)

        self.addStep(SetProperty(
            name='set_topdir',
            command=['pwd'],
            property='topdir',
            workdir='.',
        ))
        self.addStep(ShellCommand(
            command=['rm', '-rvf', 'tools', 'buildbot-configs'],
            workdir='.',
        ))
        self.addStep(ShellCommand(
            command=['hg', 'clone',
                     make_hg_url(rmConfig['HG_HOST'], 'build/tools'),
                     'tools'],
            workdir='.',
            haltOnFailure=True,
        ))
        self.addStep(ShellCommand(
            command=[rmConfig['PYTHON'], 'scripts/preproduction/repo_setup.py', '-c',
                     'scripts/preproduction/repo_setup_config.py'],
            workdir='tools',
            haltOnFailure=True,
        ))
        self.addStep(SetProperty(
            property='previousSetupMakefile',
            command='ls %s/Makefile 2>/dev/null || exit 0' %
                rmConfig['releaseMasterDir'],
            flunkOnFailure=False,
            haltOnFailure=False,
            warnOnFailure=True,
        ))

        def previousSetupExists(step):
            return \
                step.build.getProperties().has_key('previousSetupMakefile') \
                and len(step.build.getProperty('previousSetupMakefile')) > 0

        self.addStep(ShellCommand(
            command=[rmConfig['PYTHON'],
                     'tools/buildfarm/maintenance/buildbot-wrangler.py',
                     'stop', '%s/master' % rmConfig['releaseMasterDir']],
            workdir=rmConfig['releaseMasterDir'],
            flunkOnFailure=False,
            doStepIf=previousSetupExists,
        ))
        self.addStep(ShellCommand(
            command=['rm', '-rvf', rmConfig['releaseMasterDir']],
            workdir='.',
            haltOnFailure=True,
        ))
        self.addStep(ShellCommand(
            command=['rm', '-rvf', 'buildbot-configs'],
            workdir='.',
            haltOnFailure=True,
        ))
        self.addStep(ShellCommand(
            command=['hg', 'clone',
                     make_hg_url(rmConfig['HG_HOST'],
                                 '%s/buildbot-configs' % rmConfig['HG_DIR']),
                     'buildbot-configs'],
            workdir='.',
            haltOnFailure=True,
        ))
        self.addStep(ShellCommand(
            command=['make', '-f', 'Makefile.setup',
                     'PYTHON=%s' % rmConfig['PYTHON'],
                     'VIRTUALENV=%s' % rmConfig['VIRTUALENV'],
                     'HG_DIR=%s' % rmConfig['HG_DIR'],
                     'MASTER_NAME=pp-release',
                     'MASTERS_JSON=/home/cltbld/conf/master_config.json',
                     'BASEDIR=%s' % rmConfig['releaseMasterDir'],
                     'BUILDBOTCUSTOM_BRANCH=%s' %
                        rmConfig['BUILDBOTCUSTOM_BRANCH'],
                     'BUILDBOTCONFIGS_BRANCH=%s' %
                        rmConfig['BUILDBOTCONFIGS_BRANCH'],
                     'UNIVERSAL=1',
                     'virtualenv', 'deps', 'install-buildbot', 'master',
                     'master-makefile'],
            workdir='buildbot-configs',
            env={'PIP_DOWNLOAD_CACHE': WithProperties('%(topdir)s/cache'),
                 'CC': None,
                 'CXX': None
                },
            haltOnFailure=True,
        ))
        self.addStep(ShellCommand(
            command=['make', 'checkconfig'],
            workdir=rmConfig['releaseMasterDir'],
            haltOnFailure=True,
        ))
        self.addStep(ShellCommand(
            command=['touch', 'twistd.log'],
            workdir='%s/master' % rmConfig['releaseMasterDir'],
        ))
        self.addStep(ShellCommand(
            command=[
                'bash', '-c',
#.........这里部分代码省略.........
开发者ID:mozilla,项目名称:build-preproduction,代码行数:101,代码来源:release_master.py


示例20: verify_mozconfigs

def verify_mozconfigs(branch, revision, hghost, product, mozconfigs,
                      nightly_mozconfigs, whitelist=None):
    """Compare nightly mozconfigs for branch to release mozconfigs and
    compare to whitelist of known differences"""
    branch_name = get_repo_name(branch)
    if whitelist:
        mozconfigWhitelist = readConfig(whitelist, ['whitelist'])
    else:
        mozconfigWhitelist = {}
    log.info("Comparing %s mozconfigs to nightly mozconfigs..." % product)
    success = True
    for platform, mozconfig in mozconfigs.items():
        urls = []
        mozconfigs = []
        nightly_mozconfig = nightly_mozconfigs[platform]
        mozconfig_paths = [mozconfig, nightly_mozconfig]
        # Create links to the two mozconfigs.
        for c in mozconfig, nightly_mozconfig:
            urls.append(make_hg_url(hghost, branch, 'http', revision, c))
        for url in urls:
            try:
                mozconfigs.append(urllib2.urlopen(url).readlines())
            except urllib2.HTTPError as e:
                log.error("MISSING: %s - ERROR: %s" % (url, e.msg))
                # Nothing to compare against
                return False
        diffInstance = difflib.Differ()
        if len(mozconfigs) == 2:
            diffList = list(diffInstance.compare(mozconfigs[0], mozconfigs[1]))
            for line in diffList:
                clean_line = line[1:].strip()
                if (line[0] == '-' or line[0] == '+') and len(clean_line) > 1:
                    # skip comment lines
                    if clean_line.startswith('#'):
                        continue
                    # compare to whitelist
                    message = ""
                    if line[0] == '-':
                        # handle lines that move around in diff
                        if '+' + line[1:] in diffList:
                            continue
                        if platform in mozconfigWhitelist.get(branch_name, {}):
                            if clean_line in \
                                    mozconfigWhitelist[branch_name][platform]:
                                continue
                    elif line[0] == '+':
                        if '-' + line[1:] in diffList:
                            continue
                        if platform in mozconfigWhitelist.get('nightly', {}):
                            if clean_line in \
                                    mozconfigWhitelist['nightly'][platform]:
                                continue
                            else:
                                log.warning("%s not in %s %s!" % (
                                    clean_line, platform,
                                    mozconfigWhitelist['nightly'][platform]))
                    else:
                        log.error("Skipping line %s!" % line)
                        continue
                    message = "found in %s but not in %s: %s"
                    if line[0] == '-':
                        log.error(message % (mozconfig_paths[0],
                                             mozconfig_paths[1], clean_line))
                    else:
                        log.error(message % (mozconfig_paths[1],
                                             mozconfig_paths[0], clean_line))
                    success = False
        else:
            log.info("Missing mozconfigs to compare for %s" % platform)
            return False
    return success
开发者ID:MihaiTabara,项目名称:build-tools,代码行数:71,代码来源:sanity.py



注:本文中的util.hg.make_hg_url函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python hg.mercurial函数代码示例发布时间:2022-05-26
下一篇:
Python hg.is_hg_cset函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap