diff options
author | Simon Hausmann <shausman@trolltech.com> | 2007-05-23 00:15:50 +0200 |
---|---|---|
committer | Simon Hausmann <shausman@trolltech.com> | 2007-05-23 00:15:50 +0200 |
commit | 57284050a8123a4c2d22d435a8c6daf1b53011e8 (patch) | |
tree | 2f41e4583fd36c06d68243b7ab8a04c5feb12228 | |
parent | Added support for --max-changes=<count> to ease import debugging (diff) | |
download | tgif-57284050a8123a4c2d22d435a8c6daf1b53011e8.tar.xz |
Use refs/heads/* instead of refs/heads/p4/* for local imports
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
-rwxr-xr-x | contrib/fast-import/git-p4 | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index 3d97ce1a24..152c3c1ca5 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -760,10 +760,15 @@ class P4Sync(Command): cmdline += " --branches" for line in mypopen(cmdline).readlines(): - if line.startswith("p4/") and line != "p4/HEAD\n": + if self.importIntoRemotes and ((not line.startswith("p4/")) or line == "p4/HEAD\n"): + continue + if self.importIntoRemotes: + # strip off p4 branch = line[3:-1] - self.p4BranchesInGit.append(branch) - self.initialParents[self.refPrefix + branch] = parseRevision(line[:-1]) + else: + branch = line[:-1] + self.p4BranchesInGit.append(branch) + self.initialParents[self.refPrefix + branch] = parseRevision(line[:-1]) def run(self, args): self.depotPath = "" @@ -777,11 +782,11 @@ class P4Sync(Command): if self.importIntoRemotes: self.refPrefix = "refs/remotes/p4/" else: - self.refPrefix = "refs/heads/p4/" + self.refPrefix = "refs/heads/" createP4HeadRef = False; - if self.syncWithOrigin and gitBranchExists("origin") and gitBranchExists(self.refPrefix + "master") and not self.detectBranches: + if self.syncWithOrigin and gitBranchExists("origin") and gitBranchExists(self.refPrefix + "master") and not self.detectBranches and self.importIntoRemotes: ### needs to be ported to multi branch import print "Syncing with origin first as requested by calling git fetch origin" |