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

Unified Diff: git_cl_hooks.py

Issue 3622002: git_cl_hooks: get cl fields vi git_cl accessors instead of using backquote (Closed)
Patch Set: Remove symlink. 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
diff --git a/git_cl_hooks.py b/git_cl_hooks.py
index 059f52e26c6a79f14ba8c05e1df5cb6f70cb8935..4202502c6e53d61a82292d7de6d3a231a8770d1a 100644
--- a/git_cl_hooks.py
+++ b/git_cl_hooks.py
@@ -9,10 +9,16 @@ import sys
import breakpad
+from git_cl_repo import git_cl
+from git_cl_repo import upload
+
import presubmit_support
import scm
import watchlists
+# Really ugly hack to quiet upload.py
+upload.verbosity = 0
+
def Backquote(cmd, cwd=None):
"""Like running `cmd` in a shell script."""
return subprocess.Popen(cmd,
@@ -43,10 +49,11 @@ class ChangeOptions:
# We use the sha1 of HEAD as a name of this change.
name = Backquote(['git', 'rev-parse', 'HEAD'])
files = scm.GIT.CaptureStatus([root], upstream_branch)
- issue = BackquoteAsInteger(['git', 'cl', 'status', '--field=id'])
- patchset = BackquoteAsInteger(['git', 'cl', 'status', '--field=patch'])
+ cl = git_cl.Changelist()
+ issue = cl.GetIssue()
+ patchset = cl.GetPatchset()
if issue:
- description = Backquote(['git', 'cl', 'status', '--field=desc'])
+ description = cl.GetDescription()
else:
# If the change was never uploaded, use the log messages of all commits
# up to the branch point, as git cl upload will prefill the description
« 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