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

Unified Diff: git_map_branches.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.py ('k') | git_nav_downstream.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_map_branches.py
diff --git a/git_map_branches.py b/git_map_branches.py
index 5fde84b282408f8ec7afcb938f2a40800d1050e7..fc6c8cec46f907df097fa5437820a7f6c805c50b 100755
--- a/git_map_branches.py
+++ b/git_map_branches.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.
+
"""
Provides a short mapping of all the branches in your local repo, organized by
their upstream ('tracking branch') layout. Example:
@@ -45,7 +49,14 @@ def print_branch(cur, cur_hash, branch, branch_hashes, par_map, branch_map,
else:
color += Style.NORMAL
- print color + " "*depth + branch + (" *" if branch == cur else "")
+ suffix = ''
+ if cur == 'HEAD':
+ if branch_hash == cur_hash:
+ suffix = ' *'
+ elif branch == cur:
+ suffix = ' *'
+
+ print color + " "*depth + branch + suffix
for child in par_map.pop(branch, ()):
print_branch(cur, cur_hash, child, branch_hashes, par_map, branch_map,
depth=depth+1)
« no previous file with comments | « git_map.py ('k') | git_nav_downstream.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698