diff options
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -157,11 +157,12 @@ class ReviewableBranch(object): | |||
157 | R_HEADS + self.name, | 157 | R_HEADS + self.name, |
158 | '--') | 158 | '--') |
159 | 159 | ||
160 | def UploadForReview(self, people, auto_topic=False, draft=False): | 160 | def UploadForReview(self, people, auto_topic=False, draft=False, dest_branch=None): |
161 | self.project.UploadForReview(self.name, | 161 | self.project.UploadForReview(self.name, |
162 | people, | 162 | people, |
163 | auto_topic=auto_topic, | 163 | auto_topic=auto_topic, |
164 | draft=draft) | 164 | draft=draft, |
165 | dest_branch=dest_branch) | ||
165 | 166 | ||
166 | def GetPublishedRefs(self): | 167 | def GetPublishedRefs(self): |
167 | refs = {} | 168 | refs = {} |
@@ -497,7 +498,8 @@ class Project(object): | |||
497 | clone_depth = None, | 498 | clone_depth = None, |
498 | upstream = None, | 499 | upstream = None, |
499 | parent = None, | 500 | parent = None, |
500 | is_derived = False): | 501 | is_derived = False, |
502 | dest_branch = None): | ||
501 | """Init a Project object. | 503 | """Init a Project object. |
502 | 504 | ||
503 | Args: | 505 | Args: |
@@ -517,6 +519,7 @@ class Project(object): | |||
517 | parent: The parent Project object. | 519 | parent: The parent Project object. |
518 | is_derived: False if the project was explicitly defined in the manifest; | 520 | is_derived: False if the project was explicitly defined in the manifest; |
519 | True if the project is a discovered submodule. | 521 | True if the project is a discovered submodule. |
522 | dest_branch: The branch to which to push changes for review by default. | ||
520 | """ | 523 | """ |
521 | self.manifest = manifest | 524 | self.manifest = manifest |
522 | self.name = name | 525 | self.name = name |
@@ -559,6 +562,7 @@ class Project(object): | |||
559 | self.work_git = None | 562 | self.work_git = None |
560 | self.bare_git = self._GitGetByExec(self, bare=True) | 563 | self.bare_git = self._GitGetByExec(self, bare=True) |
561 | self.bare_ref = GitRefs(gitdir) | 564 | self.bare_ref = GitRefs(gitdir) |
565 | self.dest_branch = dest_branch | ||
562 | 566 | ||
563 | # This will be filled in if a project is later identified to be the | 567 | # This will be filled in if a project is later identified to be the |
564 | # project containing repo hooks. | 568 | # project containing repo hooks. |
@@ -908,7 +912,8 @@ class Project(object): | |||
908 | def UploadForReview(self, branch=None, | 912 | def UploadForReview(self, branch=None, |
909 | people=([],[]), | 913 | people=([],[]), |
910 | auto_topic=False, | 914 | auto_topic=False, |
911 | draft=False): | 915 | draft=False, |
916 | dest_branch=None): | ||
912 | """Uploads the named branch for code review. | 917 | """Uploads the named branch for code review. |
913 | """ | 918 | """ |
914 | if branch is None: | 919 | if branch is None: |
@@ -922,7 +927,10 @@ class Project(object): | |||
922 | if not branch.remote.review: | 927 | if not branch.remote.review: |
923 | raise GitError('remote %s has no review url' % branch.remote.name) | 928 | raise GitError('remote %s has no review url' % branch.remote.name) |
924 | 929 | ||
925 | dest_branch = branch.merge | 930 | if dest_branch is None: |
931 | dest_branch = self.dest_branch | ||
932 | if dest_branch is None: | ||
933 | dest_branch = branch.merge | ||
926 | if not dest_branch.startswith(R_HEADS): | 934 | if not dest_branch.startswith(R_HEADS): |
927 | dest_branch = R_HEADS + dest_branch | 935 | dest_branch = R_HEADS + dest_branch |
928 | 936 | ||