зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1480187 - Fix mach try again when using multiple source checkouts. r=ahal
MozReview-Commit-ID: AV7ynmTSY1x --HG-- extra : rebase_source : e69d513773e691dc96b9bd44fa31f1ffc8f72e69
This commit is contained in:
Родитель
c1e79affbb
Коммит
7f3fb05aff
|
@ -4,6 +4,7 @@
|
|||
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
@ -44,7 +45,9 @@ MAX_HISTORY = 10
|
|||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
build = MozbuildObject.from_environment(cwd=here)
|
||||
vcs = get_repository_object(build.topsrcdir)
|
||||
history_path = os.path.join(get_state_dir()[0], 'history', 'try_task_configs.json')
|
||||
topsrcdir_hash = hashlib.sha256(os.path.abspath(build.topsrcdir)).hexdigest()
|
||||
history_path = os.path.join(get_state_dir()[0], 'history', topsrcdir_hash, 'try_task_configs.json')
|
||||
old_history_path = os.path.join(get_state_dir()[0], 'history', 'try_task_configs.json')
|
||||
|
||||
|
||||
def write_task_config(try_task_config):
|
||||
|
|
|
@ -6,9 +6,10 @@ from __future__ import absolute_import, print_function, unicode_literals
|
|||
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from ..cli import BaseTryParser
|
||||
from ..push import push_to_try, history_path
|
||||
from ..push import push_to_try, history_path, old_history_path
|
||||
|
||||
|
||||
class AgainParser(BaseTryParser):
|
||||
|
@ -37,6 +38,12 @@ class AgainParser(BaseTryParser):
|
|||
|
||||
|
||||
def run_try_again(index=0, purge=False, list_configs=False, message='{msg}', **pushargs):
|
||||
# Try to move existing history file from the old location to the new one.
|
||||
if os.path.isfile(old_history_path) and not os.path.isfile(history_path):
|
||||
if not os.path.isdir(os.path.dirname(history_path)):
|
||||
os.makedirs(os.path.dirname(history_path))
|
||||
shutil.move(old_history_path, history_path)
|
||||
|
||||
if purge:
|
||||
os.remove(history_path)
|
||||
return
|
||||
|
|
Загрузка…
Ссылка в новой задаче