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

Unified Diff: trychange.py

Issue 1739021: Modify scm.GIT.GetUpstreamBranch to behave like git-cl. (Closed)
Patch Set: Created 10 years, 8 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 | « tests/trychange_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trychange.py
diff --git a/trychange.py b/trychange.py
index 2e5239a9e70fbf84a4d17bf77b1754c1bf429fdc..644a55a915f406a1515f9260b7b35bfdfddaa4d6 100755
--- a/trychange.py
+++ b/trychange.py
@@ -213,6 +213,12 @@ class GIT(SCM):
self.options.name = scm.GIT.GetPatchName(self.checkout_root)
if not self.options.email:
self.options.email = scm.GIT.GetEmail(self.checkout_root)
+ if not self.diff_against:
+ self.diff_against = scm.GIT.GetUpstreamBranch(self.checkout_root)
+ if not self.diff_against:
+ print "Unable to determine default branch to diff against."
+ print "Verify this branch is set up to track another"
+ print "(via the --track argument to \"git checkout -b ...\""
logging.info("GIT(%s)" % self.checkout_root)
def ReadRootFile(self, filename):
« no previous file with comments | « tests/trychange_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698