Use refs/heads/* instead of refs/heads/p4/* for local imports
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Simon Hausmann committed
May 23, 2007 at 00:15 UTC
57284050a8123a4c2d22d435a8c6daf1b53011e8
1 file changed
+10
-5
contrib/fast-import/git-p4
+10
-5
@@ -760,10 +760,15 @@ class P4Sync(Command):
760
cmdline += " --branches"
761
762
for line in mypopen(cmdline).readlines():
763
- if line.startswith("p4/") and line != "p4/HEAD\n":
763
+ if self.importIntoRemotes and ((not line.startswith("p4/")) or line == "p4/HEAD\n"):
764
+ continue
765
+ if self.importIntoRemotes:
766
+ # strip off p4
767
branch = line[3:-1]
765
- self.p4BranchesInGit.append(branch)
766
- self.initialParents[self.refPrefix + branch] = parseRevision(line[:-1])
768
+ else:
769
+ branch = line[:-1]
770
+ self.p4BranchesInGit.append(branch)
771
+ self.initialParents[self.refPrefix + branch] = parseRevision(line[:-1])
772
773
def run(self, args):
774
self.depotPath = ""
@@ -777,11 +782,11 @@ class P4Sync(Command):
782
if self.importIntoRemotes:
783
self.refPrefix = "refs/remotes/p4/"
784
else:
780
- self.refPrefix = "refs/heads/p4/"
785
+ self.refPrefix = "refs/heads/"
786
787
createP4HeadRef = False;
788
784
- if self.syncWithOrigin and gitBranchExists("origin") and gitBranchExists(self.refPrefix + "master") and not self.detectBranches:
789
+ if self.syncWithOrigin and gitBranchExists("origin") and gitBranchExists(self.refPrefix + "master") and not self.detectBranches and self.importIntoRemotes:
790
### needs to be ported to multi branch import
791
792
print "Syncing with origin first as requested by calling git fetch origin"