mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-01-02 16:14:25 +00:00
Fixing project renaming bug.
This bug happens when a project gets added to the manifest, and then is renamed. Users who happened to have run "repo sync" after the project was added but before the rename happened will try to read the data from the old project, as the manifest was only updated after all projects were updated successfully.
This commit is contained in:
parent
c24c720b61
commit
9bb1816bdc
@ -111,7 +111,6 @@ later is required to fix a server side protocol bug.
|
|||||||
pm = Progress('Fetching projects', len(projects))
|
pm = Progress('Fetching projects', len(projects))
|
||||||
for project in projects:
|
for project in projects:
|
||||||
pm.update()
|
pm.update()
|
||||||
|
|
||||||
if project.Sync_NetworkHalf():
|
if project.Sync_NetworkHalf():
|
||||||
fetched.add(project.gitdir)
|
fetched.add(project.gitdir)
|
||||||
else:
|
else:
|
||||||
@ -192,6 +191,15 @@ uncommitted changes are present' % project.relpath
|
|||||||
if opt.repo_upgraded:
|
if opt.repo_upgraded:
|
||||||
_PostRepoUpgrade(self.manifest)
|
_PostRepoUpgrade(self.manifest)
|
||||||
|
|
||||||
|
if not opt.local_only:
|
||||||
|
mp.Sync_NetworkHalf()
|
||||||
|
|
||||||
|
if mp.HasChanges:
|
||||||
|
syncbuf = SyncBuffer(mp.config)
|
||||||
|
mp.Sync_LocalHalf(syncbuf)
|
||||||
|
if not syncbuf.Finish():
|
||||||
|
sys.exit(1)
|
||||||
|
self.manifest._Unload()
|
||||||
all = self.GetProjects(args, missing_ok=True)
|
all = self.GetProjects(args, missing_ok=True)
|
||||||
|
|
||||||
if not opt.local_only:
|
if not opt.local_only:
|
||||||
@ -199,7 +207,6 @@ uncommitted changes are present' % project.relpath
|
|||||||
now = time.time()
|
now = time.time()
|
||||||
if (24 * 60 * 60) <= (now - rp.LastFetch):
|
if (24 * 60 * 60) <= (now - rp.LastFetch):
|
||||||
to_fetch.append(rp)
|
to_fetch.append(rp)
|
||||||
to_fetch.append(mp)
|
|
||||||
to_fetch.extend(all)
|
to_fetch.extend(all)
|
||||||
|
|
||||||
fetched = self._Fetch(to_fetch)
|
fetched = self._Fetch(to_fetch)
|
||||||
@ -208,12 +215,6 @@ uncommitted changes are present' % project.relpath
|
|||||||
# bail out now; the rest touches the working tree
|
# bail out now; the rest touches the working tree
|
||||||
return
|
return
|
||||||
|
|
||||||
if mp.HasChanges:
|
|
||||||
syncbuf = SyncBuffer(mp.config)
|
|
||||||
mp.Sync_LocalHalf(syncbuf)
|
|
||||||
if not syncbuf.Finish():
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
self.manifest._Unload()
|
self.manifest._Unload()
|
||||||
all = self.GetProjects(args, missing_ok=True)
|
all = self.GetProjects(args, missing_ok=True)
|
||||||
missing = []
|
missing = []
|
||||||
@ -241,7 +242,6 @@ uncommitted changes are present' % project.relpath
|
|||||||
if not syncbuf.Finish():
|
if not syncbuf.Finish():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def _PostRepoUpgrade(manifest):
|
def _PostRepoUpgrade(manifest):
|
||||||
for project in manifest.projects.values():
|
for project in manifest.projects.values():
|
||||||
if project.Exists:
|
if project.Exists:
|
||||||
|
Loading…
Reference in New Issue
Block a user