()
| 100 | msg('Warning: failed to remove directory %r' % path) |
| 101 | |
| 102 | def init_doc_branch(): |
| 103 | msg("Initialising %s branch" % DOC_TARGET_BRANCH) |
| 104 | |
| 105 | dir = os.getcwdu() |
| 106 | msg_trace('dir = %r' % dir) |
| 107 | |
| 108 | tmp = tempfile.mkdtemp(prefix=TEMP_CHECKOUT_PREFIX) |
| 109 | msg_trace('tmp = %r' % tmp) |
| 110 | |
| 111 | try: |
| 112 | msg("Cloning into a temporary directory...") |
| 113 | sh('git init -q "%s"' % tmp) |
| 114 | msg_trace('os.chdir(%r)' % tmp) |
| 115 | os.chdir(tmp) |
| 116 | sh('git checkout -q --orphan "%s"' % DOC_TARGET_BRANCH) |
| 117 | sh('git commit -qm "Initial commit." --allow-empty') |
| 118 | sh('git remote add origin "%s"' % dir) |
| 119 | sh('git push -q origin gh-pages') |
| 120 | |
| 121 | finally: |
| 122 | msg('Cleaning up...') |
| 123 | msg_trace('os.chdir(%r)' % dir) |
| 124 | os.chdir(dir) |
| 125 | msg_trace('shutil.rmtree(%r)' % tmp) |
| 126 | really_rmtree(tmp) |
| 127 | |
| 128 | msg('%s is ready. Continuing.' % DOC_TARGET_BRANCH) |
| 129 | |
| 130 | def main(): |
| 131 | if sh_eval('git symbolic-ref --short HEAD') != u'master': |
no test coverage detected