/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tools/win32/build_release.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 13:10:35 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521131035-xltmj0b4f6fbybo8
Rename some windows stuff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# When preparing a new release, make sure to set all of these to the latest
5
5
# values.
6
6
VERSIONS = {
7
 
    'bzr': '1.17',
 
7
    'brz': '1.17',
8
8
    'qbzr': '0.12',
9
9
    'bzrtools': '1.17.0',
10
10
    'bzr-svn': '0.6.3',
27
27
import sys
28
28
 
29
29
 
30
 
BZR_EXE = None
31
 
def bzr():
32
 
    global BZR_EXE
33
 
    if BZR_EXE is not None:
34
 
        return BZR_EXE
 
30
BRZ_EXE = None
 
31
def brz():
 
32
    global BRZ_EXE
 
33
    if BRZ_EXE is not None:
 
34
        return BRZ_EXE
35
35
    try:
36
 
        subprocess.call(['bzr', '--version'], stdout=subprocess.PIPE,
 
36
        subprocess.call(['brz', '--version'], stdout=subprocess.PIPE,
37
37
                        stderr=subprocess.PIPE)
38
 
        BZR_EXE = 'bzr'
 
38
        BRZ_EXE = 'brz'
39
39
    except OSError:
40
40
        try:
41
 
            subprocess.call(['bzr.bat', '--version'], stdout=subprocess.PIPE,
 
41
            subprocess.call(['brz.bat', '--version'], stdout=subprocess.PIPE,
42
42
                            stderr=subprocess.PIPE)
43
 
            BZR_EXE = 'bzr.bat'
 
43
            BRZ_EXE = 'brz.bat'
44
44
        except OSError:
45
 
            raise RuntimeError('Could not find bzr or bzr.bat on your path.')
46
 
    return BZR_EXE
 
45
            raise RuntimeError('Could not find brz or brz.bat on your path.')
 
46
    return BRZ_EXE
47
47
 
48
48
 
49
49
def call_or_fail(*args, **kwargs):
62
62
    global TARGET
63
63
    if TARGET is not None:
64
64
        return TARGET
65
 
    out = call_or_fail([sys.executable, get_bzr_dir() + '/bzr',
 
65
    out = call_or_fail([sys.executable, get_brz_dir() + '/brz',
66
66
                        'version', '--short'], stdout=subprocess.PIPE)
67
67
    version = out.strip()
68
68
    TARGET = os.path.abspath(TARGET_ROOT + '-' + version)
76
76
        print "Deleting: %s" % (target,)
77
77
        shutil.rmtree(target)
78
78
 
79
 
def get_bzr_dir():
80
 
    return 'bzr.' + VERSIONS['bzr']
81
 
 
82
 
 
83
 
def update_bzr():
84
 
    """Make sure we have the latest bzr in play."""
85
 
    bzr_dir = get_bzr_dir()
86
 
    if not os.path.isdir(bzr_dir):
87
 
        bzr_version = VERSIONS['bzr']
88
 
        bzr_url = 'lp:bzr/' + bzr_version
89
 
        print "Getting bzr release %s from %s" % (bzr_version, bzr_url)
90
 
        call_or_fail([bzr(), 'co', bzr_url, bzr_dir])
 
79
def get_brz_dir():
 
80
    return 'brz.' + VERSIONS['brz']
 
81
 
 
82
 
 
83
def update_brz():
 
84
    """Make sure we have the latest brz in play."""
 
85
    brz_dir = get_brz_dir()
 
86
    if not os.path.isdir(brz_dir):
 
87
        brz_version = VERSIONS['brz']
 
88
        brz_url = 'lp:brz/' + brz_version
 
89
        print "Getting brz release %s from %s" % (brz_version, brz_url)
 
90
        call_or_fail([brz(), 'co', brz_url, brz_dir])
91
91
    else:
92
 
        print "Ensuring %s is up-to-date" % (bzr_dir,)
93
 
        call_or_fail([bzr(), 'update', bzr_dir])
 
92
        print "Ensuring %s is up-to-date" % (brz_dir,)
 
93
        call_or_fail([brz(), 'update', brz_dir])
94
94
 
95
95
 
96
96
def create_target():
97
97
    target = get_target()
98
98
    print "Creating target dir: %s" % (target,)
99
 
    call_or_fail([bzr(), 'co', get_bzr_dir(), target])
 
99
    call_or_fail([brz(), 'co', get_brz_dir(), target])
100
100
 
101
101
 
102
102
def get_plugin_trunk_dir(plugin_name):
116
116
    if not os.path.isdir(trunk_dir):
117
117
        plugin_trunk = get_plugin_trunk_branch(plugin_name)
118
118
        print "Getting latest %s trunk" % (plugin_name,)
119
 
        call_or_fail([bzr(), 'co', plugin_trunk,
 
119
        call_or_fail([brz(), 'co', plugin_trunk,
120
120
                      trunk_dir])
121
121
    else:
122
122
        print "Ensuring %s is up-to-date" % (trunk_dir,)
123
 
        call_or_fail([bzr(), 'update', trunk_dir])
 
123
        call_or_fail([brz(), 'update', trunk_dir])
124
124
    return trunk_dir
125
125
 
126
126
 
136
136
    if not os.path.isdir(plugin_name):
137
137
        if plugin_name in ('bzr-svn', 'bzr-rewrite'):
138
138
            # bzr-svn uses a different repo format
139
 
            call_or_fail([bzr(), 'init-repo', '--rich-root-pack', plugin_name])
 
139
            call_or_fail([brz(), 'init-repo', '--rich-root-pack', plugin_name])
140
140
        else:
141
141
            os.mkdir(plugin_name)
142
142
    if os.path.isdir(release_dir):
147
147
    # Now create the tagged directory
148
148
    tag_name = _plugin_tag_name(plugin_name)
149
149
    print "Creating the branch %s" % (release_dir,)
150
 
    call_or_fail([bzr(), 'co', '-rtag:%s' % (tag_name,),
 
150
    call_or_fail([brz(), 'co', '-rtag:%s' % (tag_name,),
151
151
                  trunk_dir, release_dir])
152
152
    return release_dir
153
153