File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -1465,6 +1465,31 @@ class P4Clone(P4Sync):
1465
1465
1466
1466
return True
1467
1467
1468
+ class P4Branches (Command ):
1469
+ def __init__ (self ):
1470
+ Command .__init__ (self )
1471
+ self .options = [ ]
1472
+ self .description = ("Shows the git branches that hold imports and their "
1473
+ + "corresponding perforce depot paths" )
1474
+ self .verbose = False
1475
+
1476
+ def run (self , args ):
1477
+ cmdline = "git rev-parse --symbolic "
1478
+ cmdline += " --remotes"
1479
+
1480
+ for line in read_pipe_lines (cmdline ):
1481
+ line = line .strip ()
1482
+
1483
+ if not line .startswith ('p4/' ) or line == "p4/HEAD" :
1484
+ continue
1485
+ branch = line
1486
+
1487
+ log = extractLogMessageFromGitCommit ("refs/remotes/%s" % branch )
1488
+ settings = extractSettingsGitLog (log )
1489
+
1490
+ print "%s <= %s (%s)" % (branch , "," .join (settings ["depot-paths" ]), settings ["change" ])
1491
+ return True
1492
+
1468
1493
class HelpFormatter (optparse .IndentedHelpFormatter ):
1469
1494
def __init__ (self ):
1470
1495
optparse .IndentedHelpFormatter .__init__ (self )
@@ -1489,7 +1514,8 @@ commands = {
1489
1514
"sync" : P4Sync ,
1490
1515
"rebase" : P4Rebase ,
1491
1516
"clone" : P4Clone ,
1492
- "rollback" : P4RollBack
1517
+ "rollback" : P4RollBack ,
1518
+ "branches" : P4Branches
1493
1519
}
1494
1520
1495
1521
You can’t perform that action at this time.
0 commit comments