(self, branch, maxChange)
| 3767 | return "" |
| 3768 | |
| 3769 | def importNewBranch(self, branch, maxChange): |
| 3770 | # make fast-import flush all changes to disk and update the refs using the checkpoint |
| 3771 | # command so that we can try to find the branch parent in the git history |
| 3772 | self.gitStream.write("checkpoint\n\n") |
| 3773 | self.gitStream.flush() |
| 3774 | branchPrefix = self.depotPaths[0] + branch + "/" |
| 3775 | range = "@1,%s" % maxChange |
| 3776 | changes = p4ChangesForPaths([branchPrefix], range, self.changes_block_size) |
| 3777 | if len(changes) <= 0: |
| 3778 | return False |
| 3779 | firstChange = changes[0] |
| 3780 | sourceBranch = self.knownBranches[branch] |
| 3781 | sourceDepotPath = self.depotPaths[0] + sourceBranch |
| 3782 | sourceRef = self.gitRefForBranch(sourceBranch) |
| 3783 | |
| 3784 | branchParentChange = int(p4Cmd(["changes", "-m", "1", "%s...@1,%s" % (sourceDepotPath, firstChange)])["change"]) |
| 3785 | gitParent = self.gitCommitByP4Change(sourceRef, branchParentChange) |
| 3786 | if len(gitParent) > 0: |
| 3787 | self.initialParents[self.gitRefForBranch(branch)] = gitParent |
| 3788 | |
| 3789 | self.importChanges(changes) |
| 3790 | return True |
| 3791 | |
| 3792 | def searchParent(self, parent, branch, target): |
| 3793 | targetTree = read_pipe(["git", "rev-parse", |
no test coverage detected