summaryrefslogtreecommitdiffstats
path: root/subcmds
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-05-29 18:38:17 -0700
committerShawn O. Pearce <sop@google.com>2009-05-29 18:45:20 -0700
commit3c8dea1f8d7c4257d080f9f34159cdb2fffb81e6 (patch)
tree2a5e48ce93bc913076034f88f8878e4bfffef4dc /subcmds
parent8ad8a0e61d919e76f521f3124c91bd46fbaa84e2 (diff)
downloadgit-repo-3c8dea1f8d7c4257d080f9f34159cdb2fffb81e6.tar.gz
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>
Diffstat (limited to 'subcmds')
-rw-r--r--subcmds/forall.py6
-rw-r--r--subcmds/init.py6
-rw-r--r--subcmds/sync.py7
3 files changed, 7 insertions, 12 deletions
diff --git a/subcmds/forall.py b/subcmds/forall.py
index 8d701a6c..b66313d7 100644
--- a/subcmds/forall.py
+++ b/subcmds/forall.py
@@ -160,10 +160,8 @@ terminal and are not redirected.
160 setenv('REPO_PROJECT', project.name) 160 setenv('REPO_PROJECT', project.name)
161 setenv('REPO_PATH', project.relpath) 161 setenv('REPO_PATH', project.relpath)
162 setenv('REPO_REMOTE', project.remote.name) 162 setenv('REPO_REMOTE', project.remote.name)
163 setenv('REPO_LREV', project\ 163 setenv('REPO_LREV', project.GetRevisionId())
164 .GetRemote(project.remote.name)\ 164 setenv('REPO_RREV', project.revisionExpr)
165 .ToLocal(project.revision))
166 setenv('REPO_RREV', project.revision)
167 165
168 if mirror: 166 if mirror:
169 setenv('GIT_DIR', project.gitdir) 167 setenv('GIT_DIR', project.gitdir)
diff --git a/subcmds/init.py b/subcmds/init.py
index 0d0fcd06..5ba4d794 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -113,12 +113,12 @@ to update the working directory files.
113 m._InitGitDir() 113 m._InitGitDir()
114 114
115 if opt.manifest_branch: 115 if opt.manifest_branch:
116 m.revision = opt.manifest_branch 116 m.revisionExpr = opt.manifest_branch
117 else: 117 else:
118 m.revision = 'refs/heads/master' 118 m.revisionExpr = 'refs/heads/master'
119 else: 119 else:
120 if opt.manifest_branch: 120 if opt.manifest_branch:
121 m.revision = opt.manifest_branch 121 m.revisionExpr = opt.manifest_branch
122 else: 122 else:
123 m.PreSync() 123 m.PreSync()
124 124
diff --git a/subcmds/sync.py b/subcmds/sync.py
index c61c3bb4..9c9a3b78 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -207,17 +207,14 @@ def _VerifyTag(project):
207warning: Cannot automatically authenticate repo.""" 207warning: Cannot automatically authenticate repo."""
208 return True 208 return True
209 209
210 remote = project.GetRemote(project.remote.name)
211 ref = remote.ToLocal(project.revision)
212
213 try: 210 try:
214 cur = project.bare_git.describe(ref) 211 cur = project.bare_git.describe(project.GetRevisionId())
215 except GitError: 212 except GitError:
216 cur = None 213 cur = None
217 214
218 if not cur \ 215 if not cur \
219 or re.compile(r'^.*-[0-9]{1,}-g[0-9a-f]{1,}$').match(cur): 216 or re.compile(r'^.*-[0-9]{1,}-g[0-9a-f]{1,}$').match(cur):
220 rev = project.revision 217 rev = project.revisionExpr
221 if rev.startswith(R_HEADS): 218 if rev.startswith(R_HEADS):
222 rev = rev[len(R_HEADS):] 219 rev = rev[len(R_HEADS):]
223 220