From 8bd5e60b16080008771afcaa7de7084487b84780 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 18 Apr 2009 15:31:36 -0700 Subject: [PATCH] Make 'repo status' show the branch you are currently on Signed-off-by: Shawn O. Pearce --- subcmds/status.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/subcmds/status.py b/subcmds/status.py index 0b6006f..b0d419a 100644 --- a/subcmds/status.py +++ b/subcmds/status.py @@ -64,6 +64,19 @@ the following meanings: all = self.GetProjects(args) clean = 0 + on = {} + for project in all: + cb = project.CurrentBranch + if cb: + if cb not in on: + on[cb] = [] + on[cb].append(project) + + branch_names = list(on.keys()) + branch_names.sort() + for cb in branch_names: + print '# on branch %s' % cb + for project in all: state = project.PrintWorkTreeStatus() if state == 'CLEAN':