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

Unified Diff: git_nav_downstream.py

Issue 196433003: Fix git_nav_downstream.py when origin/master is checked out. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Also add a * on origin/master when its checked out Created 6 years, 9 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 | « git_map_branches.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_nav_downstream.py
diff --git a/git_nav_downstream.py b/git_nav_downstream.py
index 9c2a53780a9f288376c16c3ecefffa6f0ca948c8..e394343ba4ba3bd75f3648c2e50f171c5530d74d 100755
--- a/git_nav_downstream.py
+++ b/git_nav_downstream.py
@@ -1,4 +1,8 @@
#!/usr/bin/env python
+# Copyright 2014 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.
+
"""
Checks out a downstream branch from the currently checked out branch. If there
is more than one downstream branch, then this script will prompt you to select
@@ -14,7 +18,11 @@ def main(argv):
upfn = upstream
cur = current_branch()
if cur == 'HEAD':
- upfn = lambda b: hash_one(upstream(b))
+ def _upfn(b):
+ parent = upstream(b)
+ if parent:
+ return hash_one(parent)
+ upfn = _upfn
cur = hash_one(cur)
downstreams = [b for b in branches() if upfn(b) == cur]
if not downstreams:
« no previous file with comments | « git_map_branches.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698