summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--manifest_xml.py8
-rw-r--r--project.py17
2 files changed, 12 insertions, 13 deletions
diff --git a/manifest_xml.py b/manifest_xml.py
index 39656975..68ead53c 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -887,13 +887,11 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
887 if groups: 887 if groups:
888 p.groups.extend(groups) 888 p.groups.extend(groups)
889 if revision: 889 if revision:
890 p.revisionExpr = revision 890 p.SetRevision(revision)
891 if IsId(revision): 891
892 p.revisionId = revision
893 else:
894 p.revisionId = None
895 if remote: 892 if remote:
896 p.remote = remote.ToRemoteSpec(name) 893 p.remote = remote.ToRemoteSpec(name)
894
897 if dest_path: 895 if dest_path:
898 del self._paths[p.relpath] 896 del self._paths[p.relpath]
899 relpath, worktree, gitdir, objdir, _ = self.GetProjectPaths(name, dest_path) 897 relpath, worktree, gitdir, objdir, _ = self.GetProjectPaths(name, dest_path)
diff --git a/project.py b/project.py
index 9ff9df0b..5b26b64c 100644
--- a/project.py
+++ b/project.py
@@ -520,14 +520,7 @@ class Project(object):
520 self.name = name 520 self.name = name
521 self.remote = remote 521 self.remote = remote
522 self.UpdatePaths(relpath, worktree, gitdir, objdir) 522 self.UpdatePaths(relpath, worktree, gitdir, objdir)
523 self.revisionExpr = revisionExpr 523 self.SetRevision(revisionExpr, revisionId=revisionId)
524
525 if revisionId is None \
526 and revisionExpr \
527 and IsId(revisionExpr):
528 self.revisionId = revisionExpr
529 else:
530 self.revisionId = revisionId
531 524
532 self.rebase = rebase 525 self.rebase = rebase
533 self.groups = groups 526 self.groups = groups
@@ -557,6 +550,14 @@ class Project(object):
557 # project containing repo hooks. 550 # project containing repo hooks.
558 self.enabled_repo_hooks = [] 551 self.enabled_repo_hooks = []
559 552
553 def SetRevision(self, revisionExpr, revisionId=None):
554 """Set revisionId based on revision expression and id"""
555 self.revisionExpr = revisionExpr
556 if revisionId is None and revisionExpr and IsId(revisionExpr):
557 self.revisionId = self.revisionExpr
558 else:
559 self.revisionId = revisionId
560
560 def UpdatePaths(self, relpath, worktree, gitdir, objdir): 561 def UpdatePaths(self, relpath, worktree, gitdir, objdir):
561 """Update paths used by this project""" 562 """Update paths used by this project"""
562 self.gitdir = gitdir.replace('\\', '/') 563 self.gitdir = gitdir.replace('\\', '/')