summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8ead4fd)
raw | patch | inline | side by side (parent: 8ead4fd)
author | Simon Hausmann <simon@lst.de> | |
Thu, 17 May 2007 18:57:05 +0000 (20:57 +0200) | ||
committer | Simon Hausmann <simon@lst.de> | |
Thu, 17 May 2007 18:57:05 +0000 (20:57 +0200) |
instead of refs/heads/p4.
Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Simon Hausmann <simon@lst.de>
contrib/fast-import/git-p4 | patch | blob | history | |
contrib/fast-import/git-p4.txt | patch | blob | history |
index 4cd486eb3ae2e098e06d0617d5668fb36b82d068..3cc6481378e23e5d43b42f8ac30a0bea9ffd7727 100755 (executable)
self.changeRange = ""
self.initialParent = ""
self.previousDepotPath = ""
+ # importing into default remotes/p4/* layout?
+ defaultImport = False
if len(self.branch) == 0:
- self.branch = "p4"
+ if gitBranchExists("refs/heads/p4"):
+ self.branch = "p4"
+ else:
+ self.branch = "refs/remotes/p4/master"
+ defaultImport = True
if len(args) == 0:
if not gitBranchExists(self.branch) and gitBranchExists("origin"):
if not branch.startswith("refs"):
branch = "refs/heads/" + branch
system("git update-ref %s origin" % branch)
+ if defaultImport:
+ system("git symbolic-ref refs/remotes/p4/HEAD %s" % branch)
[self.previousDepotPath, p4Change] = extractDepotPathAndChangeFromGitLog(extractLogMessageFromGitCommit(self.branch))
if len(self.previousDepotPath) > 0 and len(p4Change) > 0:
index ff0da9d0c8339ce0c6fadda2c1f5b423627d3f1f..32aeb0ac0ba7be3fd88b3c23649fea40e687ab98 100644 (file)
This will create an empty git repository in a subdirectory called "project" (or
"myproject" with the second command), import the head revision from the
-specified perforce path into a git "p4" branch, create a master branch off it
-and check it out. If you want the entire history (not just the head revision) then
-you can simply append a "@all" to the depot path:
+specified perforce path into a git "p4" branch (remotes/p4 actually), create a
+master branch off it and check it out. If you want the entire history (not just
+the head revision) then you can simply append a "@all" to the depot path:
git-p4 clone //depot/project/main@all myproject