Commits

Steve Borho committed 6601e64

simplify setup for hgtk, remove hg targets and use hgtk branch

  • Participants
  • Parent commits 51332bf
  • Branches hgtk

Comments (0)

Files changed (1)

      --pull         Pull from upstream, implied by stable and unstable targets
      --nopull       Disable pull for all targets
      --config       Show build configuration and exit
-  -f --force-hg     Force the build-hg directory to be recloned
-  -F --force-thg    Force the build-thg directory to be recloned
   -c --clean        Clean all build remnants
      --thg-release  Build a TortoiseHg release package
      --thg-stable   Build a TortoiseHg nightly stable package
      --thg-unstable Build a TortoiseHg nightly unstable package
-     --thg-doc      Only build TortoiseHg documentation in tortoisehg/
-     --hg-release   Build a Mercurial release package
-     --hg-stable    Build a Mercurial nightly stable package
-     --hg-unstable  Build a Mercurial nightly unstable package
-     --all          Build all four nightly targets
      --cert <file>  Sign output using the specified cert file (pfx)
      --only-msi     Only build new msi packages (implies nopull)
 """
 hgtag = 'tip'
 thgbranch = 'stable'
 thgtag = 'tip'
-forcehg = False
-forcethg = False
-buildhg = False
-builddoc = False
 buildthg = False
 dopull = None
 showconfig = False
 cert = None
-all = False
 onlymsi = False
 sslcertfile = 'misc/cacert.pem'
 
 
 try:
     opts, args = getopt.getopt(sys.argv[1:], 'hcfF',
-          ['clean', 'forcehg', 'forcethg',
-           'thg-release', 'thg-stable', 'thg-unstable', 'thg-doc',
-           'hg-release', 'hg-stable', 'hg-unstable',
-           'pull', 'nopull', 'config', 'all', 'cert=', 'only-msi'])
+          ['clean', 'thg-release', 'thg-stable', 'pull', 'nopull',
+           'config', 'cert=', 'only-msi'])
 except getopt.error, msg:
     usage(1, msg)
 
 for opt, arg in opts:
     if opt in ('-h', '--help'):
         usage(0)
-    elif opt in ('-f', '--force-hg'):
-        forcehg = True
-    elif opt in ('-F', '--force-thg'):
-        forcethg = True
     elif opt in ('-c', '--clean'):
         run(r'if exist build-hg rmdir /s /q build-hg')
         run(r'if exist build-thg rmdir /s /q build-thg')
         if os.path.exists(sslcertfile):
             os.unlink(sslcertfile)
         sys.exit(0)
-    elif opt == '--thg-doc':
-        checkrepo('tortoisehg')
-        builddoc = True
     elif opt == '--thg-release':
         for r in thg_source_repos:
             checkrepo(r)
         if dopull is None:
             dopull = True
         buildthg = True
-        thgbranch = 'stable'
-        thgtag = lasttag('tortoisehg', 'stable')
+        thgbranch = 'hgtk'
+        thgtag = lasttag('tortoisehg', 'hgtk')
         hgbranch = 'stable'
         hgtag = lasttag('hg-main', 'stable')
         packagename = 'tortoisehg'
         if dopull is None:
             dopull = True
         buildthg = True
-        thgbranch = 'stable'
+        thgbranch = 'hgtk'
         thgtag = 'tip'
         hgbranch = 'stable'
         hgtag = 'tip'
         if dopull is None:
             dopull = True
         buildthg = True
-        thgbranch = 'default'
+        thgbranch = 'hgtk'
         thgtag = 'tip'
         hgbranch = 'default'
         hgtag = 'tip'
         packagename = 'tortoisehg-unstable'
-    elif opt == '--hg-release':
-        checkrepo('hg-main')
-        buildhg = True
-        hgbranch = 'stable'
-        hgtag = lasttag('hg-main', 'stable')
-        packagename = 'mercurial'
-    elif opt == '--hg-stable':
-        checkrepo('hg-main')
-        if dopull is None:
-            dopull = True
-        buildhg = True
-        hgbranch = 'stable'
-        hgtag = 'tip'
-        packagename = 'mercurial-stable'
-    elif opt == '--hg-unstable':
-        checkrepo('hg-main')
-        if dopull is None:
-            dopull = True
-        buildhg = True
-        hgbranch = 'default'
-        hgtag = 'tip'
-        packagename = 'mercurial-unstable'
     elif opt == '--pull':
         dopull = True
     elif opt == '--nopull':
         showconfig = True
     elif opt == '--only-msi':
         onlymsi = True
-    elif opt == '--all':
-        for r in thg_source_repos:
-            checkrepo(r)
-        all = True
-        onlymsi = False
-        if dopull is None:
-            dopull = True
 
 print 'Build config:'
 print '[tortoisehg] branch=%s, tag=%s' % (thgbranch, thgtag)
 if showconfig:
     sys.exit(0)
 
-if not os.path.exists(sslcertfile):
+if not os.path.isdir('output'):
+    run(r'mkdir output')
+
+if dopull and not onlymsi:
     print 'fetching cacert.pem from', URL['cacert.pem']
     contents = urllib2.urlopen(URL['cacert.pem']).read()
     file(sslcertfile, 'wb').write(contents)
 
-if not os.path.isdir('output'):
-    run(r'mkdir output')
+    run(r'hg -R hg-main pull')
+    run(r'hg -R tortoisehg pull')
+    from mercurial import ui, hg
+    out = 'extension-versions.txt'
+    f = open(out, 'w')
+    f.write('Extensions/modules included in this TortoiseHg package:\n\n')
+    for ext in extensions:
+        run(r'hg -R %s pull -u' % ext)
+        if ext == 'dulwich':
+            # We need a specific version of dulwich, which is
+            # currently untagged (release 0.6.2)
+            run(r'hg -R dulwich update 8bd3be8bd8d79d1032d085b1e69832fdfb0a75a6')
+        repo = hg.repository(ui.ui(), path=ext)
+        f.write('%12s:\t%s\t%s\n' % (ext, str(repo['.']), URL[ext]))
+    try:
+        from svn import core
+        ver = '%d.%d.%d' % (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_MICRO)
+        url = 'http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100'
+        f.write('%12s:\t%-12s\t%s\n' % ('python-svn', ver, url))
+    except ImportError:
+        pass
+    try:
+        import pygments
+        ver = pygments.__version__
+        url = 'http://pygments.org/download/'
+        f.write('%12s:\t%-12s\t%s\n' % ('pygments', ver, url))
+    except ImportError:
+        pass
+    pywin32file = sys.prefix + r'\lib\site-packages\pywin32.version.txt'
+    if os.path.exists(pywin32file):
+        ver = open(pywin32file, 'r').read().strip()
+        url = 'http://sourceforge.net/projects/pywin32/'
+        f.write('%12s:\t%-12s\t%s\n' % ('pywin32', ver, url))
+    f.close()
 
-if dopull and not onlymsi:
-    run(r'hg -R hg-main pull')
-    if buildthg or all:
-        run(r'hg -R tortoisehg pull')
-        from mercurial import ui, hg
-        out = 'extension-versions.txt'
-        f = open(out, 'w')
-        f.write('Extensions/modules included in this TortoiseHg package:\n\n')
-        for ext in extensions:
-            run(r'hg -R %s pull -u' % ext)
-            if ext == 'dulwich':
-                # We need a specific version of dulwich, which is
-                # currently untagged (release 0.6.2)
-                run(r'hg -R dulwich update 8bd3be8bd8d79d1032d085b1e69832fdfb0a75a6')
-            repo = hg.repository(ui.ui(), path=ext)
-            f.write('%12s:\t%s\t%s\n' % (ext, str(repo['.']), URL[ext]))
-        try:
-            from svn import core
-            ver = '%d.%d.%d' % (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_MICRO)
-            url = 'http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100'
-            f.write('%12s:\t%-12s\t%s\n' % ('python-svn', ver, url))
-        except ImportError:
-            pass
-        try:
-            import pygments
-            ver = pygments.__version__
-            url = 'http://pygments.org/download/'
-            f.write('%12s:\t%-12s\t%s\n' % ('pygments', ver, url))
-        except ImportError:
-            pass
-        pywin32file = sys.prefix + r'\lib\site-packages\pywin32.version.txt'
-        if os.path.exists(pywin32file):
-            ver = open(pywin32file, 'r').read().strip()
-            url = 'http://sourceforge.net/projects/pywin32/'
-            f.write('%12s:\t%-12s\t%s\n' % ('pywin32', ver, url))
-        f.close()
-
-if all:
-    verify_hg_env()
-    verify_doc_env()
-    verify_thg_env()
-    get_sdk_envs()
-    run(r'title Building hg-stable...')
-    build_hg(True, 'stable', 'tip')
-    build_hg_installer('mercurial-stable')
-    run(r'title Building hg-unstable...')
-    build_hg(False, 'default', 'tip')
-    build_hg_installer('mercurial-unstable')
-    run(r'title Building thg-stable...')
-    productid = str(uuid.uuid4()).upper()
-    build_hg(False, 'stable', 'tip')
-    build_thg(True, 'stable', 'tip', 'tortoisehg-stable', productid)
-    build_thg_installer('tortoisehg-stable', productid)
-    # Unstable branch is PyQt based, requires pyqt branch of thg-winbuild
-    #run(r'title Building thg-unstable...')
-    #productid = str(uuid.uuid4()).upper()
-    #build_hg(False, 'default', 'tip')
-    #build_thg(True, 'default', 'tip', 'tortoisehg-unstable', productid)
-    #build_thg_installer('tortoisehg-unstable', productid)
-elif builddoc:
-    verify_doc_env()
-    build_thg_docs()
-elif buildhg:
-    verify_hg_env()
-    get_sdk_envs()
-    build_hg(forcehg, hgbranch, hgtag)
-    build_hg_installer(packagename)
-elif buildthg:
-    verify_hg_env()
-    verify_doc_env()
-    verify_thg_env()
-    get_sdk_envs()
-    build_hg(forcehg, hgbranch, hgtag)
-    productid = str(uuid.uuid4()).upper()
-    build_thg(forcethg, thgbranch, thgtag, packagename, productid)
-    build_thg_installer(packagename, productid)
+verify_hg_env()
+verify_doc_env()
+verify_thg_env()
+get_sdk_envs()
+build_hg(forcehg, hgbranch, hgtag)
+productid = str(uuid.uuid4()).upper()
+build_thg(forcethg, thgbranch, thgtag, packagename, productid)
+build_thg_installer(packagename, productid)