MCPcopy Create free account
hub / github.com/DanielKeep/rust-conv / init_doc_branch

Function init_doc_branch

update-docs.py:102–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100 msg('Warning: failed to remove directory %r' % path)
101
102def 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
130def main():
131 if sh_eval('git symbolic-ref --short HEAD') != u'master':

Callers 1

mainFunction · 0.85

Calls 4

msgFunction · 0.85
msg_traceFunction · 0.85
shFunction · 0.85
really_rmtreeFunction · 0.85

Tested by

no test coverage detected