mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-12 17:03:59 +08:00
Better error management
This commit is contained in:
parent
1980e2e198
commit
6c5419716d
1 changed files with 14 additions and 1 deletions
|
@ -28,7 +28,20 @@ def check_and_apply_update(repo=local_repo, remote_name='origin'):
|
||||||
repo.head.set_target(remote_id)
|
repo.head.set_target(remote_id)
|
||||||
result = 'Bazarr updated to latest version and restarting.'
|
result = 'Bazarr updated to latest version and restarting.'
|
||||||
os.execlp('python', 'python', os.path.join(os.path.dirname(__file__), 'bazarr.py'))
|
os.execlp('python', 'python', os.path.join(os.path.dirname(__file__), 'bazarr.py'))
|
||||||
|
elif merge_result & pygit2.GIT_MERGE_ANALYSIS_NORMAL:
|
||||||
|
repo.merge(remote_id)
|
||||||
|
print repo.index.conflicts
|
||||||
|
|
||||||
|
assert repo.index.conflicts is None, 'Conflicts, ahhhh!'
|
||||||
|
user = repo.default_signature
|
||||||
|
tree = repo.index.write_tree()
|
||||||
|
commit = repo.create_commit('HEAD',
|
||||||
|
user,
|
||||||
|
user,
|
||||||
|
'Merge!',
|
||||||
|
tree,
|
||||||
|
[repo.head.target, remote_master_id])
|
||||||
|
repo.state_cleanup()
|
||||||
else:
|
else:
|
||||||
raise AssertionError('Unknown merge analysis result')
|
raise AssertionError('Unknown merge analysis result')
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in a new issue