Bug 853775: Update client.py to pull NSPR and NSS from Mercurial instead of CVS, r=kaie
authorBrian Smith <bsmith@mozilla.com>
Mon, 01 Apr 2013 17:26:39 -0700
changeset 126903 b20eab2be2dcc2b606f50017e9703df3f9c8be08
parent 126902 2050e321ca34602f3439cdc546547071e418d291
child 126904 633e6b75af95c09700ca6d4a9f7a8e1b2d780675
push id1470
push userttaubert@mozilla.com
push dateWed, 03 Apr 2013 10:30:02 +0000
treeherderfx-team@686d76b44d9f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaie
bugs853775
milestone23.0a1
Bug 853775: Update client.py to pull NSPR and NSS from Mercurial instead of CVS, r=kaie
client.py
security/nss/TAG-INFO-CKBI
--- a/client.py
+++ b/client.py
@@ -1,26 +1,20 @@
 #!/usr/bin/python
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 
-NSPR_DIRS = (('nsprpub', 'mozilla/nsprpub'),)
-NSS_DIRS  = (('dbm', 'mozilla/dbm'),
-             ('security/nss', 'mozilla/security/nss'),
-             ('security/coreconf', 'mozilla/security/coreconf'),
-             ('security/dbm', 'mozilla/security/dbm'))
-NSSCKBI_DIRS = (('security/nss/lib/ckfw/builtins', 'mozilla/security/nss/lib/ckfw/builtins'),)
 LIBFFI_DIRS = (('js/ctypes/libffi', 'libffi'),)
 WEBIDLPARSER_DIR = 'dom/bindings/parser'
 WEBIDLPARSER_REPO = 'https://hg.mozilla.org/users/khuey_mozilla.com/webidl-parser'
-WEBIDLPARSER_EXCLUSIONS = ['.hgignore', '.gitignore', '.hg', 'ply']
+HG_EXCLUSIONS = ['.hg', '.hgignore', '.hgtags']
+WEBIDLPARSER_EXCLUSIONS = HG_EXCLUSIONS + ['.gitignore', 'ply']
 
-CVSROOT_MOZILLA = ':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot'
 CVSROOT_LIBFFI = ':pserver:anoncvs@sources.redhat.com:/cvs/libffi'
 
 import os
 import sys
 import datetime
 import shutil
 import glob
 from optparse import OptionParser
@@ -64,17 +58,17 @@ def do_hg_replace(dir, repository, tag, 
             if os.path.isdir(excluded):
                 shutil.rmtree(excluded)
             else:
                 os.remove(excluded)
 
 def do_cvs_export(modules, tag, cvsroot, cvs):
     """Check out a CVS directory without CVS metadata, using "export"
     modules is a list of directories to check out and the corresponding
-    cvs module, e.g. (('nsprpub', 'mozilla/nsprpub'))
+    cvs module, e.g. (('js/ctypes/libffi', 'libffi'),)
     """
     for module_tuple in modules:
         module = module_tuple[0]
         cvs_module = module_tuple[1]
         fullpath = os.path.join(topsrcdir, module)
         if os.path.exists(fullpath):
             print "Removing '%s'" % fullpath
             shutil.rmtree(fullpath)
@@ -104,51 +98,42 @@ def toggle_trailing_blank_line(depname):
 o = OptionParser(usage="client.py [options] update_nspr tagname | update_nss tagname | update_libffi tagname | update_webidlparser tagname")
 o.add_option("--skip-mozilla", dest="skip_mozilla",
              action="store_true", default=False,
              help="Obsolete")
 
 o.add_option("--cvs", dest="cvs", default=os.environ.get('CVS', 'cvs'),
              help="The location of the cvs binary")
 o.add_option("--cvsroot", dest="cvsroot",
-             help="The CVSROOT (default for mozilla checkouts: %s)" % CVSROOT_MOZILLA)
+             help="The CVSROOT for libffi (default : %s)" % CVSROOT_LIBFFI)
 o.add_option("--hg", dest="hg", default=os.environ.get('HG', 'hg'),
              help="The location of the hg binary")
 
 try:
     options, args = o.parse_args()
     action = args[0]
 except IndexError:
     o.print_help()
     sys.exit(2)
 
 if action in ('checkout', 'co'):
     print >>sys.stderr, "Warning: client.py checkout is obsolete."
     pass
 elif action in ('update_nspr'):
     tag, = args[1:]
-    if not options.cvsroot:
-        options.cvsroot = os.environ.get('CVSROOT', CVSROOT_MOZILLA)
-    do_cvs_export(NSPR_DIRS, tag, options.cvsroot, options.cvs)
+    do_hg_replace('nsprpub', 'https://hg.mozilla.org/projects/nspr',
+	              tag, HG_EXCLUSIONS, options.hg)
     print >>file("nsprpub/TAG-INFO", "w"), tag
     toggle_trailing_blank_line("nsprpub/config/prdepend.h")
 elif action in ('update_nss'):
     tag, = args[1:]
-    if not options.cvsroot:
-        options.cvsroot = os.environ.get('CVSROOT', CVSROOT_MOZILLA)
-    do_cvs_export(NSS_DIRS, tag, options.cvsroot, options.cvs)
+    do_hg_replace('security/nss', 'https://hg.mozilla.org/projects/nss',
+	              tag, HG_EXCLUSIONS, options.hg)
     print >>file("security/nss/TAG-INFO", "w"), tag
-    print >>file("security/nss/TAG-INFO-CKBI", "w"), tag
-    toggle_trailing_blank_line("security/coreconf/coreconf.dep")
-elif action in ('update_nssckbi'):
-    tag, = args[1:]
-    if not options.cvsroot:
-        options.cvsroot = os.environ.get('CVSROOT', CVSROOT_MOZILLA)
-    do_cvs_export(NSSCKBI_DIRS, tag, options.cvsroot, options.cvs)
-    print >>file("security/nss/TAG-INFO-CKBI", "w"), tag
+    toggle_trailing_blank_line("security/nss/coreconf/coreconf.dep")
 elif action in ('update_libffi'):
     tag, = args[1:]
     if not options.cvsroot:
         options.cvsroot = CVSROOT_LIBFFI
     do_cvs_export(LIBFFI_DIRS, tag, options.cvsroot, options.cvs)
 elif action in ('update_webidlparser'):
     tag, = args[1:]
     do_hg_replace(WEBIDLPARSER_DIR, WEBIDLPARSER_REPO, tag, WEBIDLPARSER_EXCLUSIONS, options.hg)
deleted file mode 100644
--- a/security/nss/TAG-INFO-CKBI
+++ /dev/null
@@ -1,1 +0,0 @@
-NSS_3_14_3_RTM