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

Unified Diff: git_cl.py

Issue 1761743002: git cl upload for Gerit no-squash: correct detect missing Change-Id. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@G0800
Patch Set: fix tests Created 4 years, 10 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 | tests/git_cl_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 8a8dd95ad4c1fde78267ab75672bf436c894a0bd..c5efc980bb6e1d98555c0c75f9133363774146d8 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -48,7 +48,7 @@ import dart_format
import fix_encoding
import gclient_utils
import git_common
-from git_footers import get_footer_svn_id
+import git_footers
import owners
import owners_finder
import presubmit_support
@@ -2146,7 +2146,7 @@ def AddChangeIdToCommitMessage(options, args):
git_command = ['commit', '--amend', '-m', log_desc]
RunGit(git_command)
new_log_desc = CreateDescriptionFromLog(args)
- if CHANGE_ID in new_log_desc:
+ if git_footers.get_footer_change_id(new_log_desc):
print 'git-cl: Added Change-Id to commit message.'
else:
print >> sys.stderr, 'ERROR: Gerrit commit-msg hook not available.'
@@ -2264,7 +2264,7 @@ def GerritUpload(options, args, cl, change):
ref_to_push = RunGit(['commit-tree', tree, '-p', parent,
'-m', message]).strip()
else:
- if CHANGE_ID not in change_desc.description:
+ if not git_footers.get_footer_change_id(change_desc.description):
AddChangeIdToCommitMessage(options, args)
ref_to_push = 'HEAD'
parent = '%s/%s' % (gerrit_remote, branch)
@@ -3076,7 +3076,7 @@ def IsFatalPushFailure(push_stdout):
def CMDdcommit(parser, args):
"""Commits the current changelist via git-svn."""
if not settings.GetIsGitSvn():
- if get_footer_svn_id():
+ if git_footers.get_footer_svn_id():
# If it looks like previous commits were mirrored with git-svn.
message = """This repository appears to be a git-svn mirror, but no
upstream SVN master is set. You probably need to run 'git auto-svn' once."""
@@ -3098,7 +3098,7 @@ proceed, please verify that the commit lands upstream as expected."""
@subcommand.usage('[upstream branch to apply against]')
def CMDland(parser, args):
"""Commits the current changelist via git."""
- if settings.GetIsGitSvn() or get_footer_svn_id():
+ if settings.GetIsGitSvn() or git_footers.get_footer_svn_id():
print('This appears to be an SVN repository.')
print('Are you sure you didn\'t mean \'git cl dcommit\'?')
print('(Ignore if this is the first commit after migrating from svn->git)')
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698