summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8f87253)
raw | patch | inline | side by side (parent: 8f87253)
author | Simon Hausmann <simon@lst.de> | |
Tue, 1 May 2007 21:26:19 +0000 (23:26 +0200) | ||
committer | Simon Hausmann <simon@lst.de> | |
Tue, 1 May 2007 21:26:19 +0000 (23:26 +0200) |
Signed-off-by: Simon Hausmann <simon@lst.de>
contrib/fast-import/git-p4 | patch | blob | history |
index 6b74feeb642281e48f7c56a39545c3797495aade..9927fa142ead96f55087d6036e9ca6fdd47b7ffb 100755 (executable)
self.detectBranches = False
self.detectLabels = False
self.changesFile = ""
- self.tagLastChange = True
def p4File(self, depotPath):
return os.popen("p4 print -q \"%s\"" % depotPath, "rb").read()
self.depotPath = self.previousDepotPath
self.changeRange = "@%s,#head" % p4Change
self.initialParent = self.branch
- self.tagLastChange = False
if not self.silent:
print "Performing incremental import into %s git branch" % self.branch
self.branch = "refs/heads/" + self.branch
- if len(self.depotPath) == 0:
- self.depotPath = self.previousDepotPath = os.popen("git repo-config --get p4.depotpath").read()
-
if len(self.depotPath) != 0:
self.depotPath = self.depotPath[:-1]
self.revision = ""
self.users = {}
self.lastChange = 0
- self.initialTag = ""
if self.depotPath.find("@") != -1:
atIdx = self.depotPath.index("@")
self.rev = int(output[tagIdx + 9 : endPos]) + 1
self.changeRange = "@%s,#head" % self.rev
self.initialParent = os.popen("git rev-parse %s" % self.branch).read()[:-1]
- self.initialTag = "p4/%s" % (int(self.rev) - 1)
except:
pass
if not self.silent:
print ""
- if self.tagLastChange:
- self.gitStream.write("reset refs/tags/p4/%s\n" % self.lastChange)
- self.gitStream.write("from %s\n\n" % self.branch);
-
self.gitStream.close()
self.gitOutput.close()
self.gitError.close()
importProcess.wait()
- os.popen("git repo-config p4.depotpath %s" % self.depotPath).read()
- if len(self.initialTag) > 0:
- os.popen("git tag -d %s" % self.initialTag).read()
-
return True
class P4Rebase(Command):
self.description = "Creates a new git repository and imports from Perforce into it"
self.usage = "usage: %prog [options] //depot/path[@revRange] [directory]"
self.needsGit = False
- self.tagLastChange = False
def run(self, args):
if len(args) < 1: