mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-19 12:34:17 +00:00
Change project.revision to revisionExpr and revisionId
The revisionExpr field now holds an expression from the manifest, such as "refs/heads/master", while revisionId holds the current commit-ish SHA-1 of the revisionExpr. Currently that is only filled in if the manifest points directly to a SHA-1. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@ -160,10 +160,8 @@ terminal and are not redirected.
|
||||
setenv('REPO_PROJECT', project.name)
|
||||
setenv('REPO_PATH', project.relpath)
|
||||
setenv('REPO_REMOTE', project.remote.name)
|
||||
setenv('REPO_LREV', project\
|
||||
.GetRemote(project.remote.name)\
|
||||
.ToLocal(project.revision))
|
||||
setenv('REPO_RREV', project.revision)
|
||||
setenv('REPO_LREV', project.GetRevisionId())
|
||||
setenv('REPO_RREV', project.revisionExpr)
|
||||
|
||||
if mirror:
|
||||
setenv('GIT_DIR', project.gitdir)
|
||||
|
@ -113,12 +113,12 @@ to update the working directory files.
|
||||
m._InitGitDir()
|
||||
|
||||
if opt.manifest_branch:
|
||||
m.revision = opt.manifest_branch
|
||||
m.revisionExpr = opt.manifest_branch
|
||||
else:
|
||||
m.revision = 'refs/heads/master'
|
||||
m.revisionExpr = 'refs/heads/master'
|
||||
else:
|
||||
if opt.manifest_branch:
|
||||
m.revision = opt.manifest_branch
|
||||
m.revisionExpr = opt.manifest_branch
|
||||
else:
|
||||
m.PreSync()
|
||||
|
||||
|
@ -207,17 +207,14 @@ def _VerifyTag(project):
|
||||
warning: Cannot automatically authenticate repo."""
|
||||
return True
|
||||
|
||||
remote = project.GetRemote(project.remote.name)
|
||||
ref = remote.ToLocal(project.revision)
|
||||
|
||||
try:
|
||||
cur = project.bare_git.describe(ref)
|
||||
cur = project.bare_git.describe(project.GetRevisionId())
|
||||
except GitError:
|
||||
cur = None
|
||||
|
||||
if not cur \
|
||||
or re.compile(r'^.*-[0-9]{1,}-g[0-9a-f]{1,}$').match(cur):
|
||||
rev = project.revision
|
||||
rev = project.revisionExpr
|
||||
if rev.startswith(R_HEADS):
|
||||
rev = rev[len(R_HEADS):]
|
||||
|
||||
|
Reference in New Issue
Block a user