1,未知原因,在repo sync时报错如下:
uluxy181@ubuntu16-010:~/workspace3/mtk$ repo sync
remote: Total 0 (delta 0), reused 0 (delta 0)
Traceback (most recent call last):
File "/home/YFCO/uluxy181/workspace/repo_tools/repo.git/main.py", line 547, in <module>
_Main(sys.argv[1:])
File "/home/YFCO/uluxy181/workspace/repo_tools/repo.git/main.py", line 522, in _Main
result = repo._Run(argv) or 0
File "/home/YFCO/uluxy181/workspace/repo_tools/repo.git/main.py", line 184, in _Run
result = cmd.Execute(copts, cargs)
File "/home/YFCO/uluxy181/workspace/repo_tools/repo.git/subcmds/sync.py", line 740, in Execute
if mp.HasChanges:
File "/home/YFCO/uluxy181/workspace/repo_tools/repo.git/project.py", line 3059, in HasChanges
elif self._revlist(not_rev(HEAD), revid):
File "/home/YFCO/uluxy181/workspace/repo_tools/repo.git/project.py", line 2603, in _revlist
return self.work_git.rev_list(*a, **kw)
File "/home/YFCO/uluxy181/workspace/repo_tools/repo.git/project.py", line 2802, in rev_list
(self._project.name, str(args), p.stderr))
error.GitError: manifests rev-list ('^HEAD', u'96c154b5d80ba261cc7eb0eb561d078ba650bca4', '--'): error: Could not read 4846c7d5777e3043c6556ea98964241fff347cad
fatal: revision walk setup failed
2,解决办法
原因:版本号不一致导致的:
error.GitError: manifests rev-list (‘^HEAD’, u’96c154b5d80ba261cc7eb0eb561d078ba650bca4’, ‘–’): error: Could not read 4846c7d5777e3043c6556ea98964241fff347cad
cd到项目根目录的.repo/manifest目录
uluxy181@ubuntu16-010:~/ cd workspace/mtk/.repo/manifest目录
恢复代码到指定commitID
uluxy181@ubuntu16-010:~/workspace3/mtk/.repo/manifest$ git reset --hard 96c154b5d80ba261cc7eb0eb561d078ba650bca4
拉取代码
uluxy181@ubuntu16-010:~/workspace3/mtk/.repo/manifest$ git pull
repo sync再次尝试是否可以正常使用repo
uluxy181@ubuntu16-010:~/workspace3/mtk/.repo/manifest$ repo sync -c