MCPcopy Create free account
hub / github.com/carbonengine/trinity / _create_cl

Method _create_cl

shadercompiler/pythonBuildScript/build.py:288–302  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

286 self._p4('change', ['-d', self._cl])
287
288 def _create_cl(self):
289 desc = f"""
290Change: new
291
292Description:
293\t{self._cl_desc}
294"""
295 p = subprocess.Popen(['p4', 'change', '-i'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
296 stdout, stderr = p.communicate(desc.encode())
297 if p.returncode != 0:
298 raise subprocess.CalledProcessError(p.returncode, 'p4', stderr.decode())
299 match = re.match(r'.*Change (\d+) created.*', stdout.decode(), re.IGNORECASE | re.MULTILINE)
300 if not match:
301 raise subprocess.CalledProcessError(p.returncode, 'p4', stderr.decode())
302 return match.group(1)
303
304 def _p4(self, action, paths):
305 args = ['p4', '-b', str(len(paths) + 1), '-x', '-', action]

Callers 1

pre_buildMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected