Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(796)

Unified Diff: git_cl_hooks.py

Issue 3541019: Fix git_cl_hooks brokenness. (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl_hooks.py
===================================================================
--- git_cl_hooks.py (revision 61882)
+++ git_cl_hooks.py (working copy)
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -25,11 +25,11 @@
cwd=cwd,
stdout=subprocess.PIPE).communicate()[0].strip()
-def BackquoteAsInteger(cmd, cwd=None):
- """Like Backquote, but returns either an int or None."""
+def ConvertToInteger(input):
+ """Convert a string to integer, but returns either an int or None."""
try:
- return int(Backquote(cmd, cwd))
- except ValueError:
+ return int(input)
+ except TypeError, ValueError:
return None
@@ -50,8 +50,8 @@
name = Backquote(['git', 'rev-parse', 'HEAD'])
files = scm.GIT.CaptureStatus([root], upstream_branch)
cl = git_cl.Changelist()
- issue = cl.GetIssue()
- patchset = cl.GetPatchset()
+ issue = ConvertToInteger(cl.GetIssue())
+ patchset = ConvertToInteger(cl.GetPatchset())
if issue:
description = cl.GetDescription()
else:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698