Commit 8f15f3ec authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

git cl refactor: s/should_git_number/should_add_git_number

R=sergiyb@google.com
BUG=chromium:642493

Change-Id: Id7b732d82c25ce88a3295ff54c79cf2a66e0d5b9
Reviewed-on: https://chromium-review.googlesource.com/419437Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
parent a5a1eea5
......@@ -1160,7 +1160,7 @@ class _GitNumbererState(object):
return self._pending_prefix
@property
def should_git_number(self):
def should_add_git_number(self):
return self._validator_enabled and self._pending_prefix is None
......@@ -4658,7 +4658,7 @@ def SendUpstream(parser, args, cmd):
pending_prefix = git_numberer.pending_prefix
if git_numberer.should_git_number:
if git_numberer.should_add_git_number:
# TODO(tandrii): run git fetch in a loop + autorebase when there there
# is no pending ref to push to?
logging.debug('Adding git number footers')
......
......@@ -1169,7 +1169,7 @@ class TestGitCl(TestCase):
remote_url='https://chromium.googlesource.com/chromium/tools/build',
remote_ref='refs/whatever')
self.assertEqual(res.pending_prefix, None)
self.assertEqual(res.should_git_number, False)
self.assertEqual(res.should_add_git_number, False)
def test_GitNumbererState_fail_fetch(self):
self.mock(git_cl.sys, 'stdout', StringIO.StringIO())
......@@ -1185,7 +1185,7 @@ class TestGitCl(TestCase):
remote_url='https://chromium.googlesource.com/chromium/src',
remote_ref='refs/whatever')
self.assertEqual(res.pending_prefix, 'refs/pending-prefix/')
self.assertEqual(res.should_git_number, False)
self.assertEqual(res.should_add_git_number, False)
def test_GitNumbererState_fail_gnumbd_and_validator(self):
self.mock(git_cl.sys, 'stdout', StringIO.StringIO())
......@@ -1203,7 +1203,7 @@ class TestGitCl(TestCase):
remote_url='https://chromium.googlesource.com/chromium/src',
remote_ref='refs/whatever')
self.assertEqual(res.pending_prefix, None)
self.assertEqual(res.should_git_number, False)
self.assertEqual(res.should_add_git_number, False)
def test_GitNumbererState_valid_configs(self):
class NamedTempFileStab(StringIO.StringIO):
......@@ -1248,19 +1248,19 @@ class TestGitCl(TestCase):
remote_url='https://chromium.googlesource.com/chromium/src',
remote_ref='refs/heads/master')
self.assertEqual(res.pending_prefix, 'refs/pending/')
self.assertEqual(res.should_git_number, False)
self.assertEqual(res.should_add_git_number, False)
res = git_cl._GitNumbererState.load(
remote_url='https://chromium.googlesource.com/chromium/src',
remote_ref='refs/heads/test')
self.assertEqual(res.pending_prefix, None)
self.assertEqual(res.should_git_number, True)
self.assertEqual(res.should_add_git_number, True)
res = git_cl._GitNumbererState.load(
remote_url='https://chromium.googlesource.com/chromium/src',
remote_ref='refs/heads/disabled')
self.assertEqual(res.pending_prefix, None)
self.assertEqual(res.should_git_number, False)
self.assertEqual(res.should_add_git_number, False)
# Validator is disabled by default, even if it's not explicitely in disabled
# refglobs.
......@@ -1268,7 +1268,7 @@ class TestGitCl(TestCase):
remote_url='https://chromium.googlesource.com/chromium/src',
remote_ref='refs/arbitrary/ref')
self.assertEqual(res.pending_prefix, None)
self.assertEqual(res.should_git_number, False)
self.assertEqual(res.should_add_git_number, False)
@classmethod
def _gerrit_ensure_auth_calls(cls, issue=None, skip_auth_check=False):
......
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