mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-30 20:17:08 +00:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
aada468916 | |||
1d5098617e | |||
e219c78fe5 |
41
project.py
41
project.py
@ -3375,24 +3375,29 @@ class Project:
|
|||||||
setting = fp.read()
|
setting = fp.read()
|
||||||
assert setting.startswith("gitdir:")
|
assert setting.startswith("gitdir:")
|
||||||
git_worktree_path = setting.split(":", 1)[1].strip()
|
git_worktree_path = setting.split(":", 1)[1].strip()
|
||||||
# Some platforms (e.g. Windows) won't let us update dotgit in situ
|
|
||||||
# because of file permissions. Delete it and recreate it from scratch
|
# `gitdir` maybe be either relative or absolute depending on the
|
||||||
# to avoid.
|
# behavior of the local copy of git, so only convert the path to
|
||||||
platform_utils.remove(dotgit)
|
# relative if it needs to be converted.
|
||||||
# Use relative path from checkout->worktree & maintain Unix line endings
|
if os.path.isabs(git_worktree_path):
|
||||||
# on all OS's to match git behavior.
|
# Some platforms (e.g. Windows) won't let us update dotgit in situ
|
||||||
with open(dotgit, "w", newline="\n") as fp:
|
# because of file permissions. Delete it and recreate it from
|
||||||
print(
|
# scratch to avoid.
|
||||||
"gitdir:",
|
platform_utils.remove(dotgit)
|
||||||
os.path.relpath(git_worktree_path, self.worktree),
|
# Use relative path from checkout->worktree & maintain Unix line
|
||||||
file=fp,
|
# endings on all OS's to match git behavior.
|
||||||
)
|
with open(dotgit, "w", newline="\n") as fp:
|
||||||
# Use relative path from worktree->checkout & maintain Unix line endings
|
print(
|
||||||
# on all OS's to match git behavior.
|
"gitdir:",
|
||||||
with open(
|
os.path.relpath(git_worktree_path, self.worktree),
|
||||||
os.path.join(git_worktree_path, "gitdir"), "w", newline="\n"
|
file=fp,
|
||||||
) as fp:
|
)
|
||||||
print(os.path.relpath(dotgit, git_worktree_path), file=fp)
|
# Use relative path from worktree->checkout & maintain Unix line
|
||||||
|
# endings on all OS's to match git behavior.
|
||||||
|
with open(
|
||||||
|
os.path.join(git_worktree_path, "gitdir"), "w", newline="\n"
|
||||||
|
) as fp:
|
||||||
|
print(os.path.relpath(dotgit, git_worktree_path), file=fp)
|
||||||
|
|
||||||
self._InitMRef()
|
self._InitMRef()
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ without iterating through the remaining projects.
|
|||||||
rc = rc or r
|
rc = rc or r
|
||||||
if r != 0 and opt.abort_on_errors:
|
if r != 0 and opt.abort_on_errors:
|
||||||
raise Exception("Aborting due to previous error")
|
raise Exception("Aborting due to previous error")
|
||||||
return rc
|
return rc
|
||||||
|
|
||||||
try:
|
try:
|
||||||
config = self.manifest.manifestProject.config
|
config = self.manifest.manifestProject.config
|
||||||
@ -298,7 +298,7 @@ without iterating through the remaining projects.
|
|||||||
)
|
)
|
||||||
except (KeyboardInterrupt, WorkerKeyboardInterrupt):
|
except (KeyboardInterrupt, WorkerKeyboardInterrupt):
|
||||||
# Catch KeyboardInterrupt raised inside and outside of workers
|
# Catch KeyboardInterrupt raised inside and outside of workers
|
||||||
rc = rc or errno.EINTR
|
rc = errno.EINTR
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# Catch any other exceptions raised
|
# Catch any other exceptions raised
|
||||||
logger.error(
|
logger.error(
|
||||||
@ -306,7 +306,7 @@ without iterating through the remaining projects.
|
|||||||
type(e).__name__,
|
type(e).__name__,
|
||||||
e,
|
e,
|
||||||
)
|
)
|
||||||
rc = rc or getattr(e, "errno", 1)
|
rc = getattr(e, "errno", 1)
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
sys.exit(rc)
|
sys.exit(rc)
|
||||||
|
|
||||||
|
@ -737,8 +737,8 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
|||||||
pending = []
|
pending = []
|
||||||
for result in results:
|
for result in results:
|
||||||
project_idx, avail = result
|
project_idx, avail = result
|
||||||
|
project = projects[project_idx]
|
||||||
if avail is None:
|
if avail is None:
|
||||||
project = projects[project_idx]
|
|
||||||
logger.error(
|
logger.error(
|
||||||
'repo: error: %s: Unable to upload branch "%s". '
|
'repo: error: %s: Unable to upload branch "%s". '
|
||||||
"You might be able to fix the branch by running:\n"
|
"You might be able to fix the branch by running:\n"
|
||||||
@ -748,7 +748,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
|||||||
project.manifest.branch,
|
project.manifest.branch,
|
||||||
)
|
)
|
||||||
elif avail:
|
elif avail:
|
||||||
pending.append(result)
|
pending.append((project, avail))
|
||||||
return pending
|
return pending
|
||||||
|
|
||||||
with self.ParallelContext():
|
with self.ParallelContext():
|
||||||
|
Reference in New Issue
Block a user