mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 23:41:33 +00:00
Make coding style more consistent
This commit is contained in:
parent
85523ede32
commit
dd056a37bb
@ -41,18 +41,28 @@ class SnapshotProvider:
|
|||||||
def take_snapshot(self):
|
def take_snapshot(self):
|
||||||
if self._head_detached:
|
if self._head_detached:
|
||||||
self._checkout_new_branch_from_head()
|
self._checkout_new_branch_from_head()
|
||||||
self._run(('git', 'add', '-A'))
|
self._run((
|
||||||
self._run(('git', 'commit', '-m', 'Snapshot'))
|
'git', 'add',
|
||||||
|
'-A'
|
||||||
|
))
|
||||||
|
self._run((
|
||||||
|
'git', 'commit',
|
||||||
|
'-m', 'Snapshot'
|
||||||
|
))
|
||||||
|
|
||||||
def _checkout_new_branch_from_head(self):
|
def _checkout_new_branch_from_head(self):
|
||||||
head_hash = self._get_head_hash()
|
head_hash = self._get_head_hash()
|
||||||
self._run((
|
self._run((
|
||||||
'git', 'checkout',
|
'git', 'checkout',
|
||||||
'-b', head_hash, head_hash
|
'-b', head_hash,
|
||||||
|
head_hash
|
||||||
))
|
))
|
||||||
|
|
||||||
def _get_head_hash(self):
|
def _get_head_hash(self):
|
||||||
return self._get_stdout(('git', 'rev-parse', 'HEAD'))
|
return self._get_stdout((
|
||||||
|
'git', 'rev-parse',
|
||||||
|
'HEAD'
|
||||||
|
))
|
||||||
|
|
||||||
def restore_snapshot(self, date):
|
def restore_snapshot(self, date):
|
||||||
commit = self._get_commit_from_timestamp(date)
|
commit = self._get_commit_from_timestamp(date)
|
||||||
|
Loading…
Reference in New Issue
Block a user