Commit 3186301a authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

git cl: allow to forcibly bypass cache and fetch CL description.

R=kbr@chromium.org
BUG=633572,688765

Change-Id: I2ce6530148bc2f00fe9f6a80aaccc520c69a2f83
Reviewed-on: https://chromium-review.googlesource.com/439186
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org>
parent 22e7a27c
......@@ -1355,8 +1355,8 @@ class Changelist(object):
return None
return '%s/%s' % (self._codereview_impl.GetCodereviewServer(), issue)
def GetDescription(self, pretty=False):
if not self.has_description:
def GetDescription(self, pretty=False, force=False):
if not self.has_description or force:
if self.GetIssue():
self.description = self._codereview_impl.FetchDescription()
self.has_description = True
......
......@@ -173,6 +173,16 @@ class SystemExitMock(Exception):
class TestGitClBasic(unittest.TestCase):
def test_get_description(self):
cl = git_cl.Changelist(issue=1, codereview='rietveld',
codereview_host='host')
cl.description = 'x'
cl.has_description = True
cl._codereview_impl.FetchDescription = lambda: 'y'
self.assertEquals(cl.GetDescription(), 'x')
self.assertEquals(cl.GetDescription(force=True), 'y')
self.assertEquals(cl.GetDescription(), 'y')
def _test_ParseIssueUrl(self, func, url, issue, patchset, hostname, fail):
parsed = urlparse.urlparse(url)
result = func(parsed)
......
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