Commit d0b10a0b authored by tandrii's avatar tandrii Committed by Commit bot

Remove old compatibility for git_cl_upload branches.

R=machenbach@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2116493002
parent 2546dcc0
......@@ -2401,37 +2401,6 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
if options.squash:
self._GerritCommitMsgHookCheck(offer_removal=not options.force)
if not self.GetIssue():
# TODO(tandrii): deperecate this after 2016Q2. Backwards compatibility
# with shadow branch, which used to contain change-id for a given
# branch, using which we can fetch actual issue number and set it as the
# property of the branch, which is the new way.
message = RunGitSilent([
'show', '--format=%B', '-s',
'refs/heads/git_cl_uploads/%s' % self.GetBranch()])
if message:
change_ids = git_footers.get_footer_change_id(message.strip())
if change_ids and len(change_ids) == 1:
details = self._GetChangeDetail(issue=change_ids[0])
if details:
print('WARNING: found old upload in branch git_cl_uploads/%s '
'corresponding to issue %s' %
(self.GetBranch(), details['_number']))
self.SetIssue(details['_number'])
if not self.GetIssue():
DieWithError(
'\n' # For readability of the blob below.
'Found old upload in branch git_cl_uploads/%s, '
'but failed to find corresponding Gerrit issue.\n'
'If you know the issue number, set it manually first:\n'
' git cl issue 123456\n'
'If you intended to upload this CL as new issue, '
'just delete or rename the old upload branch:\n'
' git rename-branch git_cl_uploads/%s old_upload-%s\n'
'After that, please run git cl upload again.' %
tuple([self.GetBranch()] * 3))
# End of backwards compatability.
if self.GetIssue():
# Try to get the message from a previous upload.
message = self.GetDescription()
......
......@@ -795,10 +795,6 @@ class TestGitCl(TestCase):
# If issue is given, then description is fetched from Gerrit instead.
if issue is None:
if squash:
calls += [
((['git', 'show', '--format=%B', '-s',
'refs/heads/git_cl_uploads/master'],), '')]
calls += [
((['git', 'log', '--pretty=format:%s\n\n%b',
'fake_ancestor_sha..HEAD'],),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment