Skip to content

Commit 9dbb375

Browse files
committed
Merge branch 'jh/p4-remove-unused'
Remove a few commands from "git p4" that aren't very useful. * jh/p4-remove-unused: git-p4: remove "rollback" verb git-p4: remove "debug" verb
2 parents be69d35 + 0fe3df4 commit 9dbb375

File tree

1 file changed

+0
-76
lines changed

1 file changed

+0
-76
lines changed

git-p4.py

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,80 +1541,6 @@ def loadUserMapFromCache(self):
15411541
except IOError:
15421542
self.getUserMapFromPerforceServer()
15431543

1544-
class P4Debug(Command):
1545-
def __init__(self):
1546-
Command.__init__(self)
1547-
self.options = []
1548-
self.description = "A tool to debug the output of p4 -G."
1549-
self.needsGit = False
1550-
1551-
def run(self, args):
1552-
j = 0
1553-
for output in p4CmdList(args):
1554-
print('Element: %d' % j)
1555-
j += 1
1556-
print(output)
1557-
return True
1558-
1559-
class P4RollBack(Command):
1560-
def __init__(self):
1561-
Command.__init__(self)
1562-
self.options = [
1563-
optparse.make_option("--local", dest="rollbackLocalBranches", action="store_true")
1564-
]
1565-
self.description = "A tool to debug the multi-branch import. Don't use :)"
1566-
self.rollbackLocalBranches = False
1567-
1568-
def run(self, args):
1569-
if len(args) != 1:
1570-
return False
1571-
maxChange = int(args[0])
1572-
1573-
if "p4ExitCode" in p4Cmd("changes -m 1"):
1574-
die("Problems executing p4");
1575-
1576-
if self.rollbackLocalBranches:
1577-
refPrefix = "refs/heads/"
1578-
lines = read_pipe_lines("git rev-parse --symbolic --branches")
1579-
else:
1580-
refPrefix = "refs/remotes/"
1581-
lines = read_pipe_lines("git rev-parse --symbolic --remotes")
1582-
1583-
for line in lines:
1584-
if self.rollbackLocalBranches or (line.startswith("p4/") and line != "p4/HEAD\n"):
1585-
line = line.strip()
1586-
ref = refPrefix + line
1587-
log = extractLogMessageFromGitCommit(ref)
1588-
settings = extractSettingsGitLog(log)
1589-
1590-
depotPaths = settings['depot-paths']
1591-
change = settings['change']
1592-
1593-
changed = False
1594-
1595-
if len(p4Cmd("changes -m 1 " + ' '.join (['%s...@%s' % (p, maxChange)
1596-
for p in depotPaths]))) == 0:
1597-
print("Branch %s did not exist at change %s, deleting." % (ref, maxChange))
1598-
system("git update-ref -d %s `git rev-parse %s`" % (ref, ref))
1599-
continue
1600-
1601-
while change and int(change) > maxChange:
1602-
changed = True
1603-
if self.verbose:
1604-
print("%s is at %s ; rewinding towards %s" % (ref, change, maxChange))
1605-
system("git update-ref %s \"%s^\"" % (ref, ref))
1606-
log = extractLogMessageFromGitCommit(ref)
1607-
settings = extractSettingsGitLog(log)
1608-
1609-
1610-
depotPaths = settings['depot-paths']
1611-
change = settings['change']
1612-
1613-
if changed:
1614-
print("%s rewound to %s" % (ref, change))
1615-
1616-
return True
1617-
16181544
class P4Submit(Command, P4UserMap):
16191545

16201546
conflict_behavior_choices = ("ask", "skip", "quit")
@@ -4366,13 +4292,11 @@ def printUsage(commands):
43664292
print("")
43674293

43684294
commands = {
4369-
"debug" : P4Debug,
43704295
"submit" : P4Submit,
43714296
"commit" : P4Submit,
43724297
"sync" : P4Sync,
43734298
"rebase" : P4Rebase,
43744299
"clone" : P4Clone,
4375-
"rollback" : P4RollBack,
43764300
"branches" : P4Branches,
43774301
"unshelve" : P4Unshelve,
43784302
}

0 commit comments

Comments
 (0)