mirror of
https://github.com/frej/fast-export.git
synced 2025-11-14 14:45:40 +01:00
Always pass a sha1 for the initial parent so that git-fast-import doesn't think
it's creating a new branch from itself. It's a sensible error in general but in the case of incremental imports we have to apply force :)
This commit is contained in:
7
git-p4
7
git-p4
@@ -865,7 +865,7 @@ class P4Sync(Command):
|
|||||||
self.previousDepotPath = ""
|
self.previousDepotPath = ""
|
||||||
|
|
||||||
if len(self.branch) == 0:
|
if len(self.branch) == 0:
|
||||||
self.branch = "p4"
|
self.branch = "refs/remotes/p4"
|
||||||
|
|
||||||
if len(args) == 0:
|
if len(args) == 0:
|
||||||
if not gitBranchExists(self.branch) and gitBranchExists("origin"):
|
if not gitBranchExists(self.branch) and gitBranchExists("origin"):
|
||||||
@@ -878,11 +878,12 @@ class P4Sync(Command):
|
|||||||
p4Change = int(p4Change) + 1
|
p4Change = int(p4Change) + 1
|
||||||
self.depotPath = self.previousDepotPath
|
self.depotPath = self.previousDepotPath
|
||||||
self.changeRange = "@%s,#head" % p4Change
|
self.changeRange = "@%s,#head" % p4Change
|
||||||
self.initialParent = self.branch
|
self.initialParent = mypopen("git rev-parse %s" % self.branch).read()[:-1]
|
||||||
if not self.silent:
|
if not self.silent:
|
||||||
print "Performing incremental import into %s git branch" % self.branch
|
print "Performing incremental import into %s git branch" % self.branch
|
||||||
|
|
||||||
self.branch = "refs/heads/" + self.branch
|
if not self.branch.startswith("refs/"):
|
||||||
|
self.branch = "refs/heads/" + self.branch
|
||||||
|
|
||||||
if len(self.depotPath) != 0:
|
if len(self.depotPath) != 0:
|
||||||
self.depotPath = self.depotPath[:-1]
|
self.depotPath = self.depotPath[:-1]
|
||||||
|
|||||||
Reference in New Issue
Block a user