summaryrefslogtreecommitdiffstats
path: root/subcmds/status.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-04-18 15:31:36 -0700
committerShawn O. Pearce <sop@google.com>2009-04-18 15:31:36 -0700
commit8bd5e60b16080008771afcaa7de7084487b84780 (patch)
tree1952d4841c15116ae9d26f311a8bc01d09e83e74 /subcmds/status.py
parent3d2cdd0ea533e885183ba2952b2bfa05eb1d05ab (diff)
downloadgit-repo-8bd5e60b16080008771afcaa7de7084487b84780.tar.gz
Make 'repo status' show the branch you are currently on
Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'subcmds/status.py')
-rw-r--r--subcmds/status.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/subcmds/status.py b/subcmds/status.py
index 0b6006ff..b0d419a7 100644
--- a/subcmds/status.py
+++ b/subcmds/status.py
@@ -64,6 +64,19 @@ the following meanings:
64 all = self.GetProjects(args) 64 all = self.GetProjects(args)
65 clean = 0 65 clean = 0
66 66
67 on = {}
68 for project in all:
69 cb = project.CurrentBranch
70 if cb:
71 if cb not in on:
72 on[cb] = []
73 on[cb].append(project)
74
75 branch_names = list(on.keys())
76 branch_names.sort()
77 for cb in branch_names:
78 print '# on branch %s' % cb
79
67 for project in all: 80 for project in all:
68 state = project.PrintWorkTreeStatus() 81 state = project.PrintWorkTreeStatus()
69 if state == 'CLEAN': 82 if state == 'CLEAN':