MCPcopy Index your code
hub / github.com/git/git / run

Method run

git-p4.py:2526–2779  ·  view source on GitHub ↗
(self, args)

Source from the content-addressed store, hash-verified

2524 print("created p4 label for tag %s" % name)
2525
2526 def run(self, args):
2527 if len(args) == 0:
2528 self.master = currentGitBranch()
2529 elif len(args) == 1:
2530 self.master = args[0]
2531 if not branchExists(self.master):
2532 die("Branch %s does not exist" % self.master)
2533 else:
2534 return False
2535
2536 for i in self.update_shelve:
2537 if i <= 0:
2538 sys.exit("invalid changelist %d" % i)
2539
2540 if self.master:
2541 allowSubmit = gitConfig("git-p4.allowSubmit")
2542 if len(allowSubmit) > 0 and not self.master in allowSubmit.split(","):
2543 die("%s is not in git-p4.allowSubmit" % self.master)
2544
2545 upstream, settings = findUpstreamBranchPoint()
2546 self.depotPath = settings['depot-paths'][0]
2547 if len(self.origin) == 0:
2548 self.origin = upstream
2549
2550 if len(self.update_shelve) > 0:
2551 self.shelve = True
2552
2553 if self.preserveUser:
2554 if not self.canChangeChangelists():
2555 die("Cannot preserve user names without p4 super-user or admin permissions")
2556
2557 # if not set from the command line, try the config file
2558 if self.conflict_behavior is None:
2559 val = gitConfig("git-p4.conflict")
2560 if val:
2561 if val not in self.conflict_behavior_choices:
2562 die("Invalid value '%s' for config git-p4.conflict" % val)
2563 else:
2564 val = "ask"
2565 self.conflict_behavior = val
2566
2567 if self.verbose:
2568 print("Origin branch is " + self.origin)
2569
2570 if len(self.depotPath) == 0:
2571 print("Internal error: cannot locate perforce depot path from existing branches")
2572 sys.exit(128)
2573
2574 self.useClientSpec = False
2575 if gitConfigBool("git-p4.useclientspec"):
2576 self.useClientSpec = True
2577 if self.useClientSpec:
2578 self.clientSpecDirs = getClientSpec()
2579
2580 # Check for the existence of P4 branches
2581 branchesDetected = (len(p4BranchesInGit().keys()) > 1)
2582
2583 if self.useClientSpec and not branchesDetected:

Callers

nothing calls this directly

Calls 15

canChangeChangelistsMethod · 0.95
checkMethod · 0.95
checkValidP4UsersMethod · 0.95
applyCommitMethod · 0.95
sync_origin_onlyMethod · 0.95
runMethod · 0.95
rebaseMethod · 0.95
exportGitTagsMethod · 0.95
currentGitBranchFunction · 0.85
branchExistsFunction · 0.85
gitConfigFunction · 0.85
findUpstreamBranchPointFunction · 0.85

Tested by

no test coverage detected