Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-01-10 22:52:50 +0300
committerJunio C Hamano <gitster@pobox.com>2022-01-10 22:52:50 +0300
commit9dbb375f94091279e0c9f52f0a3b559a60244da4 (patch)
tree32ef3a71d68d155dae79847754a284a0727e5527 /git-p4.py
parentbe69d35e4861f4fd84d4d62b9652a0537979ce0a (diff)
parent0fe3df45f2818d15ec5d542948f08eb035846d08 (diff)
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
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py76
1 files changed, 0 insertions, 76 deletions
diff --git a/git-p4.py b/git-p4.py
index 1b5694500a..cb37545455 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1541,80 +1541,6 @@ class P4UserMap:
except IOError:
self.getUserMapFromPerforceServer()
-class P4Debug(Command):
- def __init__(self):
- Command.__init__(self)
- self.options = []
- self.description = "A tool to debug the output of p4 -G."
- self.needsGit = False
-
- def run(self, args):
- j = 0
- for output in p4CmdList(args):
- print('Element: %d' % j)
- j += 1
- print(output)
- return True
-
-class P4RollBack(Command):
- def __init__(self):
- Command.__init__(self)
- self.options = [
- optparse.make_option("--local", dest="rollbackLocalBranches", action="store_true")
- ]
- self.description = "A tool to debug the multi-branch import. Don't use :)"
- self.rollbackLocalBranches = False
-
- def run(self, args):
- if len(args) != 1:
- return False
- maxChange = int(args[0])
-
- if "p4ExitCode" in p4Cmd("changes -m 1"):
- die("Problems executing p4");
-
- if self.rollbackLocalBranches:
- refPrefix = "refs/heads/"
- lines = read_pipe_lines("git rev-parse --symbolic --branches")
- else:
- refPrefix = "refs/remotes/"
- lines = read_pipe_lines("git rev-parse --symbolic --remotes")
-
- for line in lines:
- if self.rollbackLocalBranches or (line.startswith("p4/") and line != "p4/HEAD\n"):
- line = line.strip()
- ref = refPrefix + line
- log = extractLogMessageFromGitCommit(ref)
- settings = extractSettingsGitLog(log)
-
- depotPaths = settings['depot-paths']
- change = settings['change']
-
- changed = False
-
- if len(p4Cmd("changes -m 1 " + ' '.join (['%s...@%s' % (p, maxChange)
- for p in depotPaths]))) == 0:
- print("Branch %s did not exist at change %s, deleting." % (ref, maxChange))
- system("git update-ref -d %s `git rev-parse %s`" % (ref, ref))
- continue
-
- while change and int(change) > maxChange:
- changed = True
- if self.verbose:
- print("%s is at %s ; rewinding towards %s" % (ref, change, maxChange))
- system("git update-ref %s \"%s^\"" % (ref, ref))
- log = extractLogMessageFromGitCommit(ref)
- settings = extractSettingsGitLog(log)
-
-
- depotPaths = settings['depot-paths']
- change = settings['change']
-
- if changed:
- print("%s rewound to %s" % (ref, change))
-
- return True
-
class P4Submit(Command, P4UserMap):
conflict_behavior_choices = ("ask", "skip", "quit")
@@ -4366,13 +4292,11 @@ def printUsage(commands):
print("")
commands = {
- "debug" : P4Debug,
"submit" : P4Submit,
"commit" : P4Submit,
"sync" : P4Sync,
"rebase" : P4Rebase,
"clone" : P4Clone,
- "rollback" : P4RollBack,
"branches" : P4Branches,
"unshelve" : P4Unshelve,
}