mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-07-09 08:29:02 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
2a3a81b51f | |||
7b4f43542a | |||
9fb29ce123 | |||
3a68bb4c7f | |||
cd1d7ff81e | |||
da88ff4411 |
@ -236,6 +236,9 @@ class GitConfig(object):
|
||||
return cPickle.load(fd)
|
||||
finally:
|
||||
fd.close()
|
||||
except EOFError:
|
||||
os.remove(self._pickle)
|
||||
return None
|
||||
except IOError:
|
||||
os.remove(self._pickle)
|
||||
return None
|
||||
@ -414,6 +417,7 @@ def _preconnect(url):
|
||||
host = m.group(1)
|
||||
return _open_ssh(host, 22)
|
||||
|
||||
return False
|
||||
|
||||
class Remote(object):
|
||||
"""Configuration options related to a remote.
|
||||
|
@ -733,9 +733,7 @@ class Project(object):
|
||||
last_mine = commit_id
|
||||
cnt_mine += 1
|
||||
|
||||
if not local_changes and not upstream_gain:
|
||||
# Trivially no changes caused by the upstream.
|
||||
#
|
||||
if not upstream_gain and cnt_mine == len(local_changes):
|
||||
return
|
||||
|
||||
if self.IsDirty(consider_untracked=False):
|
||||
|
@ -123,7 +123,8 @@ later is required to fix a server side protocol bug.
|
||||
def UpdateProjectList(self):
|
||||
new_project_paths = []
|
||||
for project in self.manifest.projects.values():
|
||||
new_project_paths.append(project.relpath)
|
||||
if project.relpath:
|
||||
new_project_paths.append(project.relpath)
|
||||
file_name = 'project.list'
|
||||
file_path = os.path.join(self.manifest.repodir, file_name)
|
||||
old_project_paths = []
|
||||
@ -135,6 +136,8 @@ later is required to fix a server side protocol bug.
|
||||
finally:
|
||||
fd.close()
|
||||
for path in old_project_paths:
|
||||
if not path:
|
||||
continue
|
||||
if path not in new_project_paths:
|
||||
project = Project(
|
||||
manifest = self.manifest,
|
||||
@ -163,9 +166,11 @@ uncommitted changes are present' % project.relpath
|
||||
break
|
||||
dir = os.path.dirname(dir)
|
||||
|
||||
new_project_paths.sort()
|
||||
fd = open(file_path, 'w')
|
||||
try:
|
||||
fd.write('\n'.join(new_project_paths))
|
||||
fd.write('\n')
|
||||
finally:
|
||||
fd.close()
|
||||
return 0
|
||||
@ -217,6 +222,10 @@ uncommitted changes are present' % project.relpath
|
||||
missing.append(project)
|
||||
self._Fetch(missing)
|
||||
|
||||
if self.manifest.IsMirror:
|
||||
# bail out now, we have no working tree
|
||||
return
|
||||
|
||||
if self.UpdateProjectList():
|
||||
sys.exit(1)
|
||||
|
||||
|
Reference in New Issue
Block a user