diff options
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 29 |
1 files changed, 1 insertions, 28 deletions
| @@ -24,10 +24,8 @@ import urllib2 | |||
| 24 | from color import Coloring | 24 | from color import Coloring |
| 25 | from git_command import GitCommand | 25 | from git_command import GitCommand |
| 26 | from git_config import GitConfig, IsId | 26 | from git_config import GitConfig, IsId |
| 27 | from gerrit_upload import UploadBundle | ||
| 28 | from error import GitError, ImportError, UploadError | 27 | from error import GitError, ImportError, UploadError |
| 29 | from remote import Remote | 28 | from remote import Remote |
| 30 | from codereview import proto_client | ||
| 31 | 29 | ||
| 32 | HEAD = 'HEAD' | 30 | HEAD = 'HEAD' |
| 33 | R_HEADS = 'refs/heads/' | 31 | R_HEADS = 'refs/heads/' |
| @@ -481,32 +479,7 @@ class Project(object): | |||
| 481 | branch.remote.projectname = self.name | 479 | branch.remote.projectname = self.name |
| 482 | branch.remote.Save() | 480 | branch.remote.Save() |
| 483 | 481 | ||
| 484 | if branch.remote.ReviewProtocol == 'http-post': | 482 | if branch.remote.ReviewProtocol == 'ssh': |
| 485 | base_list = [] | ||
| 486 | for name, id in self._allrefs.iteritems(): | ||
| 487 | if branch.remote.WritesTo(name): | ||
| 488 | base_list.append(not_rev(name)) | ||
| 489 | if not base_list: | ||
| 490 | raise GitError('no base refs, cannot upload %s' % branch.name) | ||
| 491 | |||
| 492 | print >>sys.stderr, '' | ||
| 493 | _info("Uploading %s to %s:", branch.name, self.name) | ||
| 494 | try: | ||
| 495 | UploadBundle(project = self, | ||
| 496 | server = branch.remote.review, | ||
| 497 | email = self.UserEmail, | ||
| 498 | dest_project = branch.remote.projectname, | ||
| 499 | dest_branch = dest_branch, | ||
| 500 | src_branch = R_HEADS + branch.name, | ||
| 501 | bases = base_list, | ||
| 502 | people = people, | ||
| 503 | replace_changes = replace_changes) | ||
| 504 | except proto_client.ClientLoginError: | ||
| 505 | raise UploadError('Login failure') | ||
| 506 | except urllib2.HTTPError, e: | ||
| 507 | raise UploadError('HTTP error %d' % e.code) | ||
| 508 | |||
| 509 | elif branch.remote.ReviewProtocol == 'ssh': | ||
| 510 | if dest_branch.startswith(R_HEADS): | 483 | if dest_branch.startswith(R_HEADS): |
| 511 | dest_branch = dest_branch[len(R_HEADS):] | 484 | dest_branch = dest_branch[len(R_HEADS):] |
| 512 | 485 | ||
